码迷,mamicode.com
首页 > 其他好文 > 详细

celery接收到任务后出现错误,ValueError: not enough values to unpack (expected 3, got 0)

时间:2020-07-19 00:50:02      阅读:73      评论:0      收藏:0      [点我收藏+]

标签:learn   mic   hand   err   eve   amqp   erro   expected   windows   

(env) D:\python_learn\meiduo_project\meiduo_mall>celery -A celery_tasks.main worker -l info

 -------------- celery@CZZI-BBMGSW v4.4.6 (cliffs)
--- ***** -----
-- ******* ---- Windows-7-6.1.7601-SP1 2020-07-18 23:06:20
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app:         meiduo:0x3676250
- ** ---------- .> transport:   amqp://admin:**@192.168.2.155:5672//
- ** ---------- .> results:     disabled://
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery


[tasks]
  . ccp_send_sms_code

[2020-07-18 23:06:21,241: INFO/MainProcess] Connected to amqp://admin:**@192.168.2.155:5672//
[2020-07-18 23:06:21,257: INFO/MainProcess] mingle: searching for neighbors
[2020-07-18 23:06:21,422: INFO/SpawnPoolWorker-1] child process 14532 calling self.run()
[2020-07-18 23:06:21,422: INFO/SpawnPoolWorker-2] child process 16500 calling self.run()
[2020-07-18 23:06:21,462: INFO/SpawnPoolWorker-3] child process 9492 calling self.run()
[2020-07-18 23:06:21,613: INFO/SpawnPoolWorker-4] child process 7784 calling self.run()
[2020-07-18 23:06:22,318: INFO/MainProcess] mingle: all alone
[2020-07-18 23:06:22,374: INFO/MainProcess] celery@CZZI-BBMGSW ready.
[2020-07-18 23:08:42,415: INFO/MainProcess] Received task: ccp_send_sms_code[9dc4d018-b1fb-45e0-b395-89ba2b952146]
[2020-07-18 23:08:42,448: ERROR/MainProcess] Task handler raised error: ValueError(not enough values to unpack (expected 3, got 0))
Traceback (most recent call last):
  File "d:\python_learn\meiduo_project\env\lib\site-packages\billiard\pool.py", line 362, in workloop
    result = (True, prepare_result(fun(*args, **kwargs)))
  File "d:\python_learn\meiduo_project\env\lib\site-packages\celery\app\trace.py", line 600, in _fast_trace_task
    tasks, accept, hostname = _loc
ValueError: not enough values to unpack (expected 3, got 0)

 

 运行celery4.x版本就会出现这个问题,解决办法是安装一个eventlet

pip install eventlet

再次启动celery执行任务:

celery -A celery_tasks.tasks worker -l info -P eventlet 

问题解决

技术图片

 

celery接收到任务后出现错误,ValueError: not enough values to unpack (expected 3, got 0)

标签:learn   mic   hand   err   eve   amqp   erro   expected   windows   

原文地址:https://www.cnblogs.com/sewen-H/p/13338198.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!