Closed Flowelfox closed 3 years ago
Was it the only one stream you created, or did you have more then one stream and only this one stream restarted in this bad manner with to much delay?
In version 1.16.5 I added a restart to this error, but the result was to much restarts - it didnt work as expected. I will add more infos to the logging in https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/unicorn_binance_websocket_api/unicorn_binance_websocket_api_connection.py#L95 please update this in your fork too and post me the new logs for further investigations.
Please add this commit to your fork and post new logs: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/commit/08c4048138c79a8f764fcc148a12964f3ece967e
I added a few more changes to logging in connection.py to find the exact reason of the bug.
So what version or commit i should install? I can install library from specific commit or tag through pip.
I also get the exact same error on self.__socket.create_stream( 'arr', '!userData' )
But only after I updated to 1.16.7
Why don't you keep old versions up??? 1.16.6 worked like charm!
This is what I get:
03:25:02 - root - BinanceWebSocketApiConnection->__enter__(70176ca8-6c49-4c17-8e87-9aa642c8e9ad, ['arr'], ['!userData']) connecting to wss://stream.binance.com:9443/ws/ZyRsMI5mqUG38sDdEypkoZb5cXerXCYSrohZ0bMnH9SvRhRzrGoFtZHa0qwR error: 2 - string indices must be integers (unicorn_binance_websocket_api_connection.py:100) 03:25:02 - root - BinanceWebSocketApiConnection->__enter__(e56b9141-7a01-460f-88cb-67212370a5ec, ['arr'], ['!userData']) connecting to wss://fstream.binance.com/ws/R4s886NitWtJZ0yH9dMs6beKAfAFj6G0QMR0jONtOOmwGcDrAtX33beumyXvZft5 error: 2 - string indices must be integers (unicorn_binance_websocket_api_connection.py:100) 03:25:03 - root - BinanceWebSocketApiConnection->__enter__(68f738ed-47ea-4680-99ca-459cd75c2eec, ['arr'], ['!userData']) connecting to wss://fstream.binance.com/ws/tfwg91K7ImbgrFyfALV2meYHxsYdrHeVWycKn7d26gDqsWk0wZu5nx0UFjDwBa06 error: 2 - string indices must be integers (unicorn_binance_websocket_api_connection.py:100)
I had to comment out the lines 73-102 in unicorn_binance_websocket_api_connection.py to get this work again.
Damn it!! Please leave old versions up next time!
Please reset your API key! I dont know the permisions of your API key, but with the listen_key postet here, everybody can use your api key.
Do you only get error logs, or does the userdata stream not function anymore too?
Are other stream types (kline, trades, ...) also affected?
Damn it!! Please leave old versions up next time!
Yes, thats maybe better :D
Hm the test is running very well: https://ubwa-demo.lucit.co/print_summary.php
Error 2 is just a log but doing nothing then! no restart or anything else.
In row 73 the programm trys to access uri
as a dict, but its only a dict, if an error happend before. Regular it should be a string.
I am looking to find a bug and need more verbose information for finding it and thats what I did with 1.16.7 - adding more logging. Behavior of the lib should still be the same...
Its working without any issues after I commented out those lines. As you said, he expects a dict() type, but URI was just string in my case.
Thank you for reminding me about API keys.
If you get a valid URI, than its allways string!
But if the URI is not valid its not a string anymore, its a dict containing error code and error msg.
I would not remove the hole block! With it you removed error handling for invalid URIs.
What I wanted to know from you: You get an "error 2" - but thats only text! Everything is working as expected, isnt it? Stream is streaming ...
I have read all the code now and error2 is actualy an error that happens when no error happens, because then uri is just a string with the uri. its just logged as error, but is actualy a good thing :D
I set it to debug level.
Flowelcat: The reason for the disconnect in your logs is "Info: code = 1006 (connection closed abnormally [internal]), no reason" https://websockets.readthedocs.io/en/stable/faq.html#what-does-connectionclosederror-code-1006-mean
error2 still exists? My version 1.16.4dev and version 1.16.7 constantly flooding logs with "2 - string indices must be integers" and no reason disconnect. Local version: 1.16.7. Version on VPS: 1.16.4dev from my fork. Logs look exactly the same. Local logs:
2020-09-02 15:18:16,921 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 15:18:17,090 - root - INFO - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt'])
2020-09-02 15:18:17,092 - root - INFO - Created websocket URI for stream_id=833485cd-e79c-4e54-92da-1eb629539e0d is wss://fstream.binance.com/stream?streams=xmrusdt@kline_6h
2020-09-02 15:18:17,092 - root - ERROR - BinanceWebSocketApiConnection->__enter__(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt']) connecting to wss://fstream.binance.com/stream?streams=xmrusdt@kline_6h error: 2 - string indices must be integers
2020-09-02 15:18:17,711 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 3m
2020-09-02 15:18:18,148 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 15:18:19,096 - root - INFO - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt'])
2020-09-02 15:18:19,098 - root - INFO - Created websocket URI for stream_id=833485cd-e79c-4e54-92da-1eb629539e0d is wss://fstream.binance.com/stream?streams=bchusdt@kline_6h
2020-09-02 15:18:19,099 - root - ERROR - BinanceWebSocketApiConnection->__enter__(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt']) connecting to wss://fstream.binance.com/stream?streams=bchusdt@kline_6h error: 2 - string indices must be integers
2020-09-02 15:18:19,756 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 5m
2020-09-02 15:18:20,635 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 15:18:21,100 - root - INFO - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt'])
2020-09-02 15:18:21,102 - root - INFO - Created websocket URI for stream_id=833485cd-e79c-4e54-92da-1eb629539e0d is wss://fstream.binance.com/stream?streams=xmrusdt@kline_6h
2020-09-02 15:18:21,103 - root - ERROR - BinanceWebSocketApiConnection->__enter__(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt']) connecting to wss://fstream.binance.com/stream?streams=xmrusdt@kline_6h error: 2 - string indices must be integers
2020-09-02 15:18:21,854 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 15m
2020-09-02 15:18:23,391 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 30m
2020-09-02 15:18:23,519 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 15:18:24,105 - root - INFO - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt'])
2020-09-02 15:18:24,107 - root - INFO - Created websocket URI for stream_id=833485cd-e79c-4e54-92da-1eb629539e0d is wss://fstream.binance.com/stream?streams=bchusdt@kline_6h
2020-09-02 15:18:24,107 - root - ERROR - BinanceWebSocketApiConnection->__enter__(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt']) connecting to wss://fstream.binance.com/stream?streams=bchusdt@kline_6h error: 2 - string indices must be integers
2020-09-02 15:18:24,878 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 1h
2020-09-02 15:18:25,196 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 15:18:26,109 - root - INFO - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt'])
2020-09-02 15:18:26,110 - root - INFO - Created websocket URI for stream_id=833485cd-e79c-4e54-92da-1eb629539e0d is wss://fstream.binance.com/stream?streams=xmrusdt@kline_6h
2020-09-02 15:18:26,111 - root - ERROR - BinanceWebSocketApiConnection->__enter__(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt']) connecting to wss://fstream.binance.com/stream?streams=xmrusdt@kline_6h error: 2 - string indices must be integers
2020-09-02 15:18:26,452 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 2h
2020-09-02 15:18:27,820 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_8h', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'bchusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'xmrusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 15:18:28,111 - root - INFO - BinanceWebSocketApiSocket->start_socket(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt'])
2020-09-02 15:18:28,112 - root - INFO - Created websocket URI for stream_id=833485cd-e79c-4e54-92da-1eb629539e0d is wss://fstream.binance.com/stream?streams=bchusdt@kline_6h
2020-09-02 15:18:28,113 - root - ERROR - BinanceWebSocketApiConnection->__enter__(833485cd-e79c-4e54-92da-1eb629539e0d, ['kline_30m', 'kline_15m', 'kline_12h', 'kline_1m', 'kline_5m', 'kline_1h', 'kline_4h', 'kline_2h', 'kline_8h', 'kline_1d', 'kline_3m', 'kline_6h'], ['iotausdt', 'batusdt', 'qtumusdt', 'adausdt', 'btcusdt', 'zecusdt', 'neousdt', 'ontusdt', 'xrpusdt', 'eosusdt', 'linkusdt', 'atomusdt', 'dashusdt', 'iostusdt', 'xtzusdt', 'ethusdt', 'bnbusdt', 'xmrusdt', 'ltcusdt', 'vetusdt', 'xlmusdt', 'trxusdt', 'etcusdt', 'bchusdt']) connecting to wss://fstream.binance.com/stream?streams=bchusdt@kline_6h error: 2 - string indices must be integers
2020-09-02 15:18:28,163 - inprofit.binance_stream.kline - INFO - Updating missing candles for XMRUSDT 4h
VPS Logs:
2020-09-02 12:24:38,286 - root - INFO - Created websocket URI for stream_id=be876a05-2db6-455d-b1cc-132e0f5bfa38 is wss://fstream.binance.com/stream?streams=zecusdt@kline_8h
2020-09-02 12:24:38,288 - root - ERROR - BinanceWebSocketApiConnection->__enter__(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) connecting to wss://fstream.binance.com/stream?streams=zecusdt@kline_8h error: 2 - string indices must be integers
2020-09-02 12:24:39,592 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 12:24:40,288 - root - INFO - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt'])
2020-09-02 12:24:40,296 - root - INFO - Created websocket URI for stream_id=be876a05-2db6-455d-b1cc-132e0f5bfa38 is wss://fstream.binance.com/stream?streams=zecusdt@kline_8h
2020-09-02 12:24:40,298 - root - ERROR - BinanceWebSocketApiConnection->__enter__(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) connecting to wss://fstream.binance.com/stream?streams=zecusdt@kline_8h error: 2 - string indices must be integers
2020-09-02 12:24:41,582 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 12:24:42,290 - root - INFO - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt'])
2020-09-02 12:24:42,293 - root - INFO - Created websocket URI for stream_id=be876a05-2db6-455d-b1cc-132e0f5bfa38 is wss://fstream.binance.com/stream?streams=zecusdt@kline_8h
2020-09-02 12:24:42,295 - root - ERROR - BinanceWebSocketApiConnection->__enter__(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) connecting to wss://fstream.binance.com/stream?streams=zecusdt@kline_8h error: 2 - string indices must be integers
2020-09-02 12:24:43,690 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 12:24:44,294 - root - INFO - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt'])
2020-09-02 12:24:44,297 - root - INFO - Created websocket URI for stream_id=be876a05-2db6-455d-b1cc-132e0f5bfa38 is wss://fstream.binance.com/stream?streams=zecusdt@kline_8h
2020-09-02 12:24:44,298 - root - ERROR - BinanceWebSocketApiConnection->__enter__(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) connecting to wss://fstream.binance.com/stream?streams=zecusdt@kline_8h error: 2 - string indices must be integers
2020-09-02 12:24:45,606 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 12:24:46,298 - root - INFO - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt'])
2020-09-02 12:24:46,305 - root - INFO - Created websocket URI for stream_id=be876a05-2db6-455d-b1cc-132e0f5bfa38 is wss://fstream.binance.com/stream?streams=zecusdt@kline_8h
2020-09-02 12:24:46,308 - root - ERROR - BinanceWebSocketApiConnection->__enter__(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) connecting to wss://fstream.binance.com/stream?streams=zecusdt@kline_8h error: 2 - string indices must be integers
2020-09-02 12:24:48,418 - root - CRITICAL - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason
2020-09-02 12:24:49,315 - root - INFO - BinanceWebSocketApiSocket->start_socket(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt'])
2020-09-02 12:24:49,318 - root - INFO - Created websocket URI for stream_id=be876a05-2db6-455d-b1cc-132e0f5bfa38 is wss://fstream.binance.com/stream?streams=zecusdt@kline_8h
2020-09-02 12:24:49,319 - root - ERROR - BinanceWebSocketApiConnection->__enter__(be876a05-2db6-455d-b1cc-132e0f5bfa38, ['kline_2h', 'kline_30m', 'kline_6h', 'kline_1m', 'kline_15m', 'kline_12h', 'kline_1h', 'kline_4h', 'kline_1d', 'kline_3m', 'kline_5m', 'kline_8h'], ['iostusdt', 'atomusdt', 'iotausdt', 'dashusdt', 'btcusdt', 'xmrusdt', 'linkusdt', 'xlmusdt', 'ethusdt', 'bnbusdt', 'etcusdt', 'neousdt', 'vetusdt', 'ltcusdt', 'bchusdt', 'xrpusdt', 'eosusdt', 'trxusdt', 'adausdt', 'ontusdt', 'qtumusdt', 'batusdt', 'xtzusdt', 'zecusdt']) connecting to wss://fstream.binance.com/stream?streams=zecusdt@kline_8h error: 2 - string indices must be integers
Kline stream wont start anymore because of this error. Can't run my application normally. @oliver-zehentleitner, Maybe you need more information about this error? Can you reproduce this error?
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
Operating System? (include version)
Python Version Requirement
Exact Python Version?
Pip Version?
Dependencies
Run
pip list > pip_list.txt
and upload the file.UNICORN Binance WebSocket API Version?
Description of your issue
So after running like few hour kline stream crashed with "no reason" comment, after it thread tries to reconnect and crashed with message 2 - string indices must be integers. After few minutes it reconnects and worked normaly.
It won't be an issue if i was not lost a 1 hour kline because of this. Also attaching debug log: