Celery提交任务出错?
跟着官方的入门教程部署和运行的,为啥报这个错?
tasks.py
# -*- encoding:UTF-8 -*-
from celery import Celery
brokers = 'redis://localhost:6379'
backend = 'redis://localhost:6379'
app = Celery('tasks', broker=brokers, backend=backend)
app.control.purge()
@app.task
def add(x, y):
return x + y
>>> from tasks import add
>>> add.delay(6,6)
<AsyncResult: e1b8521e-e8a1-4431-8232-b0cbe7a35e9e>
[2017-08-08 19:14:32,580: ERROR/MainProcess] Task handler raised error: ValueErr
or('not enough values to unpack (expected 3, got 0)',)
Traceback (most recent call last):
File "c:\python352\lib\site-packages\billiard\pool.py", line 358, in workloop
result = (True, prepare_result(fun(*args, **kwargs)))
File "c:\python352\lib\site-packages\celery\app\trace.py", line 525, in _fast_
trace_task
tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)
[2017-08-08 19:15:46,049: ERROR/MainProcess] Task handler raised error: ValueErr
or('not enough values to unpack (expected 3, got 0)',)
Traceback (most recent call last):
File "c:\python352\lib\site-packages\billiard\pool.py", line 358, in workloop
result = (True, prepare_result(fun(*args, **kwargs)))
File "c:\python352\lib\site-packages\celery\app\trace.py", line 525, in _fast_
trace_task
tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
celery可能需要个低版本,换下4.1.0为3.1.24试下。
https://github.com/celery/cel...
celery -A your_app_name worker --pool=solo -l info 换这个试试
http://blog.csdn.net/qq_30242... 这一个完美解决
我也出现这个错误了 ,楼主是怎么解决的 真是版本问题么