pnbruckner / ha-life360

A Home Assistant integration for Life360.
32 stars 4 forks source link

Get an account login error after about 30 minutes #25

Open andrewcliffoutlook opened 3 weeks ago

andrewcliffoutlook commented 3 weeks ago

I am able to add the integration and login using email address and password and have also successfully used the token method and the integration successfully retrieves my circle but after about 30 minutes I get a 403 error on the members in my circle and it all stops working and I get a account repair message in Homeassistant and the Life360 online entity goes into a disconnected state

pnbruckner commented 3 weeks ago

Hmm, they may have changed things again!

andrewcliffoutlook commented 3 weeks ago

I can share debug logs with you if that helps

andrewcliffoutlook commented 3 weeks ago

Looking at your code for life360 the issue is being caused by the following code:

case HTTP_Error.FORBIDDEN: raise LoginError(err_msg) from exc

I think in reality when the life360 api gives this response it is not a terminal error and is much like the too many requests error. If you wait and try again then this error won't occur again.

I am basing this on the fact that if enable the account again it all works again for a while and then later fails again with this error.

pnbruckner commented 3 weeks ago

Yeah, that might be the case. I had considered always retrying 403, but never saw it for anything other than the query for Circles.

I think I'll go ahead and always retry 403 & 429, for all messages. But since the Member query happens every 5 seconds, I'll have to give some thought on the best way to handle these errors for that query.

pnbruckner commented 3 weeks ago

Actually, I did add some retrying of error 403 for all queries (except for Circles, which is handled differently.)

It will retry after an error 403 up to two times for each query, but it does so immediately. You can see this in the log (if you have debug enabled.) There should be a DEBUG message from [life360.api] that contains "Request error:", followed by a DEBUG message from [custom_components.life360.coordinator] that contains "will retry".

Do you see those in your log? Do you ever see where this is "successful" (i.e., it retries and the query works, so it doesn't result in the account being disabled)? Or do you only see where it retries but is unsuccessful, resulting in the account getting disabled?

How to handle this really depends on the behavior of the server, which is pretty unpredictable. A simple thing to try would be to add some small amount of delay, like say, 5 seconds, after the error (instead of zero, which is what it uses now.) That would work if it was just a "glitch", and the server would process the query normally very quickly. Or, I suppose, it could be bumped up to 30 seconds, a minute, whatever. And possibly the retry count limit could be bumped up from 2 as well. I'm pretty sure it would just cause the current entity update to take longer, and assuming it does eventually work, it would just go back to updating every 5 seconds. Or really, 5 seconds between update attempts, where each attempt would take as long as necessary, up to the limit of retrying. I think there has to be some cutoff, otherwise it could just never update or error out.

Anyway, if you have the ability to modify the code, and are willing to try some experiments, I could suggest what to try.

andrewcliffoutlook commented 3 weeks ago

Hi Phil

I do have the ability to make code changes and would be happy to experiment.

Kind regards

Andrew Cliff

Sent from my phone

On 6 Jun 2024, at 16:04, Phil Bruckner @.***> wrote:



Actually, I did add some retrying of error 403 for all queries (except for Circles, which is handled differently.)

It will retry after an error 403 up to two times for each query, but it does so immediately. You can see this in the log (if you have debug enabled.) There should be a DEBUG message from [life360.api] that contains "Request error:", followed by a DEBUG message from [custom_components.life360.coordinator] that contains "will retry".

Do you see those in your log? Do you ever see where this is "successful" (i.e., it retries and the query works, so it doesn't result in the account being disabled)? Or do you only see where it retries but is unsuccessful, resulting in the account getting disabled?

How to handle this really depends on the behavior of the server, which is pretty unpredictable. A simple thing to try would be to add some small amount of delay, like say, 5 seconds, after the error (instead of zero, which is what it uses now.) That would work if it was just a "glitch", and the server would process the query normally very quickly. Or, I suppose, it could be bumped up to 30 seconds, a minute, whatever. And possibly the retry count limit could be bumped up from 2 as well. I'm pretty sure it would just cause the current entity update to take longer, and assuming it does eventually work, it would just go back to updating every 5 seconds. Or really, 5 seconds between update attempts, where each attempt would take as long as necessary, up to the limit of retrying. I think there has to be some cutoff, otherwise it could just never update or error out.

Anyway, if you have the ability to modify the code, and are willing to try some experiments, I could suggest what to try.

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2152766806, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IO36FJVLH66LQFOYWHLZGB3ALAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSG43DMOBQGY. You are receiving this because you authored the thread.Message ID: @.***>

pnbruckner commented 3 weeks ago

Great! In custom_components/life360/coordinatory.py, on line 491, which should look like this:

delay = 0

change the zero to some number of seconds. That will cause it to wait after an error 403 before trying again.

If you want to increase the max number of retries, then in the same file, just above on line 485, which should look like this:

and login_error_retries < MAX_LOGIN_ERROR_RETRIES

change MAX_LOGIN_ERROR_RETRIES to a number larger than 2 (which is its current value.)

James62370 commented 3 weeks ago

I'm not sure if this is related, but I started getting a similar error, when I logged out of the life360 website. I got a new token and didn't log out this time, and the add-on has stayed connected for a few days now.

andrewcliffoutlook commented 3 weeks ago

I have applied the changes you recommended setting a 30 second retry when it gets a login error, increasing the max login error retries to 10 and I also changed the update delta to 10 seconds.

With these changes it seems to be stable and it has been running for 3 hours without disconnecting and disabling the account.

Kind regards

Andrew Cliff

Sent from my phone

On 6 Jun 2024, at 18:17, Phil Bruckner @.***> wrote:



Great! In custom_components/life360/coordinatory.py, on line 491, which should look like this:

delay = 0

change the zero to some number of seconds. That will cause it to wait after an error 403 before trying again.

If you want to increase the max number of retries, then in the same file, just above on line 485, which should look like this:

and login_error_retries < MAX_LOGIN_ERROR_RETRIES

change MAX_LOGIN_ERROR_RETRIES to a number larger than 2 (which is its current value.)

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2153031522, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IOYAWLVIWZA3KTMZ43TZGCKQ7AVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJTGAZTCNJSGI. You are receiving this because you authored the thread.Message ID: @.***>

pnbruckner commented 3 weeks ago

Good to hear!

But the server often changes its behavior now and then. There have been times I've seen more errors than at other times.

Could you check your log to see if you're getting any 403 (or 429) errors? From above:

It will retry after an error 403 up to two times for each query, but it does so immediately. You can see this in the log (if you have debug enabled.) There should be a DEBUG message from [life360.api] that contains "Request error:", followed by a DEBUG message from [custom_components.life360.coordinator] that contains "will retry".

I'd really like some details on how often the errors happen, how many retries are needed, etc.

James62370 commented 3 weeks ago

Curious, is it a requirement to stay logged on with the life360 website, or does that invalidate the token upon logging out?

pnbruckner commented 3 weeks ago

Curious, is it a requirement to stay logged on with the life360 website, or does that invalidate the token upon logging out?

Your guess is as good as mine. But, FWIW, whenever I've used/tested this method, I've never logged out of the website. I simply closed the browser.

andrewcliffoutlook commented 3 weeks ago

I am getting those but with the 30 second retry it doesn't fail on the retry.

Kind regards

Andrew Cliff

Sent from my phone

On 7 Jun 2024, at 16:07, Phil Bruckner @.***> wrote:



Good to hear!

But the server often changes its behavior now and then. There have been times I've seen more errors than at other times.

Could you check your log to see if you're getting any 403 (or 429) errors? From above:

It will retry after an error 403 up to two times for each query, but it does so immediately. You can see this in the log (if you have debug enabled.) There should be a DEBUG message from [life360.api] that contains "Request error:", followed by a DEBUG message from [custom_components.life360.coordinator] that contains "will retry".

I'd really like some details on how often the errors happen, how many retries are needed, etc.

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2155032706, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IOZQCJQCMHPG3QMO7EDZGHEDLAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVGAZTENZQGY. You are receiving this because you authored the thread.Message ID: @.***>

Menz01 commented 1 week ago

i am getting the account logon errors and as soon as it's "repaired" it shows as broken again. it still seems to be working however as the map shows where my family is. not sure why the error won't go away

pnbruckner commented 1 week ago

@Menz01 that doesn't make a lot of sense to me. If it creates a repair issue, then it also disables the account, and if the account is disabled, it won't fetch new data (unless there's a second account registered that is not disabled and also sees the same members.)

I don't have a lot of data points yet, but I suppose I could release a new version that increases the delay after a "login" error from zero to, say, 10 seconds, and maybe increases the max retry count from 2 to 12, which would allow it up to two minutes of retrying to hopefully avoid creating the repair issue and disabling the account. But, since I've never experienced this, I have no way to know what the worst case might be.

Is there any chance you could try making the changes yourself to see what values, if any, avoid the problem?

Menz01 commented 1 week ago

@pnbruckner actually, i was wrong... life360 is not working. i have other things i use for tracking which is why my family is on the map. so is life360 broken again?

pnbruckner commented 1 week ago

so is life360 broken again?

It's working for many people, including myself. I've only heard minimal reports about this scenario, and since I can't reproduce the problem myself, I need more input than I have so far to decide what to do.

Is there any way you can try the changes described above yourself and let me know the minimum values that make it work for you, assuming it does?

Also, @andrewcliffoutlook , same question to you?

I'd like to release a change with more retrying of this error, but since I can't reproduce the problem, I need your input. I don't just want to use large values, or retry forever.

Menz01 commented 1 week ago

@pnbruckner i am really bad at making coding changes and will probably mess it up even more. so i wanted to perhaps "show" you what i am "seeing"

here is the error i see in settings screen accont error

but if i go to the integrations screen it does not look like its broken (i have other integrations that have red boxes around them showing something is wrong) not showing as broken

and if i go to the service itself i see this open integration

and here is the most odd part.... if i enable debugging and then disable it and download the log there are no errors for life360 in the log at all

pnbruckner commented 1 week ago

This is all expected. When the error occurs enough, the repair issue is created, and the account is disabled. If you click on the repair issue, it should tell you to go to the Life360 integration entry page and "then click CONFIGURE and modify account". When you do, you should see it is disabled.

Since the account is disabled, the entities will not update. In fact, what you're seeing when you look at the integration entities is that they are all "not provided". If you look at the state of those entities, they will all be unavailable and with a "restored: true" attribute.

When you re-enable the account, after it is able to retrieve the list of Circles & Members, the entities should be fully created again. But if it runs into the same problem (too many error 403), it will just disable the account and and recreate the repair issue.

Do you have the ability to edit files in config/custom_components? If so, it should be very easy to change it so it delays between retries and retries more often before giving up. I would really appreciate if you could give it a try. It's not working for you as it is, so what do you have to lose?

Menz01 commented 1 week ago

so i re-enabled the account (missed that, thank you) and i have restarted i even waited a few hours and went driving around, but all my entities still shows as disabled and i can't re-enable them

pnbruckner commented 1 week ago

What errors or warnings do you see in the system log? It should at least say something about retrieving Circles & Members.

petebanham commented 6 days ago

Mine seems to have broken over night as well. I have a repair issue showing and the account is disabled. If I enable it, it just disables again straight away and there is nothing in the system log from Life 360

rleongcs commented 6 days ago

Mine was also broken and I have to remove the disabled account and re-add the account for it to work again. Not sure if it will be disabled again or not. I am using username and password rather than token.

Menz01 commented 6 days ago

What errors or warnings do you see in the system log? It should at least say something about retrieving Circles & Members.

i looked in the logs and its telling me with a warning that it has retrieved all circles and members but still all my members are missing

i deleted my member entities thinking they needed to be deleted since they were all disabled and none have returned. i even deleted the integration and re-added it back and they are still missing

andrewcliffoutlook commented 6 days ago

Hi Phil

I have just upgraded to HA 2024.6.4 and Life360 won't initialise. It could well be that a change made with this version is incompatible with your implementation.

Kind regards

Andrew Cliff

Sent from my phone

On 21 Jun 2024, at 19:53, Phil Bruckner @.***> wrote:



What errors or warnings do you see in the system log? It should at least say something about retrieving Circles & Members.

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2183288486, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IO4NHVR5HQQPID7WT3LZIRZBPAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTGI4DQNBYGY. You are receiving this because you were mentioned.Message ID: @.***>

andrewcliffoutlook commented 6 days ago

Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 20:42:16 (1 occurrences) Last logged: 20:42:16

Error setting up entry Life360 for life360 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/life360/init.py", line 123, in async_setup_entry await async_process_data() File "/config/custom_components/life360/init.py", line 104, in async_process_data await asyncio.gather(*coros) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 277, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/life360/coordinator.py", line 707, in _async_update_data raw_member_data = await self._coordinator.get_raw_member_data(self._mid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/life360/coordinator.py", line 170, in get_raw_member_data raw_member_list = await asyncio.gather( ^^^^^^^^^^^^^^^^^^^^^ asyncio.exceptions.CancelledError

Logs for initialisation error.

Kind regards

Andrew Cliff

Sent from my phone

On 22 Jun 2024, at 20:43, Andrew Cliff @.***> wrote:

 Hi Phil

I have just upgraded to HA 2024.6.4 and Life360 won't initialise. It could well be that a change made with this version is incompatible with your implementation.

Kind regards

Andrew Cliff

Sent from my phone

On 21 Jun 2024, at 19:53, Phil Bruckner @.***> wrote:



What errors or warnings do you see in the system log? It should at least say something about retrieving Circles & Members.

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2183288486, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IO4NHVR5HQQPID7WT3LZIRZBPAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTGI4DQNBYGY. You are receiving this because you were mentioned.Message ID: @.***>

NateRobinsonS commented 5 days ago

I can confirm that delay = 30 seems to work for me. I didn't need to change anything else.

pnbruckner commented 4 days ago

I have just upgraded to HA 2024.6.4 and Life360 won't initialise. It could well be that a change made with this version is incompatible with your implementation.

I tested with that version and it's not a problem for me. I think the exception you're seeing (thanks for posting from the log!) is an indirect result of the basic problem of some people seeing error 403 while fetching Member data (while most don't.)

I'll be posting a beta soon that increases the delay (in this scenario) from zero to ten seconds, and bumps the maximum retry count from 2 to 30, which should allow the integration to handle these error 403's, assuming the server responds with data instead of the error within 5 minutes. It also tries to fix the improperly handled exception (although it's hard for me to verify these fixes since I don't see these errors.)

pnbruckner commented 4 days ago

Everyone who has experienced this problem, please try the 0.5.3b0 beta release and let me know if it helps.

petebanham commented 4 days ago

Unfortunately still the same for me, the account shows as disabled. Let's me toggle it to enabled but doesn't stay enabled. I haven't removed and readded the integration or account if either of those are needed ?

Menz01 commented 4 days ago

Everyone who has experienced this problem, please try the 0.5.3b0 beta release and let me know if it helps.

just tried it as well. entities still not updating. i did take a screenshot of the log book

image

pnbruckner commented 4 days ago

@Menz01 I see you are getting error 401, not 403. So far, everyone has said (or implied) the problem is error 403, although when I ask for these details, unfortunately, people don't always provide them, which makes it difficult to get to the root of the problem.

The changes in 0.5.3b0 only attempt to handle error 403 better, not error 401.

Error 401 is "unauthorized", which is another type of "login" error. I don't think retrying will solve error 401. The only thing I can suggest is to update the account credentials. Are you using username & password? Or are you using a browser to capture the access token?

Menz01 commented 4 days ago

i am using the token and it accepts the token without error. i even deleted the integration and re-added it and it accepted the same token

petebanham commented 4 days ago

Unfortunately still the same for me, the account shows as disabled. Let's me toggle it to enabled but doesn't stay enabled. I haven't removed and readded the integration or account if either of those are needed ?

So I just tried removing the account and immediately re adding it and after an initial failed to retrieve circle.... error in the logs, the entries are all back. Thanks for your on going work with this

pnbruckner commented 4 days ago

@Menz01 it accepts the token without trying to test if it works. I did have some code in before that tried to test the token at that point, but it didn't really work very well (mainly, I think, due to the error 403 issue), so I removed it. So, being able to enter the token does not mean it will actually work.

There was a report above that logging out in the web browser used to obtain the token can lead to problems. Try grabbing a new access token, but after getting the token (and copying it into HA), do NOT log out in the browser you used to get the token. Just close that browser.

pnbruckner commented 4 days ago

So I just tried removing the account and immediately re adding it and after an initial failed to retrieve circle.... error in the logs, the entries are all back. Thanks for your on going work with this

I'm glad it's working again for you, but honestly, this doesn't make sense. You shouldn't have to remove the account from the integration and add it back in. Just enabling it should work. And please remember, the message in the log about not being able to retrieve the Circles & Members fully is a warning, not an error. It retries in the "background" until it's successful, at which time the entities should come fully back, too. Unless, of course, there are other actual errors that prevent that from happening.

Menz01 commented 4 days ago

@Menz01 it accepts the token without trying to test if it works. I did have some code in before that tried to test the token at that point, but it didn't really work very well (mainly, I think, due to the error 403 issue), so I removed it. So, being able to enter the token does not mean it will actually work.

There was a report above that logging out in the web browser used to obtain the token can lead to problems. Try grabbing a new access token, but after getting the token (and copying it into HA), do NOT log out in the browser you used to get the token. Just close that browser.

so i got a new token and its working again. however, maybe its just me but that token is very hard to find and it took me 3 browsers to find it. following the guides i could not find any "token" entries when i used firefox and chrome. however when i followed the same procedures in edge, i found two token entries and one had the token and it was different from the one i previously had. not sure why i could not find them in chrome when edge and chrome are almost the same.

pnbruckner commented 3 days ago

@andrewcliffoutlook @rleongcs @NateRobinsonS @petebanham, have any of you tried 0.5.3b0, and if so, any better?

pnbruckner commented 3 days ago

I'm not sure if this is related, but I started getting a similar error, when I logged out of the life360 website. I got a new token and didn't log out this time, and the add-on has stayed connected for a few days now.

@James62370, just curious, when you said, "getting a similar error", did you mean error 401?

petebanham commented 3 days ago

Phil, it worked for me but only after I removed and readded my account.

On Tue, 25 Jun 2024, 20:47 Phil Bruckner, @.***> wrote:

@andrewcliffoutlook https://github.com/andrewcliffoutlook @rleongcs https://github.com/rleongcs @NateRobinsonS https://github.com/NateRobinsonS @petebanham https://github.com/petebanham, have any of you tried 0.5.3b0, and if so, any better?

— Reply to this email directly, view it on GitHub https://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2189845173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCJRRAWKF4Z3P26VKWILZ3ZJHCMFAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHA2DKMJXGM . You are receiving this because you were mentioned.Message ID: @.***>

andrewcliffoutlook commented 3 days ago

Hi Phil

I had previously made similar parameter changes to the code so it provides a similar level of stability. It generally stays active for between 18 and 24 hours and then I need to repair and enable.

[image0.png] Kind regards

Andrew Cliff

Sent from my phone

On 25 Jun 2024, at 20:47, Phil Bruckner @.***> wrote:



@andrewcliffoutlookhttps://github.com/andrewcliffoutlook @rleongcshttps://github.com/rleongcs @NateRobinsonShttps://github.com/NateRobinsonS @petebanhamhttps://github.com/petebanham, have any of you tried 0.5.3b0, and if so, any better?

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2189845173, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IOZRPK2CGJ3OY7UDZADZJHCMHAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHA2DKMJXGM. You are receiving this because you were mentioned.Message ID: @.***>

pnbruckner commented 3 days ago

@petebanham @andrewcliffoutlook et al, it's really important to let me know which error causes the account to get disabled (and a repair issue to be created.) Errors 401 & 403 are handled differently. It seems error 403 can be recovered from by retrying, whereas, as far as I know, error 401 cannot be.

To my knowledge, error 401 can only be resolved by getting a new access token. If you're using username & password, you should not have to delete & re-add the account. Just (re)enabling it will cause a new access token to be automatically fetched. Of course, if you're using the access token type of account, then you have to "manually" get a new access token using Life360's website and the browser's dev tools.

So, I'd really like to know, if/when anyone has problems that don't resolve themselves:

1) Exactly what error did you get (e.g., 401 or 403)? 2) Did you have to get a new access token (either manually, or via disabling/re-enabling the account) to get it working again?

andrewcliffoutlook commented 3 days ago

This error originated from a custom integration.

Logger: custom_components.life360.coordinator Source: custom_components/life360/coordinator.py:546 integration: Life360 (documentation, issues) First occurred: 24 June 2024 at 20:51:19 (3 occurrences) Last logged: 19:21:28 @.***: while getting data for Andrew Cliff from Cliff family Circle: aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://api-cloudfront.life360.com/v3/circles/c6ab40ce-7464-4417-9b70-0c4d95fb052a/members/7bbb0adf-ce85-4750-8f30-6efe03294894'); status: 403

Kind regards

Andrew Cliff

Sent from my phone

On 25 Jun 2024, at 21:37, Phil Bruckner @.***> wrote:



@petebanhamhttps://github.com/petebanham @andrewcliffoutlookhttps://github.com/andrewcliffoutlook et al, it's really important to let me know which error causes the account to get disabled (and a repair issue to be created.) Errors 401 & 403 are handled differently. It seems error 403 can be recovered from by retrying, whereas, as far as I know, error 401 cannot be.

To my knowledge, error 401 can only be resolved by getting a new access token. If you're using username & password, you should not have to delete & re-add the account. Just (re)enabling it will cause a new access token to be automatically fetched. Of course, if you're using the access token type of account, then you have to "manually" get a new access token using Life360's website and the browser's dev tools.

So, I'd really like to know, if/when anyone has problems that don't resolve themselves:

  1. Exactly what error did you get (e.g., 401 or 403)?
  2. Did you have to get a new access token (either manually, or via disabling/re-enabling the account) to get it working again?

— Reply to this email directly, view it on GitHubhttps://github.com/pnbruckner/ha-life360/issues/25#issuecomment-2189923637, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARP7IO7JHCL5VPFFYY3Q4O3ZJHIIDAVCNFSM6AAAAABI3QRDROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHEZDGNRTG4. You are receiving this because you were mentioned.Message ID: @.***>

SkoobyDu commented 3 days ago

Hi,

Thank for your world in this, I'm getting error 403 as others.

I'm using the username and password option.

This error originated from a custom integration.

Logger: custom_components.life360.coordinator Source: custom_components/life360/coordinator.py:542 integration: Life360 (documentation, issues) First occurred: 22:09:32 (2 occurrences) Last logged: 22:47:25

xxxxx.xxxxxx@xxxxxx.xxx: while getting data for xxx xxxxx, from xxx Circle: aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://api-cloudfront.life360.com/v3/circles/REDACTED/members/REDACTED'); status: 403

pnbruckner commented 3 days ago

@SkoobyDu have you tried 0.5.3b0 yet?

petebanham commented 3 days ago

@petebanham @andrewcliffoutlook et al, it's really important to let me know which error causes the account to get disabled (and a repair issue to be created.) Errors 401 & 403 are handled differently. It seems error 403 can be recovered from by retrying, whereas, as far as I know, error 401 cannot be.

To my knowledge, error 401 can only be resolved by getting a new access token. If you're using username & password, you should not have to delete & re-add the account. Just (re)enabling it will cause a new access token to be automatically fetched. Of course, if you're using the access token type of account, then you have to "manually" get a new access token using Life360's website and the browser's dev tools.

So, I'd really like to know, if/when anyone has problems that don't resolve themselves:

  1. Exactly what error did you get (e.g., 401 or 403)?
  2. Did you have to get a new access token (either manually, or via disabling/re-enabling the account) to get it working again?

@pnbruckner mine has been stable since the upgrade and remove/readd of account but if it happens again I will look for the error. Should I be looking anywhere other than the normal system log please as last time I dont think there was anything in there? Thanks for all your work/help.

SkoobyDu commented 3 days ago

@SkoobyDu have you tried 0.5.3b0 yet?

Hi, I've installed the beta after finding this thread and posting my post above, I'll let you know if it happens again.

pnbruckner commented 2 days ago

Should I be looking anywhere other than the normal system log please as last time I dont think there was anything in there?

@petebanham, just the normal system log. Unless I've totally screwed up somewhere, the account won't get disabled (and a repair issue created) without an error showing up in the system log.

If you wouldn't mind, you could also enable debug for the integration. If you have any problems again, DEBUG messages might help explain exactly what's going on.

petebanham commented 2 days ago

@pnbruckner I have turned dedug on for the integration on in case it happens again. Re the main log, it may be that i restarted HA before checking it, I cant remember, but the UI only then shows stuff since the restart, next time will def check 1st!

pnbruckner commented 2 days ago

Re the main log, it may be that i restarted HA before checking it, I cant remember, but the UI only then shows stuff since the restart, next time will def check 1st!

Yep, that's true. But, if you have direct access to files in the config directory, there should be a file named home-assistant.log.1, which is the entire log from the previous run (i.e., before restarting.)