Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-celery-email error "Received unregistered task of type 'djcelery_email_send'." #480

Closed
espenak opened this issue Nov 12, 2013 · 2 comments

Comments

@espenak
Copy link
Member

espenak commented Nov 12, 2013

Traceback

[2013-11-12 09:53:14,495: INFO/MainProcess] consumer: Connected to amqp://devilry@127.0.0.1:5672/devilryhost.
[2013-11-12 09:55:09,065: ERROR/MainProcess] Received unregistered task of type 'djcelery_email_send'.
The message has been ignored and discarded.

Did you remember to import the module containing this task?
Or maybe you are using relative imports?
More: http://docs.celeryq.org/en/latest/userguide/tasks.html#names

The full contents of the message body was:
{'utc': True, 'chord': None, 'args': (<django.core.mail.message.EmailMessage object at 0x12d08450>,), 'retries': 0, 'expires': None, 'task': 'djcelery_email_send', 'callbacks': None, 'errbacks': None, 'taskset': None, 'kwargs': {'_backend_init_kwargs': {'username': None, 'password': None}}, 'eta': None, 'id': '96445c40-e97c-45b6-afba-cbf6dd8e79e6'} (1132b)
Traceback (most recent call last):
  File "/ifi/asgard/p00/devilry/devilrybuild/buildoutcache/eggs/celery-3.0.13-py2.7.egg/celery/worker/consumer.py", line 435, in on_task_received
    strategies[name](message, body, message.ack_log_error)
KeyError: ‘djcelery_email_send'

Workaround

Do not use django-celery-email.

espenak added a commit that referenced this issue Nov 12, 2013
…APPS.

This is the fix for #480 - we simply forgot to include it in the
migration guide.
@espenak
Copy link
Member Author

espenak commented Nov 12, 2013

The fix

This is simply a bug in the migration guide. We forgot to include that:

INSTALLED_APPS += ['djcelery_email']

Must be included in the settings-file.

@espenak
Copy link
Member Author

espenak commented Nov 12, 2013

How to debug similar problems (for developers)

Uncomment the For testing sections under Celery in src/devilry_developer/devilry_developer/settings/base.py and comment out CELERY_ALWAYS_EAGER=True to actually send Celery tasks to the Celery worker.

Run the celery worker with:

$ bin/django_dev.py celery worker --no-execv --loglevel=debug

We have a test-task in src/devilry_developer/devilry_developer/tasks.py that you can test using the shell:

$ bin/django_dev.py shell
>>> from devilry_developer.tasks import add 
>>> add.delay(2, 2)

It should produce some output from the celery worker.

espenak added a commit to devilry/devilry-deploy that referenced this issue Nov 12, 2013
@espenak espenak closed this as completed May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant