Skip to content

Troubleshooting · By Rivtor · Updated

Why a Celery worker is not receiving tasks

Check that the producer and Celery worker use the same broker, queue routing and registered task names. Then inspect worker startup, dependency imports and task state. A running process or successful enqueue call does not establish that the intended worker receives the message.

See the Rivtor deployment workflow →

Compare producer and consumer configuration

Record sanitized broker identity, logical database where applicable, queue names and routing rules on both sides. A single environment-variable typo can send work to a queue no worker is consuming. Avoid logging the broker password while comparing endpoints.

Inspect the worker’s startup log for its selected app, queues and registered tasks. A task name in the message must correspond to importable code in the worker environment. The producer’s local function definition is not transferred as executable source inside the job.

Trace one synthetic task

ObservationNext check
Queue grows, worker idleQueue selection, routing and broker identity
Unregistered task messageImports, task naming and deployed revision
Task received but not completedExecution failure, time limit or blocked dependency
Task disappearsAcknowledgement, eviction, expiry or another consumer

Use a harmless task with a known result and unique identifier. Compare the producer acknowledgement, queue state, worker receipt and final outcome. Do not repeatedly enqueue real customer work as a diagnostic.

Check deployment and resource assumptions

Confirm the worker starts from the correct service root with its dependencies installed. Keep the broker connection private and reachable from that process. On Rivtor, inspect Celery detection and the Redis policy and limits.

An external process consuming the same queue can explain why your expected worker sees nothing. A queue name shared between test and production can also send work to an incompatible code revision. Separate environments deliberately.

Verify delivery and recovery together

After fixing routing or imports, run a synthetic task and a controlled worker restart. Review acknowledgement and retry settings for the pinned Celery version. Acknowledging before execution and acknowledging after execution have different failure behaviour; neither removes the need for idempotent side effects.

Inspect failed jobs rather than assuming that retrying fixes the cause. Bound retries and retained results, and document a recovery path for tasks that need manual review. The success criterion is the expected durable output, not just a quiet worker log.

References