Hi, I'm coming back with this one as well. I managed to fix my problem. In my consumer, I was making normal Django database queries without the @database_sync_to_async decorator.
As soon as I started wrapping my code properly with this decorator, everything started to work fine. See below. class NotificationConsumer (AsyncJsonWebsocketConsumer): async def connect (self): #do stuff async def disconnect (self, code): #do stuff async def user_notification (self, event): #do stuff @database_sync_to_async def get_notification (self, notification_pk): return Notification.objects.filter(pk=notification_pk).first() Hope this helps somebody else! Le vendredi 31 août 2018 15:19:28 UTC-4, itsnate_b a écrit : > > I have the latest Django (2x), channels (2x), and redis/docker as of Aug > 31st, 2018 installed. I am encountering a django channels error and have no > idea why this is happening...has anyone seen this output? What is the > potential cause? Feeling pretty stuck with the error below...happens when > refreshing the site and an attempt is made to connect from js Websocket to > the python/channels backend. > > > 2018-08-31 15:13:04,623 - ERROR - server - Exception inside application: > File "/.../tests/lib/python3.6/site-packages/channels/sessions.py", line > 175, in __call__ > return await self.inner(receive, self.send) > File "/.../tests/lib/python3.6/site-packages/channels/middleware.py", > line 41, in coroutine_call > await inner_instance(receive, send) > File "/.../tests/lib/python3.6/site-packages/channels/consumer.py", line > 54, in __call__ > await await_many_dispatch([receive, self.channel_receive], > self.dispatch) > File "/.../tests/lib/python3.6/site-packages/channels/utils.py", line > 57, in await_many_dispatch > await task > File "/.../tests/lib/python3.6/site-packages/channels_redis/core.py", > line 400, in receive > assert not self.receive_lock.locked() > > [2018/08/31 15:13:04] WebSocket DISCONNECT /ws/dashboard/ [127.0.0.1:56102 > ] > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1214626e-1722-454e-ac67-85b879fef3ab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.