New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module 'asyncio.base_futures' has no attribute 'InvalidStateError' #83
Comments
I found that in Python 3.8.0 and above InvalidStateError does not exists:
|
Thanks for the good report! I am not shure if the code I added is really good, maybe we have to filter out some other attribute errors... lets test it :) Best regards, |
Hi, updated library and restarted application recently. Version proof:
And
A will monitor logs and candles from stream and notify here if something goes wrong. |
1.16.1 is WRONG! It must be 1.16.1.dev! Try to deinstall all unicorn installations via pip and then run the installation of the dev stage again! |
Ok, changed version to 1.16.1.dev.
|
This fix is included now in 1.16.2 release! |
Can we close this issue? I think its successfully fixed. |
I think yes, no problems so far. Thank you for quick fix) |
Thanks for the good report, I think this fix made the lib stable, I was hunting this problem since a while :D (#45) |
I have same issue. A stream is crashing time after time: ERROR:root:BinanceWebSocketApiSocket->start_socket(d1f4bcc1-092d-4e63-bbda-2003ec246d48, ['arr'], ['!userData']) Exception AttributeError Info: module 'asyncio.base_futures' has no attribute 'InvalidStateError' Is it possible to fix it? Python 3.8.5 |
same issue here. using 1.16.9 with python 3.8.1 on windows 10 |
I am not sure, but it seems the InvalidSateError happens if you have to less system powser (CPU). Can you test it by making less streams or use a more powerful system? |
I am running this program on a server and the cpu useage is typically low. It won't go beyong 50% no matter what happens. |
i am running different test systems of this lib since one year. on my systems i recognized even 50% on average is very much. sometimes are peaks that are too much then. Running on a raspberry pi doenst work in general, dont know why. You just need one instance per endpoint (spot/futures/...), doesnt matter how much users you have. So your best setup should be two instances, one for spot and one for futures. then you can create 5 spot userData streams within one instance and 5 futures userData streams. you can split the stream_buffer, look at this example https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api/blob/master/example_multiple_userdata_streams.py so you know which stream has received the data. Till now you have had to use BUT: As you can see here #109 the new way of providing key and secret doenst work now, i try to fix it this weekend. |
Its fixed providing key and secret via create_stream()! Just update to 1.17.1 |
Still facing same issue. A stream is crashing and reconnecting time after time: ERROR:root:BinanceWebSocketApiSocket->start_socket(d1f4bcc1-092d-4e63-bbda-2003ec246d48, ['arr'], ['!userData']) Exception AttributeError Info: module 'asyncio.base_futures' has no attribute 'InvalidStateError' Is it possible to fix it? Python 3.8.5 |
I will remove the InvalidStateError code part - it was a fix for an other problem. Lets make one step back. |
@oliver-zehentleitner |
get_stream_info(stream_id) returns 'reconnects' = 1 after any qty of 'InvalidStateError' reconnects. Each time 'reconnects' = 1. 'logged_reconnects' = [..last reconnect timestamp..] - has only one element in the array of the last reconnection. May be it should be a list of timestamps of all reconnects? Python 3.8.5 |
@tahaEntesari @alekkhalex Its much more handy if there is one issue for one topic. Please think about that in the future! And open new one if needed! |
InvalidStateError: #110 |
@tahaEntesar Both fixes are released now in 1.17.4 |
Now all that reconnects have another message: CRITICAL:root:BinanceWebSocketApiSocket->start_socket(09655d52-c65d-4ea3-9df7-5e242dc2577d, ['arr'], ['!userData']) Exception ConnectionClosed Info: code = 1006 (connection closed abnormally [internal]), no reason From Binance documentation: Python 3.8.5 |
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
(I found one old issue with same problem asyncio.base_futures.InvalidStateError: invalid state #18, but bug still exists.)
Select one:
Environment
Operating System? (include version)
Python Version Requirement
Exact Python Version?
Pip Version?
Dependencies
UNICORN Binance WebSocket API Version?
Description of your issue
Debug log when streams crashed:
The text was updated successfully, but these errors were encountered: