Django + Celery + redis
Возникают две ошибки
При запуске Celery
[2019-05-07 18:22:53,012: WARNING/MainProcess] /home/django/venv/lib/python3.5/site-packages/celery/app/control.py:54: DuplicateNodenameWarning: Received multiple replies from node name: celery@user0123.
Please make sure you give each node a unique nodename using
the celery worker `-n` option.
pluralize(len(dupes), 'name'), ', '.join(sorted(dupes)),
Вторая:
Выполняю простую задачу через
python ./manage.py shell
>>> asd.delay()
<AsyncResult: 4df07451-f474-405b-92e2-6b604191998c>
Но в логах celery возникает ошибка
[2019-05-07 18:22:57,733: ERROR/MainProcess] Received unregistered task of type 'bot.tasks.asd'.
The message has been ignored and discarded.
Did you remember to import the module containing this task?
Or maybe you're using relative imports?
Please see
docs.celeryq.org/en/latest/internals/protocol.html
for more information.
The full contents of the message body was:
b'[[], {}, {"errbacks": null, "callbacks": null, "chain": null, "chord": null}]' (77b)
Traceback (most recent call last):
File "/home/django/venv/lib/python3.5/site-packages/celery/worker/consumer/consumer.py", line 559, in on_task_received
strategy = strategies[type_]
KeyError: 'bot.tasks.asd'
Иногда выполняется 1 раз из нескольких , потом опять ошибка
[2019-05-07 18:43:26,645: INFO/ForkPoolWorker-1] Task bot.tasks.asd[f6c131b4-dea7-4b67-a49c-bd7adb0158bc] succeeded in 0.0036388610024005175s: 100
код в tasks.py
from __future__ import absolute_import, unicode_literals
from celery import task
@task
def asd():
return (100)
# Some other code