-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Integration stopped working & cannot login anymore: 'auth_tmp_token' error #46
Comments
Just to know: Is anybody else experiencing the same issue? |
Hi @GertVanderstukken. I've never seen this issue before. What version of Home Assistant are you using and what version of this integration? Are they both up to date? |
Hey, strange... I'm on the latest version of everything: Home Assistant 2023.8.3 HACS: 1.32.1 |
I just installed a complete new Home Assistant server, installed HACS & Carelink integration => not working. |
I'm running the integration in the latest available version now. Maybe I can test some other versions tonight, I know there are some changes done to Home Assistant this year that had an impact on the integration but they are never in minor releases (e.g. 2023.8.2) but only in the major ones (e.g. 2023.8.0). There you got seems to occur when no session is setup with metronic after login. Not sure why this only seems to happen to you. |
I can confirm i have the same issue, also the temp token issue. Running the HA Core 2023.8.3 version on Python 3.11 on Raspbian. If you need more info let me know i'm happy to do some debug logging |
Jup, got it now too after a reboot. Not sure where this comes from but now I have a starting point at least. |
At least I'm not alone anymore. Welcome to the club :) |
I did a quick test with the original client lib I used (https://github.com/ondrej1024/carelink-python-client) and it has the same problem. I guess something changed in the login process again. It can also have something to do with the python version 3.11. Is there anyone still running on python 3.10 and running a working installation of the latest version of this integration? |
User-Agent data was modified in the xDRIP application and it started logging in correctly: NightscoutFoundation/xDrip@22954b7 |
OK, I found a way to make it work.
rebooted and all started working. I based myself on "carelink_client.py" - line 78 (https://github.com/ondrej1024/carelink-python-client). |
I corrected the code you wrote in the api.py file and everything works fine now - good job. |
Hmmm. These headers are removed in pr #39 because it made the login not work. Not completely sure if this is the final solution. |
hi @yo-han , |
Yes I noticed. But what I don't understand is why a version of a browser would be a factor for Medtronic to not let someone login. This is the second time these headers are the source of issues where users cannot login anymore. For now we can restore them, but I would like to know what the real reason is they need to be updated. Why would Chrome/112 be an issue? It's a release from may this year. A version like Chrome/87 would make more sense. |
I made a beta release with a possible fix. If anyone wants to test it please activate beta releases for this integration in Home Assistant and pull new updates. https://github.com/yo-han/Home-Assistant-Carelink/releases/tag/2023.8.0-b1 |
Works for my install. Ps my theory is that Medtronic was implementing updates on the Auth services. But the last Weeks there were quite a few outages, so maybe they opted to go back to something more reliable.. |
The beta also solves the issue for me |
Allright. A new release is available for everyone now. It worked for me I several version too so this must be it for now. |
Yes, the new release is working for me. |
The integration suddenly stopped working somewhere yesterday.
I have to say that I also had some issues on the app on my mobile for some time before that, so I figured it to be a general problem @ Medtronic.
Then the app on my mobile started working again, however the HA integration was not.
I tried to remove and re-add the integration, but when I try to complete the credential window, I get "bad username/password" (but I'm "sure" it's OK).
Anybody else with this problem?
This is in the logs:
2023-08-19 00:32:21.165 ERROR (MainThread) [custom_components.carelink] Unexpected error fetching carelink data: 'auth_tmp_token' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/carelink/__init__.py", line 149, in _async_update_data recent_data = await self.client.get_recent_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/carelink/api.py", line 468, in get_recent_data if await self.__get_authorization_token() is not None: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/carelink/api.py", line 430, in __get_authorization_token auth_token = self.async_client.cookies[CARELINK_AUTH_TOKEN_COOKIE_NAME] ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_models.py", line 1148, in __getitem__ raise KeyError(name) KeyError: 'auth_tmp_token' 2023-08-19 00:32:21.173 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Carelink' for carelink integration not ready yet: 'auth_tmp_token'; Retrying in background
The text was updated successfully, but these errors were encountered: