-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Corrupted fordpass_token.txt file #524
Comments
I just checked and mine at |
I'm trying to look into this issue, from first glance I see correct usage of the functions to read/write the token file. However, in the read_token, I see a retry mechanism that is trying to re-authenticate, which can rewrite the token file and retry reading it. Could you provide the full corrupt token file (so I can try to reproduce in test code) or debugging logs? I am wondering if the line "Fixing malformed token" is in there... |
I'll turn on debugging for the app and keep tabs the next few days. |
I was running into this as well... First time after authenticating it works, after it tries to reauthenticate, it fails with an extra } Before I found this issue, I just reauthenticated and it worked again... for a day or 2, now deleting the } fixes it as well.. I just enabled debugging as well for wehn it happens next time |
So I had the error again and did not seem to have fixing malformed token in the logs.... do have this stuff in logs: ` 2024-08-12 22:34:01.940 WARNING (SyncWorker_52) [urllib3.connectionpool] Retrying (Retry(total=5, connect=3, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: TLSV1_ALERT_INTERNAL_ERROR] tlsv1 alert internal error (_ssl.c:1000)'))': /v1.0/endpoint/default/authorize?redirect_uri=fordapp://userauthorized&response_type=code&scope=openid&max_age=3600&client_id=removed&code_challenge=removed&code_challenge_method=S256 2024-08-12 22:34:10.870 ERROR (MainThread) [custom_components.fordpass] Error fetching fordpass data: Error communicating with FordPass for removed |
Actually I restarted HA like 5 times in a row and ended up with both the extra } and the last character, so I had to delete the last 2 characters to get it working again. |
The first 4 errors are because of API changes on Home Assistant side, and was acually already reported in issue #520 and resolved with pull request #521, so updating your data to the latest 1.70 branch state will resolve these errors. Unfortunately I can't make sense of the last error at this moment. |
The @_fordpass_token.txt file often gets corupted with an additional } at the end occationally, at least a couple of times a month. Trying to figure out if this is common, or if this is a local file system issue on my system. Symptom is sensors becomes unavailable and setup fails after failing to refresh token. Temporary solution is always to remove the additional } at the end and save the file.
I cannot find any reason in the code for this, my theory has been that it happens if there is less characters when re-writing file than before, and it does not clear the file, but as far as I can see this should not happen.
Anyone else seeing this issue, or is it just me? This is on the 1.70 beta branch
{"access_token": "...", "refresh_token": "...", "expires_in": 1800, "refresh_expires_in": 31556952, "expiry_date": 1720862042.6590693, "auto_token": "...", "auto_refresh": "....", "auto_expiry": 1720860542.326344}}
Should be:
{"access_token": "...", "refresh_token": "...", "expires_in": 1800, "refresh_expires_in": 31556952, "expiry_date": 1720862042.6590693, "auto_token": "...", "auto_refresh": "....", "auto_expiry": 1720860542.326344}
The text was updated successfully, but these errors were encountered: