Comments (22)
Thanks - let me try to find out why HA does not store the new token. We see in your log that after 3ms the reload starts, I assume that the token is not saved.
@dersch81 : Can you try the same?
from mbapi2020.
Thanks - let me try to find out why HA does not store the new token. We see in your log that after 3ms the reload starts, I assume that the token is not saved.
@dersch81 : Can you try the same?
Yes, that fixed it! Many thanks! I did never notice that option but now i will never forget :)
from mbapi2020.
Hi,
thanks. The Key-error is fixed in the latest beta.
The root cause is still unknown. I had this once this week and currently try to find out the root cause. In case you want help, please set the log level for the component to debug and share the log via email [email protected] after it happens again.
from mbapi2020.
Just had the reauthentification issue after installing latest stable, then installed latest beta. Now works again.
Unfortunatly Debug log downloaded does not contain the error messages before restart, but at least I can confirm beta is working for me.
Thx for all your work.
KR
Kneip
from mbapi2020.
I had the same KeyError: 'entry_id'
and thus upgraded to v0.11.2-beta.1 but now I have a different problem:
I still get Authentication failed. Please reauthenticate.
but it is persistent now (i.e. the error appears each time after I re-authenticate) and the exception is this:
ERROR (MainThread) [custom_components.mbapi2020.oauth] Error requesting: https://id.mercedes-benz.com/as/token.oauth2
- 0 - {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"}
Is this a wholly separate issue? Any ideas how to fix it?
from mbapi2020.
I had the same
KeyError: 'entry_id'
and thus upgraded to v0.11.2-beta.1 but now I have a different problem: I still getAuthentication failed. Please reauthenticate.
but it is persistent now (i.e. the error appears each time after I re-authenticate) and the exception is this:ERROR (MainThread) [custom_components.mbapi2020.oauth] Error requesting: https://id.mercedes-benz.com/as/token.oauth2 - 0 - {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"}
Is this a wholly separate issue? Any ideas how to fix it?
Same here. I can't reauthenticate now anymore with the same error. I also reinstalled the last stable but same issue.
from mbapi2020.
I have published a new beta version v0.11.2-beta2
This adds some special handling to hopefully address the issue.
from mbapi2020.
I have published a new beta version v0.11.2-beta2
This adds some special handling to hopefully address the issue.
Unfortunatley not.
2024-03-04 13:26:03.728 DEBUG (MainThread) [custom_components.mbapi2020] Start async_setup_entry.
2024-03-04 13:26:03.728 DEBUG (MainThread) [custom_components.mbapi2020.client] WSL not detected - running in rlock mode
2024-03-04 13:26:03.728 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2024-03-04 13:26:03.729 DEBUG (MainThread) [custom_components.mbapi2020.oauth] custom_components.mbapi2020.oauth token expired -> start refresh
2024-03-04 13:26:03.729 INFO (MainThread) [custom_components.mbapi2020.oauth] Start async_refresh_access_token() with refresh_token
2024-03-04 13:26:03.729 INFO (MainThread) [custom_components.mbapi2020.oauth] Auth token refresh preflight request 1
2024-03-04 13:26:03.731 DEBUG (MainThread) [custom_components.mbapi2020] Can not connect to MB OAuth API https://id.mercedes-benz.com. Will try again.
from mbapi2020.
Sorry, my mistake - the dev proxy was still active. I have published a new beta release v0.11.2-beta.3
from mbapi2020.
Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht
Logger: custom_components.mbapi2020.oauth
Source: custom_components/mbapi2020/oauth.py:317
Integration: MercedesME 2020 (documentation, issues)
First occurred: 14:15:47 (2 occurrences)
Last logged: 14:19:57
Error requesting: https://id.mercedes-benz.com/as/token.oauth2 - 0 - {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"}
When i then try again, i don't receive a new PIN anymore via mail and the integration will not stop to ask for a PIN which i never receive.
from mbapi2020.
Are you sure that you installed the latest beta version 0.11.2-beta.3? Please enable the debug log and restart HA. Then try again to request a pin.
from mbapi2020.
Yes
from mbapi2020.
Could you open a new issue and share the debug log, system information, please - we have to analyze why you don't get a pin.
from mbapi2020.
Sure i can do, but i don't think it has anything to do with the mail itself. Still getting this:
2024-03-04 15:48:58.577 DEBUG (MainThread) [custom_components.mbapi2020] Start async_setup_entry.
2024-03-04 15:48:58.577 DEBUG (MainThread) [custom_components.mbapi2020.client] WSL not detected - running in rlock mode
2024-03-04 15:48:58.577 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2024-03-04 15:48:58.578 DEBUG (MainThread) [custom_components.mbapi2020.oauth] custom_components.mbapi2020.oauth token expired -> start refresh
2024-03-04 15:48:58.578 INFO (MainThread) [custom_components.mbapi2020.oauth] Start async_refresh_access_token() with refresh_token
2024-03-04 15:48:58.578 INFO (MainThread) [custom_components.mbapi2020.oauth] Auth token refresh preflight request 1
from mbapi2020.
Did you rerun the reauth procedure? What is the log entry after preflight?
from mbapi2020.
Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht
Logger: custom_components.mbapi2020.oauth
Source: custom_components/mbapi2020/oauth.py:317
Integration: MercedesME 2020 (documentation, issues)
First occurred: 15:49:07 (2 occurrences)
Last logged: 16:24:10
Error requesting: https://id.mercedes-benz.com/as/token.oauth2 - 0 - {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"}
from mbapi2020.
Could please try to be a little bit more descriptive otherwise I cant help you? This error message is not an reauth-error. If you don't want to do this, then you can only delete the integration from the HA integration page and re-add it to get a clean state.
from mbapi2020.
But this was the answer of your request. I don't had any other error in the log right after the preflight.
Also i think there is no other request for a new PIN if no Pin or a wrong or a expired pin has been entered. This need to be handled by the integration i guess. But in my case without a PIN or an expired there is no way to request a new one.
from mbapi2020.
Thank you @ReneNulschDE for taking the time to help us. I'll try to add what I can.
- I have a docker installation, HA v2024.2.5
- I also have beta3 of the integration installed now
- Since the initial KeyError above I always have a notification that the MB integration needs to be reconfigured. When I click reconfigure, I am prompted to authenticate again. So I enter my login and PIN:
- Then I get this success message:
- But once I close that popup, I still have the reconfigure prompt and this view:
- The whole debug log through the full re-authentication process is this:
2024-03-04 18:43:33.047 INFO (MainThread) [custom_components.mbapi2020.oauth] Start request PIN <[email protected]>
2024-03-04 18:43:33.047 INFO (MainThread) [custom_components.mbapi2020.oauth] PIN preflight request 1
2024-03-04 18:43:33.252 INFO (MainThread) [custom_components.mbapi2020.oauth] PIN request
2024-03-04 18:43:41.449 DEBUG (MainThread) [custom_components.mbapi2020] Token received
2024-03-04 18:43:41.452 DEBUG (MainThread) [custom_components.mbapi2020] Start async_setup_entry.
2024-03-04 18:43:41.453 DEBUG (MainThread) [custom_components.mbapi2020.client] WSL not detected - running in rlock mode
2024-03-04 18:43:41.453 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2024-03-04 18:43:41.455 DEBUG (MainThread) [custom_components.mbapi2020.oauth] custom_components.mbapi2020.oauth token expired -> start refresh
2024-03-04 18:43:41.456 INFO (MainThread) [custom_components.mbapi2020.oauth] Start async_refresh_access_token() with refresh_token
2024-03-04 18:43:41.456 INFO (MainThread) [custom_components.mbapi2020.oauth] Auth token refresh preflight request 1
2024-03-04 18:43:41.721 ERROR (MainThread) [custom_components.mbapi2020.oauth] Error requesting: https://id.mercedes-benz.com/as/token.oauth2 - 0 - {"error_description":"unknown, invalid, or expired refresh token","error":"invalid_grant"}
2024-03-04 18:43:41.722 ERROR (MainThread) [custom_components.mbapi2020] Authentication failed. Please reauthenticate.
So far I am hesitant to just remove and install the integration again because I am worried that some entities might end up with different names or similar which would break my code. Let us know if you feel like you can't easily fix this, then I'll just take the bullet. ;)
from mbapi2020.
@fvbrandt : Thanks for the details. Do you have the option to click on the "configure" link on the integration page?
from mbapi2020.
@fvbrandt : Thanks for the details. Do you have the option to click on the "configure" link on the integration page?
💯 That was the right hint! Under the three-dot-menu there was the "configure" option and there I only chose "Delete authentication token file now. require a restart of Home Assistant after save." and pressed submit. Then restart and one final re-authentication and this time it worked. So I guess it was a missing cache invalidation in some place?
from mbapi2020.
Beta version & re-auth sorted this for me. Thanks as always @ReneNulschDE!
from mbapi2020.
Related Issues (20)
- Car is constantly disconnected after last update HOT 4
- Values jump between actual Value and old Value? HOT 5
- Device Tracker no longer showing correctly HOT 6
- Logs being filled with connecting to Mercedes, connected too Mercedes messages HOT 2
- shouldn't odometer sensor have state_class total_increasing instead of measurement? HOT 2
- Remove spikes HOT 3
- authentication is failing since update to 0.13.0 HOT 2
- Detected blocking call to open inside the event loop HOT 2
- Calling the configure max soc service switches the charging program to standard HOT 11
- "Task exception was never retrieved" on HA 2024.5.5 HOT 4
- Not able to set up the integration HOT 11
- Error requesting: https://bff.emea-prod.mobilesdk.mercedes-benz.com/v2/vehicles - 418 - 0 - HOT 1
- Service window_open - missing field PIN HOT 1
- Missing entities HOT 3
- Webapi change HOT 3
- async_forward_entry_setup after the entry for integration
- "Endofchargetime" Sensor
- Create sensor tirewarningsrdk
- Geographic violation issue HOT 7
- W206 - AMG C43 (2024) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mbapi2020.