在我的服务器中,我正在运行Daphne和Django Channels的Worker。
我已经重新启动了所有容器(我使用Docker),并清理了Redis缓存。
今天,这些应用程序停止工作并返回此堆栈:
KeyError: 'leads-198'
2019-03-27 13:51:59,719 - ERROR - worker - Error processing message with consumer crm.consumers.ws_connect:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/channels/worker.py", line 119, in run
consumer(message, **kwargs)
File "/usr/local/lib/python3.6/site-packages/channels/sessions.py", line 78, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/channels/auth.py", line 42, in inner
return func(message, *args, **kwargs)
File "/opt/app/integrador/crm/consumers.py", line 10, in ws_connect
Group(group).add(message.reply_channel)
File "/usr/local/lib/python3.6/site-packages/channels/channel.py", line 70, in add
self.channel_layer.group_add(self.name, channel)
File "/usr/local/lib/python3.6/site-packages/asgi_redis/core.py", line 291, in group_add
**{channel: time.time()}
TypeError: zadd() got an unexpected keyword argument 'daphne.response.lGekRGuTPv!bsgpJbNJLP'
crm-是我在Django中的应用
leads-198-是渠道组
Requirements.txt:
boto3
coreapi
Django == 1.11
asgi_redis == 1.2.1
channels == 1.1.8
daphne == 1.3
芹菜== 4.1
PyMySQL
djangorestframework == 3.7.7
django-oauth-toolkit == 0.12.0
django-cors-headers == 2.1.0
django-redis == 4.5.0
django-storages == 1.5.1
raven == 5.30.0
jsonfield == 1.0.3
requests == 2.18.4
simplejson
suds-py3 == 1.3.2.0
xmltodict == 0.10.2
有什么建议吗?
谢谢
答案 0 :(得分:1)
我似乎能够在通道1.1.8上使用redis> = 3
(project) Jamess-MacBook-Pro-2:project jlin$ pip freeze | grep redis
asgi-redis==1.4.3
django-redis==4.8.0
redis==3.5.3
(project) Jamess-MacBook-Pro-2:project jlin$ pip freeze | grep channel
channels==1.1.8
(project) Jamess-MacBook-Pro-2:project jlin$ pip freeze | grep kombu
kombu==4.2.2.post1
答案 1 :(得分:0)
我发现了问题。
是库的版本。下面是新的requirements.txt。我更新asgi_redis和django-redis
boto3
Django == 1.11
asgi_redis == 1.4.3
channels == 1.1.8
daphne == 1.3
芹菜== 4.1
PyMySQL
djangorestframework == 3.7.7
django-oauth-toolkit == 0.12.0
django-cors-headers == 2.1.0
django-redis == 4.10.0
django-storages == 1.5.1
raven == 5.30.0
jsonfield == 1.0.3
requests == 2.18.4
simplejson
suds-py3 == 1.3.2.0
xmltodict == 0.10.2
答案 2 :(得分:0)
如果您使用的是Redis 3.0版或更高版本,它将无法与1.1.8版的通道一起使用,因此您必须安装Redis 2.10.6版。