Pav Staz
03/09/2026, 1:37 PMMarvin
03/09/2026, 1:37 PMMarvin
03/09/2026, 1:47 PMpause_on_shutdown=True). On startup, it does not auto-resume.
- When a deployment is paused, the server’s scheduler stops creating new SCHEDULED runs. Any SCHEDULED runs that were already created in the DB will still execute; once those are consumed, nothing else is created and the UI stops showing “Next run”.
How to confirm
1) List schedules and their status for each deployment:
prefect deployment schedule ls pre_dbt_syncs/pre_dbt_syncs
prefect deployment schedule ls post_dbt_jobs/post_dbt_jobs
If they’re paused, you’ll see that indicated there. If you’re unsure of the exact names, list all deployments first:
prefect deployment ls
2) Inspect the deployment to see schedule info:
prefect deployment inspect pre_dbt_syncs/pre_dbt_syncs
prefect deployment inspect post_dbt_jobs/post_dbt_jobs
How to fix now
- Resume the schedules:
prefect deployment schedule resume pre_dbt_syncs/pre_dbt_syncs --all
prefect deployment schedule resume post_dbt_jobs/post_dbt_jobs --all
How to prevent this next time
- Don’t auto-pause on container shutdowns/restarts:
pre_dbt_syncs.serve(
name="pre_dbt_syncs",
cron="30 0 * * *",
pause_on_shutdown=False
)
post_dbt_jobs.serve(
name="post_dbt_jobs",
cron="0 4 * * *",
pause_on_shutdown=False
)
- Alternatively, explicitly resume on container start (e.g., a small bootstrap step that calls resume_deployment for these two deployments), or wire a one-time prefect deployment schedule resume ... --all into your container’s startup script.
If they’re not paused
Since you mentioned other deployments still show next runs, the server scheduler is almost certainly healthy. If these two are not paused:
- Verify the schedules still exist and are active via prefect deployment schedule ls ...
- Check container clocks/timezones just in case (date -u inside the server and runner containers)
- Confirm only one runner instance is serving each deployment (duplicate runners won’t stop scheduling but can make logs confusing)
- Share the output of:
- prefect deployment schedule ls <name>
- prefect deployment inspect <name>
- A snippet of runner logs around startup/shutdown (look for “Pausing all deployments…”)
But in practice, 9 times out of 10 this exact pattern is caused by the default pause_on_shutdown=True combined with a prior container stop/restart. Resuming the schedules should restore “Next run” in the UI and future triggers.Pav Staz
03/09/2026, 3:51 PMMarvin
03/09/2026, 3:51 PMMarvin
03/09/2026, 3:55 PMprefect flow-run ls --flow-name pre_dbt_syncs --state SCHEDULED --limit 10
prefect flow-run ls --flow-name post_dbt_jobs --state SCHEDULED --limit 10
If you get 0 results for both, it matches the UI and confirms the scheduler hasn’t generated any future runs.
2) Nudge the scheduler to regenerate for these two deployments
- Toggling the schedules forces a re-evaluation by the server’s scheduler services.
prefect deployment schedule pause 'pre-dbt-syncs/pre_dbt_syncs' --all
prefect deployment schedule resume 'pre-dbt-syncs/pre_dbt_syncs' --all
prefect deployment schedule pause 'post-dbt-jobs/post_dbt_jobs' --all
prefect deployment schedule resume 'post-dbt-jobs/post_dbt_jobs' --all
- Give it 60–120 seconds and refresh the UI. You should see “Next run” reappear if this was a stale scheduling state.
3) If the toggle does not restore “Next run”
- Re-apply the schedules by re-running the serve code (or restart each serve container so it calls RunnerDeployment.apply() again). This re-syncs the schedule definition and makes it “recent” for the server’s “recent deployments scheduler” loop to pick up quickly.
- Alternatively, temporarily add a minute-level schedule to test whether the scheduler will generate runs now, then remove it:
prefect deployment schedule create 'pre-dbt-syncs/pre_dbt_syncs' --cron "*/5 * * * *"
# wait ~1–2 minutes and check UI, then:
prefect deployment schedule delete 'pre-dbt-syncs/pre_dbt_syncs' <that_new_schedule_id>
4) Double-check the serve runners are healthy
- The stale last_polled (2026-03-04) is suspicious. Please confirm the two serve containers are still running and actively polling. Typical runner logs will show periodic “polling for scheduled runs” messages. If they’ve stopped, they won’t execute new runs even if the server starts scheduling them again. That said, even with a stopped runner, the UI should still show a “Next run” if the server is generating future runs — so a missing “Next run” points squarely at scheduling, not execution.
5) If issues persist, grab scheduler logs from the server container
- Set server logging to debug and look for entries about scheduling these deployment IDs:
- Look for lines mentioning “scheduler” and either of these IDs:
- pre_dbt_syncs deployment_id: cba46cab-45d7-444a-a9cd-56fcf1ad148f
- post_dbt_jobs deployment_id: ad0ef257-4669-454a-8458-5adbab012d0f
- Also confirm the scheduler service is enabled (it should be, since other deployments are fine).
Optional hardening for the future
- If these containers are ever shut down or restarted, consider running serve with pause_on_shutdown=False so schedules keep generating even if the runner is offline:
pre_dbt_syncs.serve(name="pre_dbt_syncs", cron="30 0 * * *", pause_on_shutdown=False)
post_dbt_jobs.serve(name="post_dbt_jobs", cron="0 4 * * *", pause_on_shutdown=False)
- Or add a small startup step that resumes schedules for these two deployments on container start.
Could you:
- Run the two flow-run ls commands above and share the output?
- Try the pause/resume toggle and let me know if “Next run” reappears within a couple minutes?Marvin
03/09/2026, 3:55 PMPav Staz
03/09/2026, 4:23 PMMarvin
03/09/2026, 4:23 PMMarvin
03/09/2026, 4:25 PMprefect config view --show-defaults --show-sources
Notes on your earlier toggle not materializing runs
- Your restart fixing it suggests the scheduler service loop had stopped processing certain schedules (even though it was running for others). Toggling “active” on/off should nudge the “recent deployments” scheduler to regenerate; if it doesn’t, a server restart is the definitive reset.
- If this happens again, capturing the server logs around the scheduler service would help us isolate whether there’s an edge case we should file.
If you want, share the output of:
- prefect config view --show-defaults --show-sources | grep -i scheduler -n
and I can suggest concrete values to tune how many Upcoming runs you see and how far ahead they’re generated.