Celery 3.1.6和flower 0.7.3中的未知任务错误

2024-05-14 20:05:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个类似的问题: "Unknown task" error in Celery Flower when posting a new task

不过,我运行的是flower 0.7.3,它已经在上一个版本中提到过修复。当我装载鲜花时,我看到了以下内容:

[D 141025 19:22:44 state:87] Registered: {'celery@myhost': ['crossbar.tasks.add.add',
                             'crossbar.tasks.ping.ping',
                             'crossbar.tasks.send_email.send_email',
                             'crossbar.tasks.send_message.send_message',
                             'crossbar.tasks.send_sms.send_sms']}
[D 141025 19:22:49 events:116] Enabling events
[D 141025 19:22:50 state:153] Resuming inspecting workers...
[I 141025 19:22:50 tasks:99] Invoking a task 'crossbar.tasks.add.add' with '[1, 2]' and '{}'
[W 141025 19:22:50 web:1404] 404 POST /api/task/async-apply/crossbar.tasks.add.add (127.0.0.1): Unknown task 'crossbar.tasks.add.add'
[W 141025 19:22:50 web:1811] 404 POST /api/task/async-apply/crossbar.tasks.add.add (127.0.0.1) 1.11ms

但是正如你所看到的那样,我试着发布如下:

^{pr2}$

以下是我如何经营芹菜: 芹菜-myapp工作者--loglevel=info

我把flower分为两个阶段: flower--conf=src/横杆/flowerconfig.py在

如果我用send task替换async apply,我得到一个200,但是在celery控制台上,我得到以下错误:

[2014-10-26 17:03:06,640: CRITICAL/MainProcess] Can't decode message body: ContentDisallowed('Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)',) [type:'application/x-python-serialize' encoding:'binary' headers:{}]

body: '\x80\x02}q\x01(U\x07expiresq\x02NU\x03utcq\x03\x88U\x04argsq\x04]q\x05(K\x01K\x02eU\x05chordq\x06NU\tcallbacksq\x07NU\x08errbacksq\x08NU\x07tasksetq\tNU\x02idq\nU$f1e8fc87-d0ee-4fc6-86cb-8edded4a4f4cq\x0bU\x07retriesq\x0cK\x00U\x04taskq\rX\x16\x00\x00\x00crossbar.tasks.add.addq\x0eU\ttimelimitq\x0fNN\x86q\x10U\x03etaq\x11NU\x06kwargsq\x12}q\x13u.' (229b)
Traceback (most recent call last):
  File "/Users/psantann/Documents/git/crossbar-taskmgr_trunk/.tox/crossbar-taskmgr/lib/python2.6/site-packages/kombu/messaging.py", line 586, in _receive_callback
    decoded = None if on_m else message.decode()
  File "/Users/psantann/Documents/git/crossbar-taskmgr_trunk/.tox/crossbar-taskmgr/lib/python2.6/site-packages/kombu/message.py", line 142, in decode
    self.content_encoding, accept=self.accept)
  File "/Users/psantann/Documents/git/crossbar-taskmgr_trunk/.tox/crossbar-taskmgr/lib/python2.6/site-packages/kombu/serialization.py", line 174, in loads
    raise self._for_untrusted_content(content_type, 'untrusted')
ContentDisallowed: Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)

好的,如果我将pickle添加到接受的内容列表中,就不会再出现序列化错误了。但是flower仍然不知道我的任务,因此async apply不起作用。我不能让flower-A应用程序为我工作,因为我不是通过芹菜应用程序初始化它,而是使用flowerconfig.py,英寸flowerconfig.py我有CELERY_IMPORTS设置,但实际任务来自不同的python包。什么是正确的方法登记那些有花的?在


Tags: inpysendaddmessagetaskasynctype

热门问题