librelink icon indicating copy to clipboard operation
librelink copied to clipboard

Issue identified : Error 430 during login with LibreLink API - Home Assistant

Open hdmvide opened this issue 1 year ago • 15 comments

Which country are you from
I am located in Italy. This might help in understanding the API endpoints I am using. I have tried both the global endpoint (https://api.libreview.io/llu/auth/login) and the European endpoint (https://api-eu.libreview.io/llu/auth/login).

Describe the bug
When attempting to set up the LibreLink integration in Home Assistant, I receive an HTTP 430 error during the login process. This error occurs when the integration tries to authenticate with the LibreView API. The credentials I am using are valid and work on the official LibreView website, but the API call within Home Assistant fails.

Log file
Here’s the relevant portion of the log file (email address redacted):

2024-09-29 12:41:45.582 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [redacted] for librelink
Traceback (most recent call last):
  File "/config/custom_components/librelink/api.py", line 200, in api_wrapper
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 430, message='', url=URL('https://api-eu.libreview.io/llu/auth/login')

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/librelink/__init__.py", line 48, in async_setup_entry
    sessionToken = await myLibrelinkLogin.async_get_token()
  File "/config/custom_components/librelink/api.py", line 148, in async_get_token
    reponseLogin = await api_wrapper(
  File "/config/custom_components/librelink/api.py", line 209, in api_wrapper
    raise LibreLinkApiCommunicationError(
custom_components.librelink.api.LibreLinkApiCommunicationError: Error fetching information

I have activated debug mode, and I am happy to provide further logs if needed. Let me know if you require the complete log file, and I’ll ensure that sensitive information is redacted.

Screenshots
N/A (Please let me know if screenshots of specific configurations or errors would be helpful).

Additional context
I am running Home Assistant Core version 2024.6.0 and Frontend version 20240605.0. The system has internet access, and I can successfully reach the API endpoints via network tools (e.g., ping). The issue may be related to a change in the LibreView API or how the integration handles API responses.

Thank you

hdmvide avatar Sep 29 '24 10:09 hdmvide

Are you using librelinkUp account? Not librelink

gillesvs avatar Sep 29 '24 15:09 gillesvs

Thank you for your reply. I can confirm that I am using a LibreLink account, and it was working correctly in the past. However, it has recently stopped working. I have tried deleting the integration and reinstalling it from scratch, authenticating with the same account, but the issue persists. Despite this, the same account works fine in the LibreLink app.

hdmvide avatar Sep 29 '24 15:09 hdmvide

You need to use librelinkUp This integration does not work with librelink account Maybe you had the same credentials for both accounts in the past

gillesvs avatar Sep 29 '24 17:09 gillesvs

Sorry for the confusion. I actually have two different accounts—one for LibreLink and one for LibreLinkUp.

I've been using the same credentials for a long time and haven't changed them. In the Home Assistant integration, I use my LibreLinkUp account. If I use the same credentials to log into the official LibreLinkUp app, everything works fine. However, when I try to use these credentials in the Home Assistant integration, it fails and returns the error I mentioned earlier.

As I mentioned, I've been using this integration for several months without issues, but recently it stopped working, giving me this error. Again, I haven't changed my credentials; it simply stopped functioning.

I also tried deleting the integration from both Home Assistant and HACS, reinstalling it from scratch, and authenticating with the same (working) credentials I use in the LibreLinkUp app, but I still encounter the same issue.

hdmvide avatar Sep 29 '24 17:09 hdmvide

Hi, i have similar issue:

Traceback (most recent call last): File "/config/custom_components/librelink/api.py", line 200, in api_wrapper response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1093, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 430, message='', url='https://api.libreview.io/llu/auth/login'

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

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/librelink/init.py", line 48, in async_setup_entry sessionToken = await myLibrelinkLogin.async_get_token() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/librelink/api.py", line 148, in async_get_token reponseLogin = await api_wrapper( ^^^^^^^^^^^^^^^^^^ File "/config/custom_components/librelink/api.py", line 209, in api_wrapper raise LibreLinkApiCommunicationError( custom_components.librelink.api.LibreLinkApiCommunicationError: Error fetching information

ziolopl avatar Sep 29 '24 18:09 ziolopl

Yesterday evening the librelinkup app logged me out automatically. After logging in I accepted the new terms of service and now everything works in the HA.

ziolopl avatar Sep 30 '24 04:09 ziolopl

I'm not sure if it is related but I had the same issue.HA suddenly stopped picking up the entities even when I removed the integration and started again. Used the correct credentials for LibreLinkUp but still nothing. Ended up removing the connection from LibreLinkUp and resending the invite from LibreLink to the LibreLinkUp account and HA started working again

WaeedHussain avatar Oct 02 '24 14:10 WaeedHussain

i had to log out of the LibreLinkUp app and log in again. After logging in, I was prompted to accept the user agreement. When I accepted it, it went back to HA and re-enabled the integration, and it started working again.

I think this issue can be closed by adding a «FAQ» or something to the README?

jhthorsen avatar Oct 02 '24 20:10 jhthorsen

Yesterday evening the librelinkup app logged me out automatically. After logging in I accepted the new terms of service and now everything works in the HA.

it worked for me too. Thanks

hdmvide avatar Oct 02 '24 20:10 hdmvide

I'm not sure if it is related but I had the same issue.HA suddenly stopped picking up the entities even when I removed the integration and started again. Used the correct credentials for LibreLinkUp but still nothing. Ended up removing the connection from LibreLinkUp and resending the invite from LibreLink to the LibreLinkUp account and HA started working again

yep, i also experienced this issue several month ago. reinviting follower can be a solution. also, along this issue, i`ve experienced problems in master application with accessing menu "connected apps". but i forgot how i managed to access this function.

dashernln avatar Oct 03 '24 11:10 dashernln

@gillesvs maybe it worth to add this to troubleshooting section in readme?

dashernln avatar Oct 03 '24 11:10 dashernln

I'm afraid the integration becomes unusable. I reauthorized the user recently, now I have the same problem again: Failed setup, will retry: Something really wrong happened! Nice red, but a useless advise. Not everyone (not me) is a programmer bothering to go into the source code. I also enabled debugging, but can't find the logs (PEBKAS)...? Last one showing is from two days ago. I just removed the link, reauthorized, error remains. All shows nice on the LibreUp App. It's also a temporary workaround to remove and reauthorize in LibreUp, obviously not working very long. Hope there'll be an update quickly that resolves that situation. And I'm sure it's caused by Abbott, but that doesn't make it any less frustrating.

barthel-eu avatar Nov 22 '24 09:11 barthel-eu

I'm afraid the integration becomes unusable. I reauthorized the user recently, now I have the same problem again: Failed setup, will retry: Something really wrong happened! Nice red, but a useless advise. Not everyone (not me) is a programmer bothering to go into the source code. I also enabled debugging, but can't find the logs (PEBKAS)...? Last one showing is from two days ago. I just removed the link, reauthorized, error remains. All shows nice on the LibreUp App. It's also a temporary workaround to remove and reauthorize in LibreUp, obviously not working very long. Hope there'll be an update quickly that resolves that situation. And I'm sure it's caused by Abbott, but that doesn't make it any less frustrating.

that means me as a brand new user of this integration für HA - who has this problem this evening - cant do anything to work at the moment?

Techtobi83 avatar Nov 27 '24 19:11 Techtobi83

Mine wouldn't load either. After logging out of librelinkUp and back in I had two Terms updates to accept. Once I did that the integration loaded fine.

scottb721 avatar Dec 07 '24 00:12 scottb721

Status Quo: I just uninstalled the integration and LibreLinkUp, fall back to the Android Libre 3 app. It might be PEBKAS, but I couldn't get that integration to run for any length of time and think it's an Abbott-issue.

barthel-eu avatar Jan 02 '25 18:01 barthel-eu