Cant have a stable connection to fyers API

Piyush Kapse Tejas Khoday 

I am unable to have a stable websocket connection for the past 2 days, which gets disconnected between 10:50 - 11:20 AM or roughly after an hour I start my socket connection. Below I have attached the Error log.

 

Appreciate an immediate resolution. 

Task exception was never retrieved
future: <Task finished name='Task-5' coro=<FyersSocket.ping1() done, defined at /home/red/.local/lib/python3.9/site-packages/fyers_api/websocket/ws.py:237> exception=ConnectionClosedError('code = 1006 (connection closed abnormally [internal]), no reason')>
Traceback (most recent call last):
  File "/home/red/.local/lib/python3.9/site-packages/websockets/protocol.py", line 827, in transfer_data
    message = await self.read_message()
  File "/home/red/.local/lib/python3.9/site-packages/websockets/protocol.py", line 895, in read_message
    frame = await self.read_data_frame(max_size=self.max_size)
  File "/home/red/.local/lib/python3.9/site-packages/websockets/protocol.py", line 971, in read_data_frame
    frame = await self.read_frame(max_size)
  File "/home/red/.local/lib/python3.9/site-packages/websockets/protocol.py", line 1047, in read_frame
    frame = await Frame.read(
  File "/home/red/.local/lib/python3.9/site-packages/websockets/framing.py", line 105, in read
    data = await reader(2)
  File "/usr/lib/python3.9/asyncio/streams.py", line 723, in readexactly
    await self._wait_for_data('readexactly')
  File "/usr/lib/python3.9/asyncio/streams.py", line 517, in _wait_for_data
    await self._waiter
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/home/red/.local/lib/python3.9/site-packages/fyers_api/websocket/ws.py", line 239, in ping1
    await websocket.send(json.dumps("ping"))
  File "/home/red/.local/lib/python3.9/site-packages/websockets/protocol.py", line 555, in send
    await self.ensure_open()
  File "/home/red/.local/lib/python3.9/site-packages/websockets/protocol.py", line 812, in ensure_open
    raise self.connection_closed_exc()
websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason
4 replies