我的celery报错记录

  1. [2020-02-23 09:44:03,487: CRITICAL/MainProcess] Can’t decode message body: ContentDisallowed(‘Refusing to deserialize untrusted content of type pickle (application/x-python-serialize)’,) [type:‘application/x-python-serialize’ encoding:‘binary’ headers:{}]
    解决方法:添加redis配置项
#在你自己建的celery配置文件:celery.py中添加一下内容
from kombu import serialization
serialization.registry._decoders.pop("application/x-python-serialize")

app.conf.update(
    CELERY_ACCEPT_CONTENT = ['application/json']
    CELERY_TASK_SERIALIZER = 'json',
    CELERY_RESULT_SERIALIZER = 'json',
)
  1. Unrecoverable error: AttributeError("‘str’ object has no attribute ‘items’",)
    解决方法:pyredis版本过高,降低版本就行
pip3 uninstall redis
pip3 install redis==2.10.6
  1. Received and deleted unknown message. Wrong destination?!
    解决方法:这个可能是你的代码错误,检查一下代码是不是漏了什么
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值