Life360 get_circle_members: commError: 400

Hello, Hassio community.

The Life360 integration has stopped working for me and this is the message in the logs:

get_circle_members "[REDACTED circle name]": CommError: 400 Client Error: Bad Request for url: [REDACTED life360 api url]

I am running Home Assistant 0.104.3 on a Raspberry Pi 3b. It’s the Hass.io setup.
System Health looks good.

Has anyone else run across this issue? If you have, did you find a fix for it?

Thanks

Hi. Sorry for the late reply. Did you ever get this resolved?

No, I still get the same error.

Hmm, well that’s just weird. Before you can see that error it has successfully communicated to the Life360 server and got the list of circles (by name and id.) That happens when it tries to get the members of that circle using the id that was provided by the server. I’ve never seen or heard of this happening before. Could you try temporarily removing yourself from that Circle and see if the error goes away? Are you a member in other Life360 Circles, or just that one?

Also, you could try adding this to your config:

logger:
  default: info
  logs:
    life360: debug
    homeassistant.components.life360: debug

Then after you restart HA and run for a while and seen that error there should be more details in home-assistant.log that might help shed light on what’s going wrong. Feel free to share any of that data with me via PM.

I’ll try removing myself and having them re-add me tonight. It’s the only circle I’m in.

The logs show it doing fine at getting the list of circles and locations but then it just fails to get the members list. No more details about the error though.

Oh, so you’re only a member in the Circle; i.e., you’re not an admin of that Circle. I wonder if that means you’re not allowed to retrieve the details of the Circle. Hmm, I guess I never tried this scenario. I wonder if anyone else has.

As an experiment, could you try creating a Circle? They’re free so it shouldn’t cost you anything. It would be interesting to see if it works with a Circle that you’re an admin of.

I meant to try all this over the weekend and just never did for some reason. Will try to do it soon. Busy times.

But you are correct. I’m not the owner of the circle. It worked this way for months and then suddenly started producing this error.

Hmm, I guess I didn’t know that (or missed it if you had said it earlier.) Then I really don’t know what to tell you. The experiments might shed some light, but nothing has changed in the life360 integration so if it worked before I can’t imagine a reason it wouldn’t work anymore (unless Life360 changed how things work in the meantime.)

I figured out the problem.

Apparently Life360 returns a 400 code for the get members api if ANY of the circle members don’t have location sharing set to always on. Not sure if this is a new issue or if it’s always been that way and I only noticed now.

Do you mean the member’s location sharing setting in the Life360 app, or the device’s location sharing permissions in the phone?

EDIT: Either way, it shouldn’t do that. I just did a test. First I turned off location sharing in the Life360 app on my phone. Then I did a circle request via Postman. The data came just fine (no error), and features.shareLocation for my member had a value of 0 (which means off.) Then I turned off location sharing in my phone’s “Google Settings” (it’s an Android phone), and got the same results. (The Life360 app even popped up a notification telling me to turn that phone setting back on.) Turning both back on caused features.shareLocation to go back to 1 (which means on.)

The life360 integration has code to look at features.shareLocation, and will only update the device_tracker corresponding to the member if it is on.

Why do you say Life360 returns error 400? How did you test?

The location sharing in the app is what I mean. Turning off location services on the phone didn’t lead to an error.

I even tried it in a brand new circle with the same results. At least for that one user.

I saw the error in the logs. The same error I posted in the original post.

EDIT:
Hmm. It might have been only that one account causing the problem. I tried it on my phone and it’s working fine. … I just know I turned location sharing on for that account and it worked. lol.

I too have this error. I also had a member’s device that Life360 kept bugging me about for turning on location sharing (while it is on without battery saving etc.).
To test, I removed that person from the circle and immediately the error is gone and things started working again.

2020-08-16 12:41:23 ERROR (SyncWorker_2) [homeassistant.components.life360.device_tracker] get_circle_members "Family": CommError: 400 Client Error: Bad Request for url: https://api.life360.com/v3/circles/<<CIRCLE_ID>>/members
2020-08-16 12:41:35 ERROR (SyncWorker_11) [homeassistant.components.life360.device_tracker] Suppressing further errors until OK: get_circle_members "Family": CommError: 400 Client Error: Bad Request for url: https://api.life360.com/v3/circles/<<CIRCLE_ID>>/members
2020-08-18 09:20:01 ERROR (SyncWorker_35) [homeassistant.components.life360.device_tracker] get_circle_members "Family": OK again
2020-08-18 09:20:01 DEBUG (SyncWorker_35) [homeassistant.components.life360.device_tracker] Peter -> life360_peter: will be tracked, id=<<MEMBER_ID>>
... (followed by other members)

Thanks @pnbruckner for pointing me to this post!
(Now I need to figure out why Life360 has a problem with the location sharing)

Seems this problem still appears from time to time. See After latest update Life360 error logs · Issue #66724 · home-assistant/core (github.com).

Still no real answer as to why this happens, or what to do about it, but it may have to do with out-of-date entries in the OS’s DNS cache. See incident for details.