websockets.exceptions.ConnectionClosedError: no close frame received or sent
Suddenly got the below error:
Traceback (most recent call last):
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 959, in transfer_data
message = await self.read_message()
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 1029, in read_message
frame = await self.read_data_frame(max_size=self.max_size)
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 1104, in read_data_frame
frame = await self.read_frame(max_size)
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 1161, in read_frame
frame = await Frame.read(
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/framing.py", line 68, in read
data = await reader(2)
File "/usr/lib/python3.10/asyncio/streams.py", line 706, 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 "/home/nahid/test/tiktok-events/one/test.py", line 47, in <module>
client.run()
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/TikTokLive/client/client.py", line 200, in run
return self._asyncio_loop.run_until_complete(self.connect(**kwargs))
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/TikTokLive/client/client.py", line 185, in connect
await task
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/TikTokLive/client/client.py", line 233, in _client_loop
async for event in self._ws_loop(initial_response):
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/TikTokLive/client/client.py", line 257, in _ws_loop
async for response_message in self._ws.connect(*self._build_connect_info(initial_response)):
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/TikTokLive/client/ws/ws_client.py", line 158, in connect
async for webcast_message in self.connect_loop(uri, headers):
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/TikTokLive/client/ws/ws_client.py", line 194, in connect_loop
async for message in websocket:
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 497, in __aiter__
yield await self.recv()
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 568, in recv
await self.ensure_open()
File "/home/nahid/test/tiktok-events/one/tik-venv/lib/python3.10/site-packages/websockets/legacy/protocol.py", line 935, in ensure_open
raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: no close frame received or sent
and application got crashed ! and stopped.
I have attached a log file for your information. Could you please inspect the log file and why suddenly , I faced this issue ' Future exception was never retrieved '
skintific_id_2024-07-02 16:48:55.396542.log
Thanks
skintific_id_2024-07-02 17:05:02.712199.log
@isaackogan , Morning Buddy. I have attached a log file, here you see A long time data was captured ! But , after a while , same issue generates again & again!
Could you please be more definite ? Why this issue occurs or Won't we get rid of this ghost like error from websocket!
The same
This should be fixed in more recent versions @aCS6 @antimagetiny.
Please re-open if the issue persists.