- [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配置项
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',
)
- Unrecoverable error: AttributeError("‘str’ object has no attribute ‘items’",)
解决方法:pyredis版本过高,降低版本就行
pip3 uninstall redis
pip3 install redis==2.10.6
- Received and deleted unknown message. Wrong destination?!
解决方法:这个可能是你的代码错误,检查一下代码是不是漏了什么