dvd-dev / hilo

Home Assistant Hilo Integration via HACS
MIT License
122 stars 26 forks source link

Nouvelle authentification, devient read-only après environ 24h #347

Closed ic-dev21 closed 4 months ago

ic-dev21 commented 6 months ago

Version of the custom_component

2024.XX.XX (beta)

Configuration

Describe the bug

Après une période d'environ 24h, le token expire et je deviens read-only. Environ 12h plus tard, la connexion tombe complètement

Debug log


This error originated from a custom integration.

Logger: pyhilo
Source: custom_components/hilo/climate.py:108 
Integration: Hilo (documentation, issues) 
First occurred: December 25, 2023, 12:27:25 PM (5 occurrences) 
Last logged: December 25, 2023, 12:28:12 PM

Giving up _async_request(...) after 9 tries (aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token'))
Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:238 
Integration: Home Assistant WebSocket API (documentation, issues) 
First occurred: December 25, 2023, 12:27:25 PM (5 occurrences) 
Last logged: December 25, 2023, 12:28:12 PM

[139937122232512] 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token')
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 224, in _async_request
    access_token = await self.async_get_access_token()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 131, in async_get_access_token
    await self._oauth_session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 515, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 184, in _async_refresh_token
    new_token = await self._token_request(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 214, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2067, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2104, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 878, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 948, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 632, in async_service_temperature_set
    await entity.async_set_temperature(**kwargs)
  File "/config/custom_components/hilo/climate.py", line 108, in async_set_temperature
    await self._device.set_attribute(
  File "/usr/local/lib/python3.11/site-packages/pyhilo/device/__init__.py", line 108, in set_attribute
    await self._set_attribute(dev_attribute, value)
  File "/usr/local/lib/python3.11/site-packages/pyhilo/device/__init__.py", line 118, in _set_attribute
    await self._api._set_device_attribute(self, attribute, value)
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 491, in _set_device_attribute
    await self.async_request("put", url, json={key.hilo_attribute: value})
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 159, in retry
    await _call_handlers(on_giveup, **details, exception=e)
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 37, in _call_handlers
    await handler(details)
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 16, in f
    return coro_or_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 314, in _handle_on_giveup
    raise RequestError(err) from err
pyhilo.exceptions.RequestError: 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token')
This error originated from a custom integration.

Logger: custom_components.hilo
Source: custom_components/hilo/__init__.py:336 
Integration: Hilo (documentation, issues) 
First occurred: December 25, 2023, 10:37:14 PM (1 occurrences) 
Last logged: December 25, 2023, 10:37:14 PM

Unhandled websocket event: WebsocketEvent(event_type_id=7, target='', arguments='', invocation=None, error='Service reloading, please reconnect.', timestamp=datetime.datetime(2023, 12, 24, 7, 38, 3, 97132), event_type='CLOSE')
This error originated from a custom integration.

Logger: pyhilo
Source: custom_components/hilo/__init__.py:433 
Integration: Hilo (documentation, issues) 
First occurred: December 25, 2023, 10:37:14 PM (3 occurrences) 
Last logged: December 25, 2023, 10:37:14 PM

Received close event from SignalR: Error: CLOSE Target: Args: Error: Service reloading, please reconnect.
Websocket: Received event to close connection: 8
Websocket: Closed while listening: Connection was closed.
Logger: pyhilo
Source: /usr/local/lib/python3.11/site-packages/pyhilo/websocket.py:331 
First occurred: December 25, 2023, 10:37:14 PM (1 occurrences) 
Last logged: December 25, 2023, 10:37:14 PM

Connection was closed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyhilo/websocket.py", line 326, in async_listen
    messages = await self._async_receive_json()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/websocket.py", line 170, in _async_receive_json
    raise ConnectionClosedError("Connection was closed.")
pyhilo.exceptions.ConnectionClosedError: Connection was closed.
This error originated from a custom integration.

Logger: pyhilo
Source: custom_components/hilo/__init__.py:432 
Integration: Hilo (documentation, issues) 
First occurred: December 25, 2023, 10:37:19 PM (1 occurrences) 
Last logged: December 25, 2023, 10:37:19 PM

Unable to connect to WS server 401, message='Invalid response status', url=URL('https://sigr-domo-prod-01.service.signalr.net/client/?hub=devicehub&asrs.op=%2FDeviceHub&asrs_request_id=eUD79EMOAAA%3D&id=9CUGU8pHvQmnRui6wkXaTQf9IYLgo02&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ii05MjQxNDgzNTIifQ.eyJhc3JzLnMuYXV0IjoiQXV0aGVudGljYXRpb25UeXBlcy5GZWRlcmF0aW9uIiwiYXNycy5zLmRlcnJvciI6IlRydWUiLCJpc1NpZ25VcCI6ZmFsc2UsInN1YiI6IjMwYTUxMDU3LTQ0ZGUtNDM2ZS05NDUzLTIxN2VmNTRmMWMwOSIsInVpZCI6IjMwYTUxMDU3LTQ0ZGUtNDM2ZS05NDUzLTIxN2VmNTRmMWMwOUBIaWxvRGlyZWN0b3J5QjJDLm9ubWljcm9zb2Z0LmNvbSIsImVtYWlsIjoiY291dHVyZWlhbjdAZ21haWwuY29tIiwibmFtZSI6IkNvdXR1cmUsIElhbiIsImdpdmVuX25hbWUiOiJJYW4iLCJmYW1pbHlfbmFtZSI6IkNvdXR1cmUiLCJ1cm46Y29tOmhpbG9lbmVyZ2llOnByb2ZpbGU6bG9jYXRpb25faWRlbnRpZmllciI6IjE1ODQyLVQ0VjRTOSIsInVybjpjb206aGlsb2VuZXJnaWU6cHJvZmlsZTpsb2NhdGlvbl9oaWxvX2lkIjoidXJuOmhpbG86Y3JtOjE1ODQyLXQ0djRzOTowIiwidGlkIjoiZThhZThjNWEtYTA2Ny00NzUzLThkMzQtZWUzNGQzOWYzMzA3IiwiaXNGb3Jnb3RQYXNzd29yZCI6ZmFsc2UsInNjcCI6InVzZXJfaW1wZXJzb25hdGlvbiIsImF6cCI6IjFjYTlmNTg1LTRhNTUtNDA4NS04ZTMwLTk3NDZhNjVmYTU2MSIsInZlciI6IjEuMCIsImFzcnMudS5pYXQiOiIxNzAzNDIxMzA4IiwiYXNycy51LmF1ZCI6IjYwNDlmNDA1LThiNzctNGZjNC1iMWEwLTcyNWRkNWEzNDlmMSIsImFzcnMudS5leHAiOiIxNzAzNDI0OTA4IiwiaXNzIjoiaHR0cHM6Ly9jb25uZXhpb24uaGlsb2VuZXJnaWUuY29tL2U4YWU4YzVhLWEwNjctNDc1My04ZDM0LWVlMzRkMzlmMzMwNy92Mi4wLyIsImFzcnMudS5uYmYiOiIxNzAzNDIxMzA4IiwidXNlcl90eXBlIjoiSGlsbyIsIm5iZiI6MTcwMzQyMTQ4MywiZXhwIjoxNzAzNDI1MDgzLCJpYXQiOjE3MDM0MjE0ODMsImF1ZCI6Imh0dHBzOi8vc2lnci1kb21vLXByb2QtMDEuc2VydmljZS5zaWduYWxyLm5ldC9jbGllbnQvP2h1Yj1kZXZpY2VodWIifQ.Ep8KZZKtLDJBs5jeEh94I5WA0_VmNwJSrr1AxoMQ8tg')
This error originated from a custom integration.

Logger: pyhilo
Source: custom_components/hilo/__init__.py:443 
Integration: Hilo (documentation, issues) 
First occurred: December 25, 2023, 10:41:40 PM (1 occurrences) 
Last logged: December 25, 2023, 10:41:40 PM

Giving up _async_request(...) after 9 tries (aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token'))
This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/hilo/__init__.py:443 
Integration: Hilo (documentation, issues) 
First occurred: December 25, 2023, 10:41:40 PM (1 occurrences) 
Last logged: December 25, 2023, 10:41:40 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyhilo/websocket.py", line 282, in async_connect
    self._client = await self._api.session.ws_connect(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 841, in _ws_connect
    raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 401, message='Invalid response status', url=URL('https://sigr-domo-prod-01.service.signalr.net/client/?hub=devicehub&asrs.op=%2FDeviceHub&asrs_request_id=eUD79EMOAAA%3D&id=9CUGU8pHvQmnRui6wkXaTQf9IYLgo02&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ii05MjQxNDgzNTIifQ.eyJhc3JzLnMuYXV0IjoiQXV0aGVudGljYXRpb25UeXBlcy5GZWRlcmF0aW9uIiwiYXNycy5zLmRlcnJvciI6IlRydWUiLCJpc1NpZ25VcCI6ZmFsc2UsInN1YiI6IjMwYTUxMDU3LTQ0ZGUtNDM2ZS05NDUzLTIxN2VmNTRmMWMwOSIsInVpZCI6IjMwYTUxMDU3LTQ0ZGUtNDM2ZS05NDUzLTIxN2VmNTRmMWMwOUBIaWxvRGlyZWN0b3J5QjJDLm9ubWljcm9zb2Z0LmNvbSIsImVtYWlsIjoiY291dHVyZWlhbjdAZ21haWwuY29tIiwibmFtZSI6IkNvdXR1cmUsIElhbiIsImdpdmVuX25hbWUiOiJJYW4iLCJmYW1pbHlfbmFtZSI6IkNvdXR1cmUiLCJ1cm46Y29tOmhpbG9lbmVyZ2llOnByb2ZpbGU6bG9jYXRpb25faWRlbnRpZmllciI6IjE1ODQyLVQ0VjRTOSIsInVybjpjb206aGlsb2VuZXJnaWU6cHJvZmlsZTpsb2NhdGlvbl9oaWxvX2lkIjoidXJuOmhpbG86Y3JtOjE1ODQyLXQ0djRzOTowIiwidGlkIjoiZThhZThjNWEtYTA2Ny00NzUzLThkMzQtZWUzNGQzOWYzMzA3IiwiaXNGb3Jnb3RQYXNzd29yZCI6ZmFsc2UsInNjcCI6InVzZXJfaW1wZXJzb25hdGlvbiIsImF6cCI6IjFjYTlmNTg1LTRhNTUtNDA4NS04ZTMwLTk3NDZhNjVmYTU2MSIsInZlciI6IjEuMCIsImFzcnMudS5pYXQiOiIxNzAzNDIxMzA4IiwiYXNycy51LmF1ZCI6IjYwNDlmNDA1LThiNzctNGZjNC1iMWEwLTcyNWRkNWEzNDlmMSIsImFzcnMudS5leHAiOiIxNzAzNDI0OTA4IiwiaXNzIjoiaHR0cHM6Ly9jb25uZXhpb24uaGlsb2VuZXJnaWUuY29tL2U4YWU4YzVhLWEwNjctNDc1My04ZDM0LWVlMzRkMzlmMzMwNy92Mi4wLyIsImFzcnMudS5uYmYiOiIxNzAzNDIxMzA4IiwidXNlcl90eXBlIjoiSGlsbyIsIm5iZiI6MTcwMzQyMTQ4MywiZXhwIjoxNzAzNDI1MDgzLCJpYXQiOjE3MDM0MjE0ODMsImF1ZCI6Imh0dHBzOi8vc2lnci1kb21vLXByb2QtMDEuc2VydmljZS5zaWduYWxyLm5ldC9jbGllbnQvP2h1Yj1kZXZpY2VodWIifQ.Ep8KZZKtLDJBs5jeEh94I5WA0_VmNwJSrr1AxoMQ8tg')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/hilo/__init__.py", line 432, in start_websocket_loop
    await self._api.websocket.async_connect()
  File "/usr/local/lib/python3.11/site-packages/pyhilo/websocket.py", line 294, in async_connect
    raise InvalidCredentialsError("Invalid credentials") from err
pyhilo.exceptions.InvalidCredentialsError: Invalid credentials

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 224, in _async_request
    access_token = await self.async_get_access_token()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 131, in async_get_access_token
    await self._oauth_session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 515, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 184, in _async_refresh_token
    new_token = await self._token_request(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 214, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/hilo/__init__.py", line 443, in start_websocket_loop
    await self._api.refresh_ws_token()
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 354, in refresh_ws_token
    (self.ws_url, self.ws_token) = await self.post_devicehub_negociate()
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 360, in post_devicehub_negociate
    resp = await self.async_request("post", url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 159, in retry
    await _call_handlers(on_giveup, **details, exception=e)
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 37, in _call_handlers
    await handler(details)
  File "/usr/local/lib/python3.11/site-packages/backoff/_async.py", line 16, in f
    return coro_or_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhilo/api.py", line 314, in _handle_on_giveup
    raise RequestError(err) from err
pyhilo.exceptions.RequestError: 400, message='Bad Request', url=URL('https://connexion.hiloenergie.com/HiloDirectoryB2C.onmicrosoft.com/B2C_1A_SIGN_IN/oauth2/v2.0/token')
Logger: homeassistant.helpers.config_entry_oauth2_flow
Source: helpers/config_entry_oauth2_flow.py:211 
First occurred: December 25, 2023, 8:38:38 AM (1125 occurrences) 
Last logged: 10:43:04 AM

Token request failed (invalid_grant): AADB2C90080: The provided grant has expired. Please re-authenticate and try again. Current time: 1703605191, Grant issued time: 1703507918, Grant expiration time: 1703507708
 Correlation ID: c75fa3aa-be50-466f-8b4b-f35426eedf49
 Timestamp: 2023-12-26 15:39:51Z
Token request failed (invalid_grant): AADB2C90080: The provided grant has expired. Please re-authenticate and try again. Current time: 1703605254, Grant issued time: 1703507918, Grant expiration time: 1703507708
 Correlation ID: d40e826f-0471-4798-893a-22fb1a25be07
 Timestamp: 2023-12-26 15:40:54Z
Token request failed (invalid_grant): AADB2C90080: The provided grant has expired. Please re-authenticate and try again. Current time: 1703605255, Grant issued time: 1703507918, Grant expiration time: 1703507708
 Correlation ID: 89c0deda-4443-4b6e-b30f-8231bee32fee
 Timestamp: 2023-12-26 15:40:55Z
Token request failed (invalid_grant): AADB2C90080: The provided grant has expired. Please re-authenticate and try again. Current time: 1703605383, Grant issued time: 1703507918, Grant expiration time: 1703507708
 Correlation ID: d82ab5c9-2ec0-4e5d-8fce-04c38a81b871
 Timestamp: 2023-12-26 15:43:03Z
Token request failed (invalid_grant): AADB2C90080: The provided grant has expired. Please re-authenticate and try again. Current time: 1703605384, Grant issued time: 1703507918, Grant expiration time: 1703507708
 Correlation ID: 920f6bd9-4b6e-4037-8909-64dbd530756c
 Timestamp: 2023-12-26 15:43:04Z

@nlz242 @dave-hilo je vous laisse regarder ça en 2024. Je peux gosser pour avoir plus de logs si nécessaire :)

elafontaine commented 5 months ago

Je crois que j'ai de quoi de relier a cette issue. Pour ma part par contre, ca me retourne des "503" et "404";

Unable to connect to WS server 503, message='Invalid response status', url=URL('https://sigr-domo-prod-01.service.signalr.net/client/?hub=devicehub&asrs.op=%2FDeviceHub&asrs_request_id=<REDACTED>%3D&id=<REDACTED>&access_token=<REDACTED>')
Unable to connect to WS server 404, message='Invalid response status', url=URL('https://sigr-domo-prod-01.service.signalr.net/client/?hub=devicehub&asrs.op=%2FDeviceHub&asrs_request_id=<REDACTED>%3D&id=<REDACTED>&access_token=<REDACTED>')

I found that some of the URI params seems to be "URI safe" values... but the place they appears seems weird (e.g. at the end of "asrs_request_id" or at the beginning of "asrs.op").

ic-dev21 commented 5 months ago

Je crois que j'ai de quoi de relier a cette issue. Pour ma part par contre, ca me retourne des "503" et "404";

Unable to connect to WS server 503, message='Invalid response status', url=URL('https://sigr-domo-prod-01.service.signalr.net/client/?hub=devicehub&asrs.op=%2FDeviceHub&asrs_request_id=<REDACTED>%3D&id=<REDACTED>&access_token=<REDACTED>')
Unable to connect to WS server 404, message='Invalid response status', url=URL('https://sigr-domo-prod-01.service.signalr.net/client/?hub=devicehub&asrs.op=%2FDeviceHub&asrs_request_id=<REDACTED>%3D&id=<REDACTED>&access_token=<REDACTED>')

I found that some of the URI params seems to be "URI safe" values... but the place they appears seems weird (e.g. at the end of "asrs_request_id" or at the beginning of "asrs.op").

Si c'est parce que tu n'as pas de lectures de températures ou autre de test appareils depuis ce week-end il semble y avoir un problème chez Hilo qui affecte un portion des users de HA. Si tu as quelques minutes appelle au service à la clientèle pour leur faire savoir que tu es aussi affecté ils ont eu plusieurs appels/courriels/messenger là dessus déjà. Si plus de clients le rapportent peut-être que ça va bouger.

Si tu utilises vraiment la nouvelle authentification en béta, normalement ça planterait aux 24h presque pile et nécessiterait que tu re-links ton compte à chaque fois avec un uninstall reinstall complet.

elafontaine commented 5 months ago

hum... peut-etre que c'est ce que c'etait. Par contre, j'ai des trous de donnees qui apparaisse. Je vais continuer à surveiller ce qui arrive pour voir si ca serait relier aux pannes de Hilo. Merci !

dave-hilo commented 4 months ago

@ic-dev21, pendant la période de 24h, est-ce que le service roule en arrière plan ou bien c'est la remise en fonction après 24h qui génère l'erreur?

ic-dev21 commented 4 months ago

@ic-dev21, pendant la période de 24h, est-ce que le service roule en arrière plan ou bien c'est la remise en fonction après 24h qui génère l'erreur?

Tout marche je pense que c'est la portion long life token qui ne reprend pas de service

ic-dev21 commented 4 months ago

@ic-dev21, pendant la période de 24h, est-ce que le service roule en arrière plan ou bien c'est la remise en fonction après 24h qui génère l'erreur?

Si tu me fais un fast forward merge je pourrais mettre en test sur une période de 24h+ et te sortir les logs au besoin. Let me know.

dave-hilo commented 4 months ago

@ic-dev21, pendant la période de 24h, est-ce que le service roule en arrière plan ou bien c'est la remise en fonction après 24h qui génère l'erreur?

Tout marche je pense que c'est la portion long life token qui ne reprend pas de service

Ce que je cherche à savoir c'est si le service (backend Home Assistant) roulait pendant la vie du token ou bien s'il était fermé.

dave-hilo commented 4 months ago

Le refresh token a une durée de vie de 24h et l'access token d'une heure. À chaque heure, normalement, une request devrait constater que l'access token est expiré et se servir du refresh token pour faire une nouvelle demande. Du même coup, cela devrait générer un nouveau refresh token bon pour un 24 heures de plus.

Ainsi, si le service était fermé, c'est normal que le refresh token ait le temps d'expirer et qu'une nouvelle authentification doive être faite. Par contre, si le service était en fonction, il y a un problème de gestion des tokens à investiguer.

ic-dev21 commented 4 months ago

Le refresh token a une durée de vie de 24h et l'access token d'une heure. À chaque heure, normalement, une request devrait constater que l'access token est expiré et se servir du refresh token pour faire une nouvelle demande. Du même coup, cela devrait générer un nouveau refresh token bon pour un 24 heures de plus.

Ainsi, si le service était fermé, c'est normal que le refresh token ait le temps d'expirer et qu'une nouvelle authentification doive être faite. Par contre, si le service était en fonction, il y a un problème de gestion des tokens à investiguer.

Je comprends. Si les logs ci haut ne t’aident pas je peux t’en produire d’autres

dave-hilo commented 4 months ago

Le problème a été identifié et il provient d'une configuration au niveau de l'authentification qui faisait en sorte que le refresh token mourrait systématiquement au bout de 24 heures.

Ce problème sera corrigé en production lors de notre prochaine release.

Je pourrai ensuite faire un merge de main vers feature/new-auth et nous pourrons tester de nouveau.

Je vous fais signe dès que c'est prêt.

ic-dev21 commented 4 months ago

Le problème a été identifié et il provient d'une configuration au niveau de l'authentification qui faisait en sorte que le refresh token mourrait systématiquement au bout de 24 heures.

Ce problème sera corrigé en production lors de notre prochaine release.

Je pourrai ensuite faire un merge de main vers feature/new-auth et nous pourrons tester de nouveau.

Je vous fais signe dès que c'est prêt.

Merci beaucoup des news Dave.

dave-hilo commented 4 months ago

2 PR en cours pour merger main dans feature/new-auth.

Après le merge, il sera possible de tester de nouveau.

dave-hilo commented 4 months ago

Information supplémentaire, le refresh token sera maintenant bon pour 14 jours. Il faudra donc qu'un utilisateur laisse son HA fermé pendant 14 jours avant qu'il soit obligé de passer par le processus de réauthentification.

ic-dev21 commented 4 months ago

Information supplémentaire, le refresh token sera maintenant bon pour 14 jours. Il faudra donc qu'un utilisateur laisse son HA fermé pendant 14 jours avant qu'il soit obligé de passer par le processus de réauthentification.

Excellent, installé sur un de mes environnement de dev, so far so good! Merci!

ic-dev21 commented 4 months ago

Closed by #388