Paulo Henrique
Paulo Henrique

Reputation: 111

Django Channels Worker is returning TypeError: zadd() got an unexpected keyword argument 'daphne

In my server, i am running a Daphne and a Worker for Django Channels.

I have already reboot all containers (I use Docker), cleaned Redis Cache.

Today, these applications stoped to work and return this stack:

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 - is my app in Django

leads-198 - is the group of Channels

Requirements.txt:

boto3

coreapi

Django==1.11

asgi_redis==1.2.1

channels==1.1.8

daphne==1.3

celery==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

Any suggestion ?

Thanks

Upvotes: 1

Views: 1155

Answers (3)

James Lin
James Lin

Reputation: 26538

I seem to be able to get redis >=3 working with channels 1.1.8

(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

Upvotes: 1

Jamshaid iqbal
Jamshaid iqbal

Reputation: 21

If you are using Redis version 3.0 or above, it will not work with channels version 1.1.8, so you have to install redis version 2.10.6.

Upvotes: 2

Paulo Henrique
Paulo Henrique

Reputation: 111

I discover the problem.

Were the versions of libs. Below, there is the new requirements.txt. I update asgi_redis and django-redis

boto3

Django==1.11

asgi_redis==1.4.3

channels==1.1.8

daphne==1.3

celery==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

Upvotes: 1

Related Questions