Celery Daemon receives unregistered tasks

6,940

Late answer, but maybe it helps someone.

Have you seen http://docs.celeryproject.org/en/latest/userguide/tasks.html#automatic-naming-and-relative-imports ?

You should start the worker with --loglevel=info, that way it will log a list of registered tasks when it starts up. You must make sure the names the tasks are registered with matches the name you are sending in messages.

Share:
6,940

Related videos on Youtube

Bastian
Author by

Bastian

Updated on September 18, 2022

Comments

  • Bastian
    Bastian almost 2 years

    I installed Celery for my Django project following what the official tutorial / doc says. And it's working fine when I launch celery at the command line, I can see it receiving the tasks and execute them. But once everything was working I decided to follow the docs a bit more to daemonize celery and leave it running all the time. So I tried the provided celeryd init scripts on an Ubuntu system with the /etc/default/celeryd script too. I changed the values accordingly and it starts correctly but when it receives a task the log says:

    ERROR/MainProcess] Received unregistered task of type 'likes.tasks.test'.
    The message has been ignored and discarded.
    
    Did you remember to import the module containing this task?
    Or maybe you are using relative imports?
    Please see http://bit.ly/gLye1c for more information.
    

    And then I get the details of what the task was asking. Again, this task works perfectly when I launch celery on the command line without any configuration. What could have gone wrong at that point? I use a virtual environment just in case it would change anything, but I specified it in the config file too.