Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websocket connection closed #16

Open
reza-yb opened this issue Oct 20, 2021 · 0 comments
Open

websocket connection closed #16

reza-yb opened this issue Oct 20, 2021 · 0 comments
Assignees

Comments

@reza-yb
Copy link

reza-yb commented Oct 20, 2021

websocket is not reliable and sometimes when an exception happens it does not restart. traceback of the exception that is happening from time to time is as follows:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 750, in transfer_data
    message = await self.read_message()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 819, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 895, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 971, in read_frame
    frame = await Frame.read(
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/framing.py", line 55, in read
    data = await reader(2)
  File "/usr/local/lib/python3.9/asyncio/streams.py", line 721, in readexactly
    raise exceptions.IncompleteReadError(incomplete, n)
asyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 2 expected bytes

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/kucoin_futures/websocket/websocket.py", line 43, in _run
    _msg = await asyncio.wait_for(self._socket.recv(), timeout=self.get_ws_pingtimeout())
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 481, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 421, in recv
    await self.ensure_open()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/protocol.py", line 726, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/kucoin_futures/websocket/websocket.py", line 56, in _run
    await self._reconnect()
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 654, in sleep
    return await future
asyncio.exceptions.CancelledError

@ISAAC-XXYYZZ ISAAC-XXYYZZ self-assigned this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants