ERROR/ForkPoolWorker- Pool process error: TypeError("Required argument 'object' (pos 1) not found",)

问题描述

celery的worker端报错:

-------------- worker2@zheng-VirtualBox v4.2.0 (windowlicker)

---- **** ----- 
--- * ***  * -- Linux-4.15.0-20-generic-x86_64-with-Ubuntu-18.04-bionic 2018-07-02 10:13:33
-- * - **** --- 
- ** ---------- [config]
- ** ---------- .> app:         proj:0x7f272b7ae910
- ** ---------- .> transport:   amqp://guest:**@localhost:5672//
- ** ---------- .> results:     amqp://
- *** --- * --- .> concurrency: 10 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery
                


[tasks]
  . proj.tasks.add
  . proj.tasks.mul
  . proj.tasks.xsum


[2018-07-02 10:13:33,361: INFO/MainProcess] Connected to amqp://guest:**@localhost:5672//
[2018-07-02 10:13:33,367: INFO/MainProcess] mingle: searching for neighbors
[2018-07-02 10:13:34,377: INFO/MainProcess] mingle: all alone
[2018-07-02 10:13:34,384: INFO/MainProcess] worker2@zheng-VirtualBox ready.
[2018-07-02 10:13:34,384: INFO/MainProcess] Received task: proj.tasks.add[d9d1d458-cdd4-49a3-9d10-0ef690513f8d]  
[2018-07-02 10:13:34,385: ERROR/ForkPoolWorker-2] Pool process error: TypeError("Required argument 'object' (pos 1) not found",)
Traceback (most recent call last):
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 289, in __call__
    sys.exit(self.workloop(pid=pid))
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 347, in workloop
    req = wait_for_job()
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 447, in receive
    ready, req = _receive(1.0)
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 419, in _recv
    return True, loads(get_payload())
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/common.py", line 107, in pickle_loads
    return load(BytesIO(s))
TypeError: Required argument 'object' (pos 1) not found
[2018-07-02 10:13:34,387: ERROR/MainProcess] Process 'ForkPoolWorker-2' pid:765 exited with 'exitcode 1'
[2018-07-02 10:13:34,408: ERROR/ForkPoolWorker-9] Pool process error: TypeError("Required argument 'object' (pos 1) not found",)
Traceback (most recent call last):
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 289, in __call__
    sys.exit(self.workloop(pid=pid))
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 347, in workloop
    req = wait_for_job()
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 447, in receive
    ready, req = _receive(1.0)
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/pool.py", line 419, in _recv
    return True, loads(get_payload())
  File "/home/zheng/.local/lib/python2.7/site-packages/billiard/common.py", line 107, in pickle_loads
    return load(BytesIO(s))

TypeError: Required argument 'object' (pos 1) not found

解决方式

    反思了一下,因为之前按照官网上的说明进行过优化,现在我们禁用一下这个优化——卸载rabbitMQ的C语言优化客户端:

        pip uninstall librabbitmq

为什么上面的方式能解决这个问题?

    不知道

你可能感兴趣的:(分布式消息队列,celery,worker,rabbitMQ)