question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Seeing HTTP/WS send decode error after upgrading to channels 1.1.3

See original GitHub issue

I just upgraded Django channels to 1.1.3 as well as the following related libraries:

channels==1.1.3 daphne==1.2.0 asgi-redis==1.3.0 asgiref==1.1.1

Everything ran fine in my dev environment. But once I pushed to production, installed the new libraries, and completely restarted all services, I immediately started seeing the following error:

ERROR: HTTP/WS send decode error: Cannot dispatch message on channel u'daphne.response.dUTtOgoynk!bNiNpvqevU'

The client was showing the following error:

WebSocket connection to 'wss://<url>.com/' failed: Error during WebSocket handshake: Unexpected response code: 403

When I downgraded to the previous library versions, everything worked fine again.

It appears the issue is during the websocket connect / initial handshake?

I’m using the enforce_ordering decorator on all my websocket consumers as well as the asgi redis back-end.

Any thoughts on what’s going on?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:53 (21 by maintainers)

github_iconTop GitHub Comments

4reactions
boris-saviccommented, May 9, 2017

Hi,

same error - 403 Access Denied, happens every so often. About every 10th request I’d say. Really hard to say what’s wrong.

Here is the Daphne log:

[09/May/2017:08:42:57] "WSCONNECTING /sockets/license/232/" - -
[09/May/2017:08:42:57] "WSREJECT /sockets/license/232/" - -

Installed versions:

Django==1.10.5
daphne==1.2.0
asgi-redis==1.3.0
asgiref==1.1.1
Twisted==17.1.0
channels==1.1.3
2reactions
belongwqzcommented, Apr 24, 2017

Yes, when I remove django-debug-toolbar(and django-debug-toolbar-request-history django-debug-toolbar-template-profiler django-channels-panel), the problem is solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started with Channels — Channels 1.1.8 documentation
When you first run Django with Channels installed, it will be set up in the default layout - where all HTTP requests (on...
Read more >
Channels Documentation - Read the Docs
Channels is a project that takes Django and extends its abilities beyond HTTP - to handle WebSockets, chat protocols,.
Read more >
Websocket immediately disconnects after upgrading Heroku ...
Websocket immediately disconnects after upgrading Heroku Redis version for Django Channels app ; "channels_redis.core.RedisChannelLayer", "CONFIG ...
Read more >
Creating a chat with Django Channels - Gearheart
Nowadays, when every second large company has developed its own instant messenger, in the era of iMessages, Slack, Hipchat, Messager, ...
Read more >
Error during WebSocket handshake: Unexpected response code
log information of runworker (it doesn't update after opening the ... INFO - worker - Listening on channels http.request, websocket.connect, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found