Skip to content
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

oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired) #3

Open
niklasosth opened this issue Apr 9, 2020 · 0 comments
Open

Comments

@niklasosth
Copy link

Seems to be a problem with token expiration after about an hour: TokenExpiredError

Log:
2020-04-08 23:32:47 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for kamereon which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-08 23:32:47 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-04-08 23:32:52 INFO (MainThread) [custom_components.kamereon] Logging in to service
2020-04-08 23:38:00 INFO (MainThread) [custom_components.kamereon] Logging in to service
2020-04-08 23:38:01 INFO (MainThread) [custom_components.kamereon] Doing a vehicle.refresh()...
2020-04-08 23:38:04 INFO (MainThread) [custom_components.kamereon] refresh done.
2020-04-08 23:38:04 INFO (MainThread) [custom_components.kamereon.sensor] BatteryLevelSensor.state...
...
...
...
2020-04-09 00:28:55 INFO (MainThread) [custom_components.kamereon] Logging in to service
2020-04-09 00:28:57 INFO (MainThread) [custom_components.kamereon] Doing a vehicle.refresh()...
2020-04-09 00:29:00 INFO (MainThread) [custom_components.kamereon] refresh done.
2020-04-09 00:29:00 INFO (MainThread) [custom_components.kamereon.sensor] BatteryLevelSensor.state...
2020-04-09 00:34:01 INFO (MainThread) [custom_components.kamereon] Logging in to service
2020-04-09 00:34:01 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
**File "/config/custom_components/kamereon/init.py", line 105, in update
for vehicle in kamereon_session.fetch_vehicles():
File "/config/custom_components/kamereon/kamereon.py", line 704, in fetch_vehicles
'{}v2/users/{}/cars'.format(self.settings['user_base_url'], self.user_id)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, kwargs)
File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 478, in request
url, http_method=method, body=data, headers=headers
File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)

2020-04-09 00:39:02 INFO (MainThread) [custom_components.kamereon] Logging in to service
2020-04-09 00:39:02 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/kamereon/init.py", line 105, in update
for vehicle in kamereon_session.fetch_vehicles():
File "/config/custom_components/kamereon/kamereon.py", line 704, in fetch_vehicles
'{}v2/users/{}/cars'.format(self.settings['user_base_url'], self.user_id)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 478, in request
url, http_method=method, body=data, headers=headers
File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired)
...
...

Maybee a login every time or some kind of token refresh every 30 minutes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant