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

Issue identified : Something really wrong happened! #39

Open
realogic opened this issue Dec 10, 2024 · 35 comments
Open

Issue identified : Something really wrong happened! #39

realogic opened this issue Dec 10, 2024 · 35 comments
Assignees

Comments

@realogic
Copy link

** Which country are you from **
ITALY

Describe the bug
Since this morning, the add-on fails with error "Something really wrong happened!"

Log file
Logger: homeassistant.config_entries
Source: config_entries.py:640
First occurred: 11:55:48 (2 occurrences)
Last logged: 11:55:57

Error setting up entry MAIL 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.13/site-packages/aiohttp/client_reqrep.py", line 1157, in raise_for_status
raise ClientResponseError(
...<5 lines>...
)
aiohttp.client_exceptions.ClientResponseError: 430, message='', 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 640, in __async_setup_with_context
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(
^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/config/custom_components/librelink/api.py", line 209, in api_wrapper
raise LibreLinkApiCommunicationError(
"Error fetching information",
) from exception
custom_components.librelink.api.LibreLinkApiCommunicationError: Error fetching information

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@D0ublek1ll
Copy link

I started having the same issue an hour ago, something seems to have changed on the libreview side of things as their API is returning an HTTP/430 status, which is not officially defined.

For me, this started happening at 11:04 today (CET).

@realogic
Copy link
Author

Yes, very same time

@TekFan
Copy link

TekFan commented Dec 10, 2024

I can confirm this happened to me as well at 11:04 CET today.
Their server could simply be down.

@D0ublek1ll
Copy link

D0ublek1ll commented Dec 10, 2024

I found another issue regarding the same status code from a couple of months ago: #31

In that it was suggested that it could be related to having to accept the terms of service on the libreview site/librelinkup app.
I am trying that right now, will update with results.

Edit: Did not fix the issue.

@realogic
Copy link
Author

I tried already, signing in and out the LibreLinkUp on my mobile. Accepted the terms, reloaded the add-on, no changes
On app data is retrieved, so I don't think the service is down

@lucamargoni
Copy link

Same problem. In these days the app LibrelinkUp warned to update compulsorily, otherwise it would stop working. They probably changed something in the API or simply the server for italy area

@D0ublek1ll
Copy link

Libreview, librelinkup and freestyle libre all seem to work as intended, so it seems to be the Libreview API that is causing these issues.

I tried using different regions/api servers but all give the same result.
Maybe @gillesvs can give us more insight into what could cause this issue?

@Pleister023
Copy link

Same here, same timestamp:

This error originated from a custom integration.

Logger: custom_components.librelink
Source: helpers/update_coordinator.py:414
integration: LibreLink integration (documentation, issues)
First occurred: 11:03:56 AM (1 occurrences)
Last logged: 11:03:56 AM

Error fetching librelink data: Something really wrong happened!

@gui-dos
Copy link

gui-dos commented Dec 10, 2024

They are now requiring a minimal version 4.12.0 to be specified in

and a new "Account-Id" HTTP header carrying the SHA256 digest of a user's id as a 64-char hexadecimal string along the JWT token.

Look at my Swift one-liners I PRed with JohanDegraeve/xdripswift@13e4a1e ;-)

@Pleister023
Copy link

_> They are now requiring a minimal version 4.12.0 to be specified in

and a new "Account-Id" HTTP header carrying the SHA256 digest of user-id as a 64-char hexadecimal string along the JWT token.
Look at my Swift one-liners I PRed with JohanDegraeve/xdripswift@13e4a1e ;-)_

Thanks for the update. I managed to change 4.7 into 4.12.0 in that config file.
I have no clue what to do with the rest of your solution: "and a new "Account-Id" HTTP header carrying the SHA256 digest of user-id as a 64-char hexadecimal string along the JWT token."
The link below that brings me to a lot of code. No idea what to do with this. Any help is much appreciated.

Thanks.

@Zpuit
Copy link

Zpuit commented Dec 10, 2024

Have the issue as well… latest reported glucose measurement sensor value at at 11:03 CET

@xamrex
Copy link

xamrex commented Dec 10, 2024

Same issue here @gillesvs are you planing to fix issue ?

@padoubek
Copy link

Also the same issue, Czech region. However the region seems to be not important in this case. Please, prepare uodate to fix it.

@Flemming789
Copy link

Same issue here in Denmark.

@santypav
Copy link

Spain is not different

@WillemBastiaens
Copy link

Belgium has the same problem since 11:04 CET

@xamrex
Copy link

xamrex commented Dec 10, 2024

based on #39 (comment)
i noticed that in const.py
VERSION_APP = "4.7"
should be changed to
VERSION_APP = "4.11.0"

but unfortunately i have no idea what to do with this sha256 function ;(

@xamrex
Copy link

xamrex commented Dec 10, 2024

@gui-dos
can you please take a look at
"Application": APPLICATION,
as i understand I need to add bellow: this line

"Account-Id": SOMETHING // and that SOMETHING has to be in sha256()
but what should be set as Account-id?
is it just sha256("4.11.0") ?

@gui-dos
Copy link

gui-dos commented Dec 10, 2024

@xamrex:

The Account-Id header has to be appended to the headers defined in

async def async_get_data(self) -> any:
"""Get data from the API."""
APIreponse = await api_wrapper(
self._session,
method="get",
url=self.connection_url,
headers={
"product": PRODUCT,
"version": VERSION_APP,
"Application": APPLICATION,
"Authorization": "Bearer " + self._token,
"patientid": self.patient_id,

If you follow yourself you can reuse the patient_id, otherwise you have to extract the logging user's id from reponseLogin["data"]["user"]["id"] (

monToken = reponseLogin["data"]["authTicket"]["token"]
).

I just noticed tonight's Python implementation by robberwick/pylibrelinkup@06bce45 which makes use of
hashlib.sha256(account_id.encode()).hexdigest() ;-)

4.12.0 version must be used instead of 4.11.0 now, of course.

@xamrex
Copy link

xamrex commented Dec 10, 2024

To ALL
Here is working fork:

https://github.com/kubasaw/librelink

@syska
Copy link

syska commented Dec 11, 2024

Also got the sam issue.

Happy to see there might be a solution soon to this issues.

@xamrex

First i was like ... there is alot of changes. Then I looked closer ...

You changed alot, but I just read the comment from the author on you commit.

Is is possible you can make a PR to just fix this issue so the packages can be updated via HACS?

@xamrex
Copy link

xamrex commented Dec 11, 2024

@syska its not my fork ;-)

Is is possible you can make a PR to just fix this issue so the packages can be updated via HACS?

Im afriad no,
It looks like author of this repo has some issue with PR:
Here is one opened
#34
and not merged.

So the easiest way to fix issue is to remove this repo form HACS and add this one:
https://github.com/kubasaw/librelink

@D0ublek1ll
Copy link

D0ublek1ll commented Dec 11, 2024

It appears this new repo (https://github.com/kubasaw/librelink) was added to HACS a couple of hours ago, its using the same name and icon. There are some changes as to which entities it presents and the naming has changed compared to the old integration (_glucose_measurement -> _measurement)

Also the newly added integration will install in the same location as the old one. so you should first delete and uninstall the old integration before installing the new one.

Given the author of this repo's lack of response and the past issues with the PR on this repo it should probably be removed from hacs.

@realogic
Copy link
Author

Moved to that repo too, just finished reconfiguring sensors. Thank you!
Still, thanks to the original author @gillesvs to his precious work

@syska
Copy link

syska commented Dec 11, 2024

A HUGE thanks to @gillesvs ...

It's not until things breaks you know how much you really need it.

Now we just need to figure out where it should be hosted going forward.

@r-jean-pierre
Copy link

Also have "Something really wrong happened!", using from France, the librelinkup on mobile works

@xamrex
Copy link

xamrex commented Dec 11, 2024

@r-jean-pierre use this custom repo instead:
https://github.com/kubasaw/librelink

@zaffraz
Copy link

zaffraz commented Dec 11, 2024

Hello. After the change of repo and restart ha I am now able to log in but then I get this errore
Screenshot_20241212-003150_Home Assistant

@syska
Copy link

syska commented Dec 12, 2024

@zaffraz

I Can't read that language ... I have abosolutely no idea what is says.

But I would open a terminal or editor and delete all the old "libre" files and try to install again. You should be able to select a "Patinet Id" with a radio button. ( Probably the email you want to follow )

@TekFan
Copy link

TekFan commented Dec 12, 2024

I Can't read that language ... I have abosolutely no idea what is says.

Luckily, Google Translate can ;-)
"Not all mandatory fields are filled in."

@xamrex
Copy link

xamrex commented Dec 12, 2024

@zaffraz for me it looks like there is no patiend_id,
and its probably beacuse you put libreview login and password, instead of librelink

Remember to download librelink on phone once, and accept terms.

@zaffraz
Copy link

zaffraz commented Dec 12, 2024

You were right. Now works. Thanks everyone for the supporto

@zaffraz for me it looks like there is no patiend_id,
and its probably beacuse you put libreview login and password, instead of librelink

Remember to download librelink on phone once, and accept terms.

@Rasmus-nylander
Copy link

Rasmus-nylander commented Dec 30, 2024

Hey Guys. I have tried to install the new https://github.com/kubasaw/librelink Custom repositories in HACS. But I get the following error. I admit I am pretty new in HA, so it might be me doing somehintg worng, but everything else I have installed in HACS have worked well so far.

Any help would be greatly appreciated :-)
Skærmbillede 2024-12-30 kl  00 52 58

The only "Libre link" I can find in the HACS store, is the "old version" from gillesvs.

@xamrex
Copy link

xamrex commented Dec 30, 2024

@Rasmus-nylander it looks like you have already added this repo to hacs.
go to HACS, top right corner Custom repo, and remove all integrations that starts with librelink

Then add this repo: https://github.com/kubasaw/librelink
Then in search bar, look for librelink, click that, and on botton there will be Download button.

@Rasmus-nylander
Copy link

@xamrex Thanks. I think I got confused that both versions seems to be by gillesvs when listed in HACS. But I took notice of the date and stars ratings, and spotted the difference. It all works again. Thanks a lot guys!

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