core: Life 360 Integration - Invalid Authentication with correct details
The problem
I’ve noticed that around 1 am GMT, the life360 integration stopped working and prompted me with ‘Invalid authentication.’ Despite trying to provide the correct details and attempting to reboot and reinstall the integration, it still didn’t work. Interestingly, I was able to log out and log back into the Android app successfully, which suggests that they might have made some changes that affected the integration.
In the logs I’ve provided, it appears that Python is generating an ‘empty auth header.’ It’s possible that 360 now requires an additional header that is not being passed.
What version of Home Assistant Core has the issue?
core-2023.7.1
What was the last working version of Home Assistant Core?
core-2023.7.1
What type of installation are you running?
Home Assistant Container
Integration causing the issue
life360
Link to integration documentation on our website
https://www.home-assistant.io/integrations/life360/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Logger: homeassistant.config_entries
Source: config_entries.py:1297
First occurred: 00:52:15 (1 occurrences)
Last logged: 00:52:15
Config entry '{REDACTED EMAIL}' for life360 integration could not authenticate: empty auth header
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 87, in delete
result = await hass.config_entries.async_remove(entry_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1091, in async_remove
del self._entries[entry.entry_id]
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: '52820af4979e35990df416e586b730a2'
Additional information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 150
- Comments: 134 (5 by maintainers)
FYI I just created a fix for this. If you want to use it now, you can download this repo and copy the
life360
folder to the root of your config directory. Restart to apply changes.Please Just use the “thumb up” on the original post if you have the same issue rather than clutter up the comments.
Hi all. I just released a new version of the life360 pypi.org package that includes the change provided by @alexyao2015 that compensates for the Life360 API changes. Next I need to submit an update to the HA built-in life360 integration to pick up that new package version.
And, yes, this HA integration uses an undocumented & unsupported Life360 API that was reverse engineered years ago by people I don’t even know. We’ve been lucky for many years, but this was bound to happen some day. Hopefully it won’t happen again for another 5 or so years. 😉
Home Assistant 2023.7.3 Supervisor 2023.07.1 Operating System 10.3
For completeness and searchability, the error dialog I’m seeing now on the integration, when I click Reconfigure, is:
Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble
HA Log:
I now only get 500 error. Also can’t remove the integration 😦
Can confirm the issue. This is likely affecting all users currently.
Same issue. Had the
500
errors, but now I can no longer login.Should also note, I was logged out of the mobile app and forced to re-login around the same time HA reported Life360 stopped working.
So download the main branch and put in the folder life360 in the config directory and then go here and on the far right hand side you should see the word RAW and two icons to the right is download raw file. Download and then replace the api.py file in the life360 folder and restart.
Worked for me.
lcsneil
The temporary fix did NOT work for me when I downloaded from the following link: https://github.com/alexyao2015/life360-python
The temporary fix DOES work for me when I download from the following link: https://github.com/alexyao2015/life360-python/tree/485e063e67018b942f474999555b99e7d912fc3f
IDK if there’s a difference, but one works for me and the other doesn’t.
Here’s a direct link. Click the green code button, then click download zip. Copy the life360 folder to the root of your config directory. Restart to apply changes. Credit to @alexyao2015.
https://github.com/alexyao2015/life360-python/tree/485e063e67018b942f474999555b99e7d912fc3f
Same for me
To those having a problem with the files not working , I , like other above, was having the same issue and I had incorrectly downloaded the master branch of the code, Here is the direct link to the fix code, it is posted above but re posting for those that missed it.
https://github.com/alexyao2015/life360-python/tree/485e063e67018b942f474999555b99e7d912fc3f
[goldbe4804] you need to extract the zip copy only folder life360 to root of Hass config folder Note: The life360 folder is inside the folder life360-python-485e063e67018b942f474999555b99e7d912fc3f Reboot Hass
Or they don’t have customers…heh
Before I download the fix, generally, how quickly is a new HA build released when an Intergration has an issue like this? I don’t mind waiting a few days.
I downloaded repo mentioned above but it does NOT fix the issue. I put “life360” directory in CONFIG and second try in custom_components but no result. Life360 still broken. What is wrong?
Yes, once the pull request gets folded into the python library and the new library version gets incorporated into a new HA release you should be able to remove the life360 dir you just added to your instance.
A company with users accessing their API outside of their application in an unintended fashion.
Something we need to be careful about - given the recent changes by other large API’s suddenly charging for (or preventing) access.
I wonder who at life360 would think it’s a good idea to roll out breaking changes on Saturday…
The temp fix worked for me thanks a lot
Root/config is the correct place. Here you have to copy the folder life360 with the new api.py. Restart home assistant and then it works.
Best regards Peer
Hi Guys No idea why but i cannot see the intergration folder in my setup! What is the exact path please
wmrato --TY i took the life 360… folder out of the life 360 folder rebooted - it works TY – can you delete the folder when done -just wondering !!
Seems this fix did work for me 👍
This worked , it took a bit for me to figure out how to download that directory with the updated api.py.
I cloned the main repo, copied the life360 directory, then when into the branch link above and downloaded api.py and copied it in the life 360 director. Restarted HA and works.
You all are brilliant.