I have been trying to pull data via web socket from Binance and will occasionally get the return msg: {‘e’: ‘error’, ‘m’: ‘Queue overflow. Message not filled’}. Does anyone know what causes this message?
which websocket server did you connect? did you use any library/sdk?
Connected to trade and orderbook streams using the python-binance library
Same issue here.
I experienced it using the trades socket so I changed it to klines. Now I am using a websocket with the depth and I have the same problem.
Maybe, my laptop is blocked computing my code when the new data came from the socket and the queue is full??
this worked for me:
client = Client(api_key, api_secret)
bsm = BinanceSocketManager(client)
socket = bsm.trade_socket(pair)
#update database everytime we receive a new value from socket
while True:
# Calculate delay from now to the moment of previous request + 1 sec
# btw, it’s Ok to sleep negative delays as well, so we don’t need an if
#delay = last_request_time + 10.0 - time.monotonic()
#await asyncio.sleep(delay) # sleep
#last_request_time = time.monotonic() # write timestamp at the moment of the new request
await socket.__aenter__() # That's bad, use `async with` instead
msg = await socket.recv()
if msg['e'] == 'error':
print('error')
client.close_connection()
# close and restart the socket
bsm = BinanceSocketManager(client)
socket = bsm.trade_socket(pair)
else:
frame = createframe(msg)
frame.to_sql(pair, engine, if_exists="append", index=False)
print(frame)
Do we have a solution for this error message ?
Here are the tests I’ve done:
For 100 different pairs;
- launch websocket for klines_1m, no queue overflow error.
- launch websocket for bookTicker, no queue overflow error.
- launch websocket for both, queue overflow error.
Do you guys have solution for this ?