You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.
Describe the bug
My car went to the dealership for a small repair job. I suspect they did something that caused my access tokens to become revoked. The Volvo app returned an error message and I had to log in again. After that, the app was fine.
However, the HA add-on stopped working. I had a hard time getting this fixed because it didn't allow me to force a new login. The only thing I saw in the logs was:
Dec 22 14:59:32 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.10.5
Dec 22 14:59:32 volvo2mqtt [106] - DEBUG: MQTT Credentials - Host core-mosquitto Port: 1883 User: addons Pass: <REDACTED>
Dec 22 14:59:32 volvo2mqtt [106] - INFO: Using login from token file
Dec 22 14:59:32 volvo2mqtt [106] - INFO: Refreshing credentials
Dec 22 14:59:32 volvo2mqtt [106] - WARNING: VCCAPIKEY <REDACTED> isn't working! UNAUTHORIZED
Dec 22 14:59:32 volvo2mqtt [106] - DEBUG: [{'key': '<REDACTED>', 'extended': True, 'extended_until': None, 'in_use': False}]
Dec 22 14:59:32 volvo2mqtt [106] - WARNING: No working VCCAPIKEY found, waiting 10 minutes. Then trying again!
The warnings regarding the vcc api key are misleading, in my case the API key was fine. I tried removing and reinstalling the add-on, and I tried recreating the application in my Volvo developer account without success.
Eventually I managed to fix the problem by manually deleting the token file (/usr/share/hassio/addons/local/volvo2mqtt/token/.token). After restarting the add-on I got the 2FA e-mail, updated the OTP code in HA and the connection was successfully restored.
I have a few ideas to improve handling of this type of error:
The Volvo api is a bit generic response ("Full authentication is required to access this resource") whenever something is wrong with the api key OR the access token. The given warnings in the add-on shouldn't assume a problem with the api key.
Whenever a user changes the VCC Api key, it would make sense to force a login and remove the old token.
Would it make sense to create a force login option so the token can be removed manually?
To Reproduce:
Steps to reproduce the behavior:
Setup the integration
Somehow get the token become revoked or invalid
See error
Entities become stale, after restart they become "unavailable", log mentions warnings regarding the api key
Expected behavior:
Better handle errors caused by the token, allow HA admin to re-login manually or logout
Version info:
INFO: Starting volvo2mqtt version v1.10.5
Logs:
Dec 22 14:59:32 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.10.5
Dec 22 14:59:32 volvo2mqtt [106] - DEBUG: MQTT Credentials - Host core-mosquitto Port: 1883 User: addons Pass: <REDACTED>
Dec 22 14:59:32 volvo2mqtt [106] - INFO: Using login from token file
Dec 22 14:59:32 volvo2mqtt [106] - INFO: Refreshing credentials
Dec 22 14:59:32 volvo2mqtt [106] - WARNING: VCCAPIKEY <REDACTED> isn't working! UNAUTHORIZED
Dec 22 14:59:32 volvo2mqtt [106] - DEBUG: [{'key': '<REDACTED>', 'extended': True, 'extended_until': None, 'in_use': False}]
Dec 22 14:59:32 volvo2mqtt [106] - WARNING: No working VCCAPIKEY found, waiting 10 minutes. Then trying again!
The text was updated successfully, but these errors were encountered:
mathieuzimmo
changed the title
WARNING: VCCAPIKEY <REDACTED> isn't working! UNAUTHORIZED
Unauthorized warning about API key when token is revoked, no way to force login
Dec 22, 2024
Describe the bug
My car went to the dealership for a small repair job. I suspect they did something that caused my access tokens to become revoked. The Volvo app returned an error message and I had to log in again. After that, the app was fine.
However, the HA add-on stopped working. I had a hard time getting this fixed because it didn't allow me to force a new login. The only thing I saw in the logs was:
The warnings regarding the vcc api key are misleading, in my case the API key was fine. I tried removing and reinstalling the add-on, and I tried recreating the application in my Volvo developer account without success.
Eventually I managed to fix the problem by manually deleting the token file (
/usr/share/hassio/addons/local/volvo2mqtt/token/.token
). After restarting the add-on I got the 2FA e-mail, updated the OTP code in HA and the connection was successfully restored.I have a few ideas to improve handling of this type of error:
To Reproduce:
Steps to reproduce the behavior:
Entities become stale, after restart they become "unavailable", log mentions warnings regarding the api key
Expected behavior:
Better handle errors caused by the token, allow HA admin to re-login manually or logout
Version info:
Logs:
The text was updated successfully, but these errors were encountered: