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.
[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
- Add the module to the app
includelist, or callapp.autodiscover_tasks(). - Confirm the worker starts with the correct app via
-A. - Check registered tasks with
celery -A app inspect registered.
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.
celery -A app inspect registeredHow 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.