-
Notifications
You must be signed in to change notification settings - Fork 81
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
ssl.SSLWantReadError: The operation did not complete (read) #662
Comments
I guess this is either an issue of the BMW servers or at least your connectivity to them. Nothing really I would know we can change. By default, the timeout is 5s (which should be plenty). |
OK, thanks for the answers. It is not at my side... I have now build in retries... |
I am still getting troubles and after investigating I might have found a track of the origin. As all was working nice a long time and now I am getting the problem, I migth be linked with an update to bullseye (and thus Python 3.9). I found back
As my Domoticz server is based on Bullseye (Python 3.9), would it be possible to have a workaround? I am willing to implement retries, but it seems that this exception destroys sth fundamentally so that a restart of the of the server is the only way out (which is not practical). So if it would be possible to catch this error it would be nice... For more info about my implementation (that ran since a long time without any problem): Domoticz Plugin Thanks F |
Hi Filip, I fear I have no clue how to work around this in the library. As we do not build our own HTTP connections but just reusing See e.g. https://tiltingatwindmills.dev/how-to-install-an-alternate-python-version/. Then run your scripts not via Richard |
The problem comes with the call to get_vehicles() as I am doing it in loop every 10 min. The problem is that a simple retry from my side doesn't work if I capture the problem... Only a complete reset works (even redoing first a MyBMWAccount fails always then). So I thought that there is some "bmw context" lost during the "crash" and if you could capture the problem yourself and make a retry possible, it could help (I can do the retry myself of course)... But not sure, you know better your code. I also thought about the second python, but Domoticz uses an embedded python... It is not a simple execution of a script. So this makes it all more complex and I am afraid of side effects. |
It seems you loose the BMW context as you set If you don't do this, it should continue. In light of the recent changes with captchas, you should look into storing |
This line of code is also for a workaround that doesn't happen anymore... |
Hi rikroe,
|
Hi Filip, I'll try to anwer below.
Correct.
Correct.
Yes, if you have a # Initialize MyBMWAccount (but only the object itself, this does login/connect to BMW API )
acc = MyBMWAccount(username, password, region)
# Now we set the previously stored tokens into the account
acc.set_refresh_token(refresh_token=stored_refresh_token, gcid=stored_gcid)
# When getting the vehicles, the library will automatically login using refresh token
await acc.get_vehicles()
# if acc.refresh_token has changed to the previous value, it should be stored again
If BMW decides to force-logout a user or for some reason getting the automated refresh token doesn't work. Hope this helps! |
This was of great help and clarified all for me! Thanks! Update for integration in domoticz is on its way... |
I finished the implementation yesterday evening, but getting now systematically an error after calling
|
Can you please open a separate issue? There's a lot going on still and this would help organizing |
Perhaps this topic is a bit mixed up, but coming back to the origin of the topic... And the strange thing, once this error happens once, it is persistant, only starting the whole flow again from authentication etc is solving the problem (which is in practice - a manual intervention to restart the "plugin"). So I was wondering if it could be a problem with the ssl context that gets lost somewhere? Filip |
Well, running with However it would be an easy test and then we can try figuring out an alternative. |
yes, I know about the security impact. I started yesterday with the option and it is still running without error... Yesterday I had twice the problem... But this is not a guarantee as before it ran for some days without problem... So it really seems random... I will monitor longer and will see. |
Describe the issue
I got regular ssl.SSLWantReadError on the get_vehicles().
I am using version 0.16.3, but got it also with other versions.
See traceback below.
Expected behavior
Which Home Assistant version are you using?
(using Domoticz)
What was the last working version of Home Assistant Core?
No response
What is your region?
Rest of world
MyBMW website
Number of cars
Output of bimmer_connected fingerprint
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: