<@ULVA73B9P> I have a deployment I have scheduled ...
# ask-marvin
n
@Marvin I have a deployment I have scheduled throught UI, the schedule is active with now as anchor date, and should run a flow run every ten minutes. Yet, no run is scheduled, despite the schedule being present and active on the UI. I have self hosted prefect server 3.6.12
m
thought for 123.3 seconds
What you’re describing usually means the scheduler service is not running, not that the UI schedule itself is broken. In self-hosted Prefect Server, an active deployment schedule in the UI does not by itself create flow runs. A server background service has to scan deployments and insert scheduled runs. Most likely cause:
prefect server services start
is not running alongside your API/UI. What to check: 1. Make sure background services are running If you only started the API/web server, schedules can appear active in the UI but no runs will be created. You should have a process/container running:
Copy code
prefect server services start
2. Check whether the deployment is paused Even with an active schedule, paused deployments are skipped by the scheduler. 3. Check scheduler-related logs Start the services with debug logging and look for scheduler errors:
Copy code
PREFECT_SERVER_LOGGING_LEVEL=DEBUG prefect server services start
4. Verify server settings In particular: -
PREFECT_SERVER_SERVICES_SCHEDULER_ENABLED=true
- if you run multiple server instances, configure
PREFECT_SERVER_DOCKET_URL
to Redis for coordination A common self-hosted setup is: - one process/container for
prefect server start
or API/UI - one separate process/container for:
Copy code
prefect server services start
If you’re running multiple API/service replicas, background services need coordination; see the self-hosted docs: Self-hosted Prefect docs Also useful: - Schedules - Deployments If you want, I can help you verify your exact docker-compose / k8s / systemd setup and point out what process is missing.
n
@Marvin background services are running separately on Kubernetes and the pod is up, no error logs
m
thought for 157.1 seconds
Thanks — that narrows it down a lot. If the background services pod is up and logs are quiet, Prefect can still silently schedule 0 runs if it finds no eligible deployments. The main things I’d check next are: 1. Is the deployment itself paused? An active schedule is not enough if the deployment has
paused: true
. Check in the UI and via API if possible: - Deployment settings → paused toggle -
GET /api/deployments/<deployment_id>
2. Is the schedule actually active in the database/API? Sometimes the UI shows the schedule entry, but what matters is whether the deployment has a schedule with
active=true
. You can inspect: -
GET /api/deployments/<deployment_id>/schedules
You want to confirm: - the schedule exists -
active
is
true
3. Are scheduled runs already present but just not visible where you expect? The scheduler tries to maintain future scheduled runs. Check the DB or API for runs in
SCHEDULED
state for that deployment. If you have DB access, this is a very useful query:
Copy code
sql
SELECT id, deployment_id, expected_start_time, state_type, auto_scheduled
FROM flow_run
WHERE deployment_id = '<deployment-id>'
ORDER BY expected_start_time ASC;
If nothing is returned, the scheduler truly isn’t inserting runs. 4. Kubernetes-specific: are you using Redis for Docket? This is a big one for self-hosted K8s. By default, Prefect server coordination uses
memory://
, which is not appropriate for multi-pod/high-availability setups. On Kubernetes, you generally want:
Copy code
bash
PREFECT_SERVER_DOCKET_URL=redis://<redis-host>:6379/0
If this is missing, background services can behave unexpectedly across pods. Even if you only have one services pod today, it’s still worth checking the actual value inside the pod. 5. Confirm the scheduler service is actually enabled in that pod’s settings Inside the background services pod, check effective settings:
Copy code
bash
python -c "from prefect.settings import get_settings; s=get_settings(); print(s.server.services.scheduler.enabled); print(s.server.docket.url); print(s.server.services.scheduler.loop_seconds)"
You want: - scheduler enabled =
True
- docket URL = your Redis URL, not
memory://
for K8s - loop seconds looks normal 6. Check whether the scheduler is silently finding no eligible deployments This can happen if: - deployment is paused - no active schedules - enough future runs are already present - scheduler query is not seeing the deployment as needing runs In practice, the cleanest API checks are: - deployment object - deployment schedules - flow runs for that deployment Most likely culprits in your case 1. deployment is paused 2. schedule is not truly active in API/DB 3.
PREFECT_SERVER_DOCKET_URL
is not set to Redis in Kubernetes 4. scheduled runs exist but are not where you’re looking 5. less likely: DB/migration/index issue affecting scheduler queries If you want, send me the output of these three checks and I can help pinpoint it:
Copy code
bash
curl http://<prefect-api>/api/deployments/<deployment_id>
curl http://<prefect-api>/api/deployments/<deployment_id>/schedules
kubectl exec <background-services-pod> -- printenv | grep PREFECT_SERVER_DOCKET_URL
Docs: - Self-hosted Prefect - Schedules - Deployments