python - Received unregistered task using Celery with Django -
i have celery setup django project , can't seem task run properly. i'm using django 1.4.3, celery 3.0.1, django-celery 3.0.17 , python 2.7 on ubuntu 13.04.
i have verified rabbitmq-server running:
sudo service rabbitmq-server status status of node rabbit@fenster ... [{pid,1667}, {running_applications,[{rabbit,"rabbitmq","3.0.2"}, {os_mon,"cpo cxc 138 46","2.2.9"}, {mnesia,"mnesia cxc 138 12","4.7"}, {sasl,"sasl cxc 138 11","2.2.1"}, {stdlib,"erts cxc 138 10","1.18.1"}, {kernel,"erts cxc 138 10","2.15.1"}]}, {os,{unix,linux}}, {erlang_version,"erlang r15b01 (erts-5.9.1) [source] [64-bit] [smp:8:8] [async-threads:30] [kernel-poll:true]\n"}, {memory,[{total,28112760}, {connection_procs,93432}, {queue_procs,42680}, {plugins,0}, {other_proc,9331824}, {mnesia,65288}, {mgmt_db,0}, {msg_index,86656}, {other_ets,764048}, {binary,1343288}, {code,12372068}, {atom,512601}, {other_system,3500875}]}, {vm_memory_high_watermark,0.4}, {vm_memory_limit,6719406080}, {disk_free_limit,1000000000}, {disk_free,122925531136}, {file_descriptors,[{total_limit,924}, {total_used,7}, {sockets_limit,829}, {sockets_used,3}]}, {processes,[{limit,1048576},{used,151}]}, {run_queue,0}, {uptime,275789}] ...done.
i have django project setup in virtualenv. have celery configured in settings.py file as:
installed_apps = [ # django apps # our apps ... # third party modules ... 'djcelery', ] import djcelery djcelery.setup_loader() celery_imports = ('my.task')
the rabbitmq broker setup - have other celery tasks running properly.
my task:
import celery class myclass(object): @celery.task() def my_task(self, new, old): # stuff return def kick_off_tasks(self): # stuff new = 'something' old = 'something else' self.my_task.apply_async(args(new, old), kwarg1='new', kwarg2='old) # more stuff
when run view calls kick_off_tasks
receive following in celeryd info log:
./manage.py celeryd --loglevel=info [tasks] . my.task . other.tasks . more.tasks . etc.etc.etc [2013-08-23 14:18:40,772: warning/mainprocess] celery@fenster has started. [2013-08-23 14:20:40,757: error/mainprocess] received unregistered task of type 'my.task'. message has been ignored , discarded. did remember import module containing task? or maybe using relative imports? please see http://bit.ly/glye1c more information. full contents of message body was: {'retries': 0, 'task': 'my.task', 'eta': none, 'args': ('something, 'something else'), 'expires': none, 'callbacks': none, 'errbacks': none, 'kwargs': {}, 'id': 'bf4d5ee7-9701-42b6-a887-c6b6470d9810', 'utc': true} (2297b) traceback (most recent call last): file "/home/ricomoss/.virtualenvs/proton/local/lib/python2.7/site-packages/celery/worker/consumer.py", line 394, in on_task_received strategies[name](message, body, message.ack_log_error) keyerror: 'my.task'
any suggestions?
i able working refactoring tasks not class methods. placed them in our tasks.py
file , works fine. haven't had time research why case, plan do, until if having same problem you'll have quick fix available.
Comments
Post a Comment