Skip to content
Latchkey

Celery "Received unregistered task of type" in CI

A worker pulled a message for a task name it does not know. The task is registered only when its module is imported; if the worker's include/autodiscover did not load that module, the name is unregistered and the message is discarded.

What this error means

The worker logs "Received unregistered task of type 'app.tasks.send_email'. The message has been ignored and discarded" and the task never runs.

python
[ERROR/MainProcess] Received unregistered task of type 'app.tasks.send_email'.
The message has been ignored and discarded.
KeyError: 'app.tasks.send_email'

Common causes

The task module is not imported by the worker

Autodiscovery or include did not load the module that defines the task, so it was never registered on the worker.

Producer and worker disagree on the task name

The caller sends a task name the worker does not register, often after a rename or a different app instance.

How to fix it

Make the worker import the task module

  1. Add the module to the app include list, or call app.autodiscover_tasks().
  2. Confirm the worker starts with the correct app via -A.
  3. Check registered tasks with celery -A app inspect registered.
python
app = Celery("app", include=["app.tasks"])
app.autodiscover_tasks(["app"])

Keep task names consistent

Use the same app and import paths on producer and worker so the registered name matches what is sent.

Terminal
celery -A app inspect registered

How to prevent it

  • List task modules in include or call autodiscover_tasks.
  • Start the worker with the right -A app.
  • Verify registered tasks in CI before enqueueing.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →