Open chentonny opened 1 month ago
你是用源码部署还是docker呢,请把启动celery后的控制台日志给我看一下呢
您好!我用源码部署,日志如下:
Sept. 22, 2024, 1:16 p.m. | check_wechat_status | 成功 | null | {"status": "error", "message": "\u672a\u8fde\u63a5\u5230\u670d\u52a1\u5668"} Sept. 22, 2024, 1:16 p.m. | check_celery_running | 成功 | null | {"status": "Failed to check Celery status", "error": "[WinError 2] \u7cfb\u7edf\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u6587\u4ef6\u3002"} Sept. 22, 2024, 1:16 p.m. | ping_server | 成功 | null | {"status": "success", "message": "\u5df2\u8fde\u63a5\u5230\u670d\u52a1\u5668"} Sept. 22, 2024, 1:16 p.m. | get_server_ip | 成功 | null | {"server_ip": "192.168.100.200:8000"} Sept. 22, 2024, 1:16 p.m. | check_email_settings | 失败 | null | [WinError 2] 系统找不到指定的文件。 Sept. 22, 2024, 1:16 p.m. | home | 成功 | null
你用源码部署,点启动celery后,终端会有celery启动消息显示的,你看看那个
[22/Sep/2024 13:16:16] "GET /favicon.ico HTTP/1.1" 404 9787 [22/Sep/2024 13:16:21] "POST / HTTP/1.1" 302 0 [22/Sep/2024 13:16:21] "GET /home/ HTTP/1.1" 200 23386 Internal Server Error: /check-email-settings/ [22/Sep/2024 13:16:21] "GET /check-email-settings/ HTTP/1.1" 500 113 [22/Sep/2024 13:16:21] "GET /get_server_ip/ HTTP/1.1" 200 37 [22/Sep/2024 13:16:22] "POST /ping_server/ HTTP/1.1" 200 78 Internal Server Error: /check_celery_running/ [22/Sep/2024 13:16:22] "GET /check_celery_running/ HTTP/1.1" 500 135 [22/Sep/2024 13:16:22] "GET /check_errors/ HTTP/1.1" 200 13 [22/Sep/2024 13:16:22] "GET /log_counts/ HTTP/1.1" 200 45 [22/Sep/2024 13:16:25] "POST /check_wechat_status/ HTTP/1.1" 200 76 [22/Sep/2024 13:16:28] "GET /logs/ HTTP/1.1" 200 42698 [22/Sep/2024 13:31:34] "GET /home/ HTTP/1.1" 200 23386 Internal Server Error: /check-email-settings/ [22/Sep/2024 13:31:35] "GET /check-email-settings/ HTTP/1.1" 500 113 [22/Sep/2024 13:31:35] "GET /get_server_ip/ HTTP/1.1" 200 37 [22/Sep/2024 13:31:35] "POST /ping_server/ HTTP/1.1" 200 78 Internal Server Error: /check_celery_running/ [22/Sep/2024 13:31:36] "GET /check_celery_running/ HTTP/1.1" 500 135 [22/Sep/2024 13:31:36] "GET /check_errors/ HTTP/1.1" 200 13 [22/Sep/2024 13:31:36] "GET /log_counts/ HTTP/1.1" 200 45 [22/Sep/2024 13:31:36] "POST /check_wechat_status/ HTTP/1.1" 200 70 Bad Request: /send-email/ [22/Sep/2024 13:33:14] "POST /send-email/ HTTP/1.1" 400 68
点击启动celery后,终端应该会有celery启动的信息,类似这样
[22/Sep/2024 13:57:17] "POST /start_celery/ HTTP/1.1" 200 28 celery beat v5.4.0 (opalescent) is starting. Internal Server Error: /check_celery_running/ [22/Sep/2024 13:57:18] "GET /check_celeryrunning/ HTTP/1.1" 500 135 - ... - LocalTime -> 2024-09-22 13:57:19 Configuration -> . broker -> redis://localhost:6379/0 . loader -> celery.loaders.app.AppLoader . scheduler -> celery.beat.PersistentScheduler . db -> celerybeat-schedule . logfile -> [stderr]@%INFO . maxinterval -> 5.00 minutes (300s) [2024-09-22 13:57:19,732: INFO/MainProcess] beat: Starting...
-------------- celery@DESKTOP-NKMNF7I v5.4.0 (opalescent) --- * ----- -- *** ---- Windows-10-10.0.19045-SP0 2024-09-22 13:57:19
[tasks] . client_app.tasks.check_and_log_scheduled_message_errors . client_app.tasks.check_and_send_messages . client_app.tasks.check_wechat_status . client_app.tasks.message_check . client_app.tasks.ping_server . client_app.tasks.send_unsent_error_emails
[2024-09-22 13:57:19,979: WARNING/MainProcess] C:\Program Files\Python312\Lib\site-packages\celery\worker\consumer\consumer.py:508: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine whether broker connection retries are made during startup in Celery 6.0 and above. If you wish to retain the existing behavior for retrying connections on startup, you should set broker_connection_retry_on_startup to True. warnings.warn(
[2024-09-22 13:57:20,725: INFO/SpawnPoolWorker-4] child process 12592 calling self.run() [2024-09-22 13:57:20,739: INFO/SpawnPoolWorker-3] child process 10932 calling self.run() [2024-09-22 13:57:20,776: INFO/SpawnPoolWorker-1] child process 4132 calling self.run() [2024-09-22 13:57:20,882: INFO/SpawnPoolWorker-2] child process 9816 calling self.run() [2024-09-22 13:57:22,010: INFO/MainProcess] Connected to redis://localhost:6379/0 [2024-09-22 13:57:22,016: WARNING/MainProcess] C:\Program Files\Python312\Lib\site-packages\celery\worker\consumer\consumer.py:508: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine whether broker connection retries are made during startup in Celery 6.0 and above. If you wish to retain the existing behavior for retrying connections on startup, you should set broker_connection_retry_on_startup to True. warnings.warn(
[2024-09-22 13:57:22,056: INFO/MainProcess] Scheduler: Sending due task ping-server-every-minute (client_app.tasks.ping_server)
[2024-09-22 13:57:24,068: INFO/MainProcess] mingle: searching for neighbors
[2024-09-22 13:57:26,297: INFO/MainProcess] Scheduler: Sending due task message-check-every-minute (client_app.tasks.message_check)
[2024-09-22 13:57:26,300: INFO/MainProcess] Scheduler: Sending due task check-scheduled-message-errors-every-minutes (client_app.tasks.check_and_log_scheduled_message_errors)
[2024-09-22 13:57:26,302: INFO/MainProcess] Scheduler: Sending due task send-unsent-error-emails-every-minutes (client_app.tasks.send_unsent_error_emails)
[2024-09-22 13:57:26,304: INFO/MainProcess] Scheduler: Sending due task check-wechat-status-every-5minute (client_app.tasks.check_wechat_status)
[2024-09-22 13:57:26,307: INFO/MainProcess] Scheduler: Sending due task send-messages-every-minute (client_app.tasks.check_and_send_messages)
[2024-09-22 13:57:31,294: INFO/MainProcess] mingle: all alone
[2024-09-22 13:57:41,554: INFO/MainProcess] celery@DESKTOP-NKMNF7I ready.
[2024-09-22 13:57:41,563: INFO/MainProcess] Task client_app.tasks.ping_server[9349a93f-a44a-445b-86f7-29c940cb35b0] received
[2024-09-22 13:57:41,569: INFO/MainProcess] Task client_app.tasks.message_check[2df970d5-789d-442c-89b1-818525e36b87] received
[2024-09-22 13:57:41,579: INFO/MainProcess] Task client_app.tasks.check_and_log_scheduled_message_errors[87471fc8-9b94-4ff7-b19c-42ea3b580084] received[2024-09-22 13:57:41,588: INFO/MainProcess] Task client_app.tasks.send_unsent_error_emails[75fade53-ffce-4fcb-874e-9df545fa2282] received
[2024-09-22 13:57:41,592: INFO/MainProcess] Task client_app.tasks.check_wechat_status[63ed5370-e597-4207-85be-46267c6c02c2] received
[2024-09-22 13:57:41,599: INFO/MainProcess] Task client_app.tasks.check_and_send_messages[686a8a5a-f4b4-4b42-9429-42fb8b496323] received
[2024-09-22 13:57:43,663: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop
result = (True, prepare_result(fun(*args, **kwargs)))
^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:57:43,677: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:57:43,684: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:57:43,690: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:57:43,696: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:57:43,707: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:58:00,000: INFO/MainProcess] Scheduler: Sending due task check-scheduled-message-errors-every-minutes (client_app.tasks.check_and_log_scheduled_message_errors) [2024-09-22 13:58:00,002: INFO/MainProcess] Scheduler: Sending due task message-check-every-minute (client_app.tasks.message_check) [2024-09-22 13:58:00,003: INFO/MainProcess] Task client_app.tasks.check_and_log_scheduled_message_errors[991be682-703b-4093-a350-3ab54945c173] received[2024-09-22 13:58:00,004: INFO/MainProcess] Scheduler: Sending due task send-unsent-error-emails-every-minutes (client_app.tasks.send_unsent_error_emails) [2024-09-22 13:58:00,004: INFO/MainProcess] Task client_app.tasks.message_check[77a70af2-872d-4a2a-9fa8-fd3221bcb0d0] received [2024-09-22 13:58:00,009: INFO/MainProcess] Scheduler: Sending due task send-messages-every-minute (client_app.tasks.check_and_send_messages) [2024-09-22 13:58:00,006: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:58:00,018: INFO/MainProcess] Task client_app.tasks.send_unsent_error_emails[acbb4e22-3109-430f-b7d1-05c0f591ab18] received [2024-09-22 13:58:00,050: INFO/MainProcess] Task client_app.tasks.check_and_send_messages[45a3b99e-ff6d-46c1-855a-0cebdc2908f9] received [2024-09-22 13:58:00,051: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:58:00,059: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:58:00,065: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, *kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) [2024-09-22 13:58:00,027: INFO/MainProcess] Scheduler: Sending due task ping-server-every-minute (client_app.tasks.ping_server) [2024-09-22 13:58:00,105: INFO/MainProcess] Task client_app.tasks.ping_server[7be6492f-cbee-4110-b180-daa7422c2187] received [2024-09-22 13:58:00,109: 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:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0)
看起来celery成功启动了,但是任务执行的时候出错
你先设置一个定时发送消息任务试试能不能跑?
文件传输助手
hi
* * * * *
这个任务每分钟都会执行一次
我已经设置了一个定时发送消息的任务,但下次执行时间那里是celery未执行,点提前发送是可以成功的。
是不是因为我没有设置邮箱,celery启动失败?
所以设置 *实际上也不能自动发送是吗?
邮箱这个也有可能,你可以设置一下邮箱,内容随便填不要空就行
设置 *实际上也不能自动发送。
我设置一下邮箱再试试
设置了邮箱后,点击“启动celery定时任务", 结果也是”celery未执行"
了解了,我感觉是环境的问题,你可以试试win开wsl2,用docker部署,这样免去奇奇怪怪的问题
Windows源码部署我还没试过,我自己实际上使用macOS源码开发,然后在ubuntu服务器上用docker部署,有空我测试一下Windows源码部署
不是上面这些问题,是“subprocess.Popen(['celery', '-A', 'YuYuWechatV2_Client', 'worker', '--loglevel=info'])”这个启动的时候异常了,可以看Client控制台输出信息
不是上面这些问题,是“subprocess.Popen(['celery', '-A', 'YuYuWechatV2_Client', 'worker', '--loglevel=info'])”这个启动的时候异常了,可以看Client控制台输出信息
任务管理器只能看到一个celery进程而已,实际上按程序应该是2个才是
不是上面这些问题,是“subprocess.Popen(['celery', '-A', 'YuYuWechatV2_Client', 'worker', '--loglevel=info'])”这个启动的时候异常了,可以看Client控制台输出信息
你也遇到这个问题了吗,也有可能是subprocess.Popen的问题,有可能是win的subprocess.Popen实现方法跟类unix实现方法不一样,有点怪
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, 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:
Traceback (most recent call last): File "C:\Program Files\Python312\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\Python312\Lib\site-packages\celery\app\trace.py", line 640, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) 控制台每分钟都会跳出这个报错
不是上面这些问题,是“subprocess.Popen(['celery', '-A', 'YuYuWechatV2_Client', 'worker', '--loglevel=info'])”这个启动的时候异常了,可以看Client控制台输出信息
你也遇到这个问题了吗,也有可能是subprocess.Popen的问题,有可能是win的subprocess.Popen实现方法跟类unix实现方法不一样,有点怪
我的也是这个问题,把里面的命令直接放cmd里面运行是可以的,不过网上说要补充一个变量 “-P eventlet”
celery -A YuYuWechatV2_Client worker -P eventlet --loglevel=info
但是补充到程序里面是不识别到“ -P eventlet”这个参数。我也是无力了,建议博主更换个定时器吧!起码按目前看是不太兼容部分同志们的电脑
目前我建议使用docker部署,docker镜像经过多次自动化测试,并且我也使用docker部署在生产环境,可以保证可靠性
-P eventlet
是只用一个线程执行任务,考虑到win的多线程实现跟类unix不同,这样确实可以解决很多问题
这样看,似乎问题出在celery,我需要更多时间来调试Windows的环境问题,并且修改多线程的实现有可能引入破坏性修改,反而导致类unix系统运行出问题,考虑到win也可以跑docker,我可能不会积极适配win运行源码
所以这个问题先搁置,如果有更多想法或者错误日志,欢迎继续提出讨论
感谢上面的大佬!
好的,非常感谢
-P eventlet
是只用一个线程执行任务,考虑到win的多线程实现跟类unix不同,这样确实可以解决很多问题这样看,似乎问题出在celery,我需要更多时间来调试Windows的环境问题,所以这个问题先搁置,如果有更多想法或者错误日志,欢迎继续提出讨论
目前我建议使用docker部署,docker镜像经过多次自动化测试,并且我也使用docker部署在生产环境,可以保证可靠性
服务端启动后请求http://127.0.0.1:8000/wechat/ping/ 返回: { "status": "pong" }, 服务端是使用exe文件启动。
然后客户端首页显示 微信不在线。 客户端是使用docker启动。 请教一下如何绑定微信。
服务端启动后请求http://127.0.0.1:8000/wechat/ping/ 返回: { "status": "pong" }, 服务端是使用exe文件启动。
然后客户端首页显示 微信不在线。 客户端是使用docker启动。 请教一下如何绑定微信。
你好,你要讨论的问题跟本issues不相关,请你再开一个新issues
提出issues前请先确保你看完了README
描述Bug
在(http://127.0.0.1:7500/home/)上启动celery定时任务时提示:celery未运行
重现步骤
启动了前后端,打开了postgres和redis,打开登录页面,配置服务器和微信都没问题。消息提前发送,也可以立即执行。但启动启动celery定时任务时提示:celery未运行
截图
环境 (请完成以下信息):