美文网首页
celery 报错 在启动worker的时候 Attribute

celery 报错 在启动worker的时候 Attribute

作者: Jayce_xi | 来源:发表于2019-07-22 18:28 被阅读0次

    1. 错误描述

    celeryworker_1  | [2018-11-20 13:30:07,838: WARNING/MainProcess] celery@cd4e42f8b190 ready.
    celeryworker_1  | [2018-11-20 13:30:07,927: ERROR/MainProcess] Unrecoverable error: AttributeError("'str' object has no attribute 'items'",)
    celeryworker_1  | Traceback (most recent call last):
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/worker/__init__.py", line 206, in start
    celeryworker_1  |     self.blueprint.start(self)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/bootsteps.py", line 123, in start
    celeryworker_1  |     step.start(parent)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/bootsteps.py", line 374, in start
    celeryworker_1  |     return self.obj.start()
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/worker/consumer.py", line 280, in start
    celeryworker_1  |     blueprint.start(self)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/bootsteps.py", line 123, in start
    celeryworker_1  |     step.start(parent)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/worker/consumer.py", line 884, in start
    celeryworker_1  |     c.loop(*c.loop_args())
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/celery/worker/loops.py", line 76, in asynloop
    celeryworker_1  |     next(loop)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/kombu/async/hub.py", line 340, in create_loop
    celeryworker_1  |     cb(*cbargs)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/kombu/transport/redis.py", line 1019, in on_readable
    celeryworker_1  |     self._callbacks[queue](message)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/kombu/transport/virtual/__init__.py", line 534, in _callback
    celeryworker_1  |     self.qos.append(message, message.delivery_tag)
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/kombu/transport/redis.py", line 146, in append
    celeryworker_1  |     pipe.zadd(self.unacked_index_key, delivery_tag, time()) \
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/redis/client.py", line 2263, in zadd
    celeryworker_1  |     for pair in iteritems(mapping):
    celeryworker_1  |   File "/usr/local/lib/python3.6/site-packages/redis/_compat.py", line 123, in iteritems
    celeryworker_1  |     return iter(x.items())
    celeryworker_1  | AttributeError: 'str' object has no attribute 'items'
    

    2. 原因

    redis 版本原因,详情见
    github/issues/1868

    3. 解决

    pip install redis==2.10.6
    

    相关文章

      网友评论

          本文标题:celery 报错 在启动worker的时候 Attribute

          本文链接:https://www.haomeiwen.com/subject/lofglctx.html