Carlos Martinez Palomino
09/03/2025, 2:34 PM- name: clean_stuck_runs
version: 0.1.0
tags: []
concurrency_limit: null
description: null
schedules:
- cron: "*/30 * * * *"
timezone: "Europe/Berlin"
active: true
max_scheduled_runs: 6
entrypoint: flows/clean_stuck_runs/clean_stuck_runs_flow.py:clean_stuck_runs_flow
parameters: {}
work_pool:
name: maintenance_jobs_agent_production
job_variables:
image: _IMAGE_SHA_URI
namespace: prod
name: clean-up-stuck-flows-job
environment: production
parameters: {}
and no scheduled flow runs were scheduled. What's the root cause? is it the prefect server?Marvin
09/03/2025, 2:34 PMMarvin
09/03/2025, 2:44 PMprefect.yaml
isn’t enough — you must register/update the deployment.
- Verify the deployment and its schedules as seen by the API:
prefect deployment ls
prefect deployment inspect "<flow-name>/<deployment-name>"
If schedules
is empty there, rerun:
prefect deploy
More on deployment in 3.x: Deployments
2) The Server scheduler isn’t actually running
- If Server was started with --no-services
or --no-scheduler
, nothing will be created.
- Check how you start Server and config:
prefect server start --help
prefect config view --show-defaults | grep -i scheduler
You should see the scheduler enabled. Docs: Schedules
3) Timezone resolution is failing in the Server environment
- Your schedule uses timezone: "Europe/Berlin"
. Prefect relies on the system’s IANA tz database (zoneinfo). In lean containers without tzdata, resolving that timezone can fail (e.g., ZoneInfoNotFoundError) and the scheduler will skip scheduling.
- Check the server logs for errors around timezone handling.
- Quick test in the same environment:
python -c "from zoneinfo import ZoneInfo; ZoneInfo('Europe/Berlin'); print('ok')"
- If it fails, install tzdata (e.g., Debian/Ubuntu: `apt-get update && apt-get install -y tzdata`; Alpine: apk add tzdata
) or temporarily remove the timezone/use UTC
.
4) Clock skew or “late runs” disabled
- If the server clock is off and late-runs
is disabled, missed runs won’t backfill. You’d still see future runs, but it’s worth checking:
prefect server start --help # look for --late-runs/--no-late-runs
prefect config view --show-defaults | grep -i late
A quick checklist to pinpoint root cause
- Confirm the deployment (on the server) really has the cron schedule:
prefect deployment ls
prefect deployment inspect "<flow-name>/<deployment-name>"
- Confirm the Server scheduler is enabled and running (no --no-services
, no --no-scheduler
).
- Check Server logs for timezone errors; validate tzdata with the Python snippet above.
If you share:
- your Prefect version,
- how you start Prefect Server,
- the output of prefect deployment inspect
for this deployment,
I can zero in on the exact cause.
References
- Schedules: Prefect 3.x Schedules
- Settings reference: Settings reference