Skip to content

Stuck dispatch jobs

Symptom. Dispatch jobs stay in one status: PENDING and never published, QUEUED and never delivered, or PROCESSING with no outcome. Consumers report missing deliveries; fc_scheduler_pending_oldest_age_seconds climbs, or the console shows jobs that have not changed for a long time.

Background: a job is born PENDING, the dispatch scheduler publishes a pointer and marks it QUEUED, the router picks the pointer up and calls the platform’s delivery callback, which marks it PROCESSING, delivers, and records the outcome. See dispatch jobs.

Count by status for recent jobs (bound created_at so only recent partitions are read):

SELECT status, count(*), min(updated_at) AS oldest_change
FROM msg_dispatch_jobs
WHERE created_at > now() - interval '2 days'
AND status IN ('PENDING', 'QUEUED', 'PROCESSING')
GROUP BY status;

And look at one stuck job: its status, scheduled_for, not_before, expires_at, mode, message_group, dispatch_pool_id, connection_id, attempt_count and last_error, in the console’s job drawer or GET /api/dispatch-jobs/{id} and /attempts.

Then go to the matching section. If jobs are not even being created from events, see step 5.

PENDING jobs wait for the dispatch scheduler. Check in this order.

Is a scheduler running and leading? time() - max(fc_scheduler_last_successful_poll_timestamp_seconds) should be a few seconds. If no process reports the metric, no process has FC_SCHEDULER_ENABLED=true. If the timestamp stands still on every replica, no replica is leader (see leader failover), or the scheduler did not start: look for scheduler disabled: cannot derive dispatch-auth secret (no FLOWCATALYST_APP_KEY), cannot open its database pool or cannot build dispatch publisher. A log line saying the scheduler runs with a NOOP publisher means it has no database and is discarding work.

Is the job waiting on purpose? A PENDING job is skipped, correctly, when:

Cause How to see it What to do
It is sitting out a retry backoff scheduled_for in the future, attempt_count > 0, last_error set Nothing, or requeue it to deliver now
Its connection is PAUSED The connection’s status; fc_scheduler_paused_subscriptions, fc_scheduler_paused_connections Resume the connection when the consumer is ready
Its dispatch pool is SUSPENDED or ARCHIVED The pool’s status Resume the pool
An earlier job in its BLOCK_ON_ERROR group failed mode = 'BLOCK_ON_ERROR'; a FAILED (or backed-off PENDING) job earlier in the same message_group; fc_scheduler_held_groups, fc_scheduler_jobs_skipped_held_total Resolve the head job: requeue it, mark it completed, or cancel it. The group then continues in order

Find failed heads that are holding groups:

SELECT message_group, count(*) AS failed, min(created_at) AS since
FROM msg_dispatch_jobs
WHERE status = 'FAILED' AND mode = 'BLOCK_ON_ERROR'
AND created_at > now() - interval '30 days'
GROUP BY message_group
ORDER BY since;

Since November 2026, a job raised by an event carries the group <subscription id>:<event group>, so a failure holds only that subscriber’s later jobs.

Is publishing failing? fc_scheduler_jobs_unpublished_total rising, with broker errors in the scheduler’s log (SQS throttling or permissions, or a database error for the Postgres broker). The jobs stay PENDING and are claimed again in order once publishing works.

A QUEUED job has a pointer on the queue that has not reached the delivery callback. Jobs QUEUED for 15 minutes are returned to PENDING and published again automatically (fc_scheduler_stale_jobs_recovered_total{status="QUEUED"}), so a steady stream of those recoveries is itself the symptom.

Is the subscription delaying it on purpose? A subscription’s delaySeconds keeps a job QUEUED until its not_before: the callback answers “not yet” and the router brings it back then. Check the job’s not_before and the subscription’s delaySeconds before anything else.

Is a router consuming that queue?

  • Is a router running and leading? Its <prefix>/monitoring/standby-status says.
  • Does it have configuration? A router without FLOWCATALYST_CONFIG_URL starts with no queues and no pools. A router whose config fetch is refused logs a 401 every attempt: check FC_ROUTER_CLIENT_ID, FC_ROUTER_CLIENT_SECRET (a service account with platform:router) and FC_ROUTER_PLATFORM_URL.
  • Does it know the queue? A new client’s queue appears in the router-config document on its first publish; a separately run router picks it up at its next fetch (30 seconds by default). Compare <prefix>/monitoring/queues with the queues the scheduler publishes to.
  • Is the queue moving? On SQS, the queue’s age of oldest message; on the router, fc_queue_pending_messages and fc_consumer_errors_total, and the dashboard’s consumer health.

Is the router reaching the callback? Every message’s callback URL is FC_DISPATCH_PROCESSING_ENDPOINT as the scheduler stamped it. If the router runs in another process and that variable still points at localhost, every delivery fails with a connection error: the router’s warnings and an open circuit breaker for the callback target show it. Point it at the API tier’s internal address.

Is the callback refusing the router? Look in the API tier’s log for dispatch process: bad auth token. The scheduler signs each message with a key derived from FLOWCATALYST_APP_KEY and the API tier checks it; if the two tiers have different app keys, every callback is refused, the router drops the message, and the job cycles between QUEUED and PENDING every 15 minutes without ever being delivered. Make the key identical everywhere. The same happens briefly during an app key rotation (see key rotation).

Is the pool full or rate-limited? Messages for a full pool are deferred and come back later; a rate-limited pool delivers in bursts. Both keep jobs QUEUED for a while. See pool draining slowly.

Is one message stuck in the router? Look the job id up: GET <prefix>/monitoring/in-flight-messages/detail?messageId=<job id> shows whether the router holds it and in what state (mediating, waiting for a retry, or tracked but idle). A message the router holds but is not processing can be released with POST <prefix>/monitoring/in-flight-messages/<job id>/ack, which acknowledges it on the broker and forgets it. The job then recovers through the 15-minute stale path, or requeue it.

PROCESSING means a delivery attempt started. It normally ends within the job’s timeout (30 seconds by default; deliveries can be configured to take much longer).

  • A slow consumer. The attempt is still running. The router’s mediating list (<prefix>/monitoring/mediating) shows how long each delivery has run.
  • A platform process died mid-delivery. The callback’s claim is a lease: the job’s timeout (capped at 2 minutes) plus 30 seconds. A later copy of the message takes the claim over and delivers again. If no copy comes back, the job is returned to PENDING after 75 minutes (fc_scheduler_stale_jobs_recovered_total{status="PROCESSING"}), with the reason in last_error.
  • Siblings stranded behind a failed head of a BLOCK_ON_ERROR group are returned to PENDING by the platform within 2 minutes.

If you cannot wait, select the jobs in the console and use Requeue in flight. A delivery that is in fact still running may then land as well as the new one; consumers are idempotent, but say so to the consumer’s owner.

If events arrive but no jobs are created, the event fan-out is not running. It is part of the stream processor:

SELECT count(*), min(created_at) FROM msg_events WHERE fanned_out_at IS NULL;

A growing count means no process runs FC_STREAM_PROCESSOR_ENABLED=true, or none leads its election. If the count is zero, check that a subscription matches: the event type, the subscription’s status, its client scope and binding.

Situation Action
Waiting on a paused connection or suspended pool Resume it when the consumer is ready
A BLOCK_ON_ERROR group held by a failed head Requeue, complete or cancel the head
Jobs failed and should go again Requeue
A job should not be delivered at all Cancel it
Infrastructure fixed (scheduler, router, keys) Nothing: stale recovery republishes within 15 minutes. Requeue to speed it up