bmoscon / cryptofeed

Cryptocurrency Exchange Websocket Data Feed Handler
Other
2.14k stars 666 forks source link

Binance Authenticated Channel feed fails #1028

Closed Drake1804 closed 2 months ago

Drake1804 commented 2 months ago

Describe the bug When subscribing to Binance Authenticated Channels, specifically POSITIONS and ORDER_INFO, the feed operates correctly for approximately four minutes before encountering an issue and throwing an exception. However, the Funding feed continues to function without any problems.

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
    return await self.__await_impl__()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/client.py", line 651, in __await_impl__
    _transport, _protocol = await self._create_connection()
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1090, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1120, in _create_connection_transport
    await waiter

and the next traceback is thrown at the same time.

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/cryptofeed/connection_handler.py", line 59, in _create_connection
    async with self.conn.connect() as connection:
  File "/usr/local/lib/python3.9/contextlib.py", line 181, in __aenter__
    return await self.gen.__anext__()
  File "/usr/local/lib/python3.9/site-packages/cryptofeed/connection.py", line 104, in connect
    await self._open()
  File "/usr/local/lib/python3.9/site-packages/cryptofeed/connection.py", line 318, in _open
    self.conn = await websockets.connect(self.address, **self.ws_kwargs)
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/client.py", line 647, in __await_impl_timeout__
    return await self.__await_impl__()
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 169, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 252, in _do_exit
    raise asyncio.TimeoutError
bf_public = BinanceFuturesStage(config=self.config,
                              symbols=symbols,
                              channels=[FUNDING],
                              callbacks={FUNDING: self.ticker},
                              log_message_on_error=True,
                              retries=-1)
bf_private = BinanceFuturesStage(config=self.config,
                             symbols=symbols,
                             channels=[POSITIONS, ORDER_INFO],
                             callbacks={POSITIONS: self.positions, ORDER_INFO: self.orders},
                             log_message_on_error=True,
                             retries=-1)

Operating System:

Cryptofeed Version