-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefect Server returns 503 when updating ConcurrencyLimit for a Deployment without a ConcurrencyLimit #17227
Comments
Manually updating the concurrency limit within the UI works just fine. After that the deployment script via python also works again. Which i find strange since I expect the UI to call the same endpoint basically |
@marcm-ml can you share the code you used to reproduce this? Would help us solve it faster |
@cicdw sure, here you go: script.py: import argparse
from datetime import timedelta
from prefect import flow
from prefect.client.schemas.actions import DeploymentScheduleCreate
from prefect.client.schemas.objects import ConcurrencyLimitConfig
from prefect.client.schemas.schedules import IntervalSchedule
from prefect.deployments.runner import RunnerDeployment
parser = argparse.ArgumentParser()
parser.add_argument("--concurrency", action="store_true", default=False)
@flow
def my_flow():
print("test")
def main(concurrency: bool):
deployment = RunnerDeployment.from_flow(
my_flow,
name="MyDeployment",
concurrency_limit=ConcurrencyLimitConfig(limit=1) if concurrency else None,
schedules=[DeploymentScheduleCreate(schedule=IntervalSchedule(interval=timedelta(hours=1)))],
)
deployment.apply()
if __name__ == "__main__":
args = parser.parse_args()
main(args.concurrency) terminal: prefect server start --port 4200 --background
python script.py
python script.py --concurrency # <-- should crash
prefect server stop I noticed that it is crucial to define a schedule on the deployment. otherwise it works just fine |
Thank you, this is helpful - I think I know what might be happening; will report back |
OK I think I figured it out but it will require a fix to get merged; in the meantime, if you add a ...
schedules=[DeploymentScheduleCreate(slug="hourly", schedule=IntervalSchedule(interval=timedelta(hours=1)))],
... |
Thanks for the quick answer. Does the slug need to be unique for all deployments, only the one deployment that it is attached to or not at all? |
Only for the one deployment that it is attached to 👍 |
Bug summary
See title. I am using the prefect server python SDK. Not the CLI nor prefect.yaml. I create the deployment programmatically in python using native prefect APIs.
Reproduction: When running prefect-server, create a deployment without a concurrency limit defined first. send that to the API. then do a deployment update where you add a concurrency update. Send that to the API again and then the client call with retunr 503 and the prefect-server throws an exception (See below)
This also happens when updating an existing deployment's concurrency limit. so it always happens when you change something with the concurrency limit.
Version info
Additional context
Client Traceback:
Server Traceback:
The text was updated successfully, but these errors were encountered: