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.

TypeError while disconnecting socket connections

See original GitHub issue

Uvicorn sometimes throws this error when client tries to disconnect. This doesn’t seem to happen when daphne is used.

Task exception was never retrieved
future: <Task finished coro=<websocket_session() done, defined at /home/chillar/.virtualenvs/mesh/lib/python3.6/site-packages/uvicorn/protocols/websocket.py:31> exception=TypeError("'<=' not supported between instances of 'int' and 'NoneType'",)>
Traceback (most recent call last):
  File "/home/chillar/.virtualenvs/mesh/lib/python3.6/site-packages/uvicorn/protocols/websocket.py", line 40, in websocket_session
    data = await protocol.recv()
  File "/home/chillar/.virtualenvs/avilpage.com/lib/python3.6/site-packages/websockets/protocol.py", line 323, in recv
    raise ConnectionClosed(self.close_code, self.close_reason)
  File "/home/chillar/.virtualenvs/avilpage.com/lib/python3.6/site-packages/websockets/exceptions.py", line 147, in __init__
    if 3000 <= code < 4000:
TypeError: '<=' not supported between instances of 'int' and 'NoneType'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jordaneremieffcommented, May 22, 2018

An update on this, a new version of websockets has just been released that should include the fix for the issue I linked - though I have not been able to confirm if that was also the cause of the original issue here.

@ChillarAnand could you try testing against the new version of websockets (5.0)?

1reaction
jordaneremieffcommented, May 8, 2018

Daphne uses autobahn.twisted.websocket.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Socket.io - TypeError: socket.in is not a function
socket.in or socket.to not working in client and you should use it in server side. Socket.io Documentation. for example : io.on('connection' ...
Read more >
Type error on error closing connection · Issue #1591
This can only happen if the 'error' event is emitted after the 'close' event on the net.Socket but it would be a bug...
Read more >
Server Initialization
Once you have installed the Socket.IO server library, you can now init the server. The complete list of options can be found below....
Read more >
Socket.io - User establishes two connections and not sure ...
But then I get the following error: Uncaught TypeError: Error resolving module specifier “socket.io-client”. Relative module specifiers must start with “./”, “…
Read more >
Errors | Node.js v19.3.0 Documentation
ECONNRESET (Connection reset by peer): A connection was forcibly closed by a peer. This normally results from a loss of the connection on...
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