celery icon indicating copy to clipboard operation
celery copied to clipboard

ValueError: not enough values to unpack (expected 3, got 0)

Open renoyuan opened this issue 11 months ago • 8 comments

when i try execute func of firt celery func tast ,error founhd!!!!!!

my system win11 Python 3.11.5 celery==5.3.6 broker redis

celery_app.py

from celery import Celery import time app = Celery('celery_task') app.conf.broker_url = 'redis://192.168.1.139:6380/0' @app.task def hello(): print("hello world ") time.sleep(10) return

test.py

from celery_app import hello task = hello.delay()

print(task)


[2024-03-22 17:44:48,856: ERROR/MainProcess] Task handler raised error: ValueError('not enough values to unpack (expected 3, got 0)') billiard.einfo.RemoteTraceback: """ Traceback (most recent call last): File "C:\Users\renoy\anaconda3\envs\idp_backend\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\renoy\anaconda3\envs\idp_backend\Lib\site-packages\celery\app\trace.py", line 667, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) """

The above exception was the direct cause of the following exception:

renoyuan avatar Mar 22 '24 09:03 renoyuan

I have the same issue as above mentioned Can anyone help me?

Abdulhadu avatar Apr 07 '24 06:04 Abdulhadu

Have you resolved this issue?

shengrihui avatar May 08 '24 02:05 shengrihui

Have you resolved this issue? no, but i try use ubuntu system , It didn't happen.

renoyuan avatar May 08 '24 03:05 renoyuan

Have you resolved this issue? no, but i try use ubuntu system , It didn't happen.

这篇文章里有提到,在Windows需要使用-P eventlet启动。刚才试了一下,可以正常运行。

shengrihui avatar May 08 '24 03:05 shengrihui

666666

renoyuan avatar May 08 '24 08:05 renoyuan

I couldn't get celery to work, so I switched to Dramatiq

flossdaily avatar Jul 18 '24 12:07 flossdaily

Have you resolved this issue? no, but i try use ubuntu system , It didn't happen.

这篇文章里有提到,在Windows需要使用-P eventlet启动。刚才试了一下,可以正常运行。

Eventlet 不是 多进程 的,无法用于 需要大量CPU算力的并行任务。 还是需要用默认的 prefork 或 processes

Bill-XU avatar Sep 02 '24 05:09 Bill-XU

Add code before initializing celery app.

os.environ['FORKED_BY_MULTIPROCESSING'] = '1'

see this blog: https://celery.school/celery-on-windows

Bill-XU avatar Sep 02 '24 05:09 Bill-XU