Life 360 Plugin Locked up

Posted on
Tue Jun 06, 2023 8:21 am
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

Life 360 Plugin Locked up

I've been using the Life 360 plugin for more than a year and it's the perfect solution to my "home/away" situation. Unfortunately it wasn't reporting any home/away status change last week, so I reloaded the plugin and everything was ok. I also added a scheduled reload around 2 AM to clean things up in case something odd happens again.

Possibly unrelated, but his morning I noticed some red in the log and it referenced Life 360. Would you take a look at it and see if I've missed something along the way? Did my internet connection fail? Was there a problem reaching the Life360 server?

When I saw the red in the log I reloaded the plugin and the red error messages immediately stopped and haven't been back in the 15 minutes since reloading. Did the reload fix the issue? Thanks for taking a look--

Jun 6, 2023 at 06:59:45
Life360 Error [Errno Expecting value] <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
</body>
</html>
: 0

Jun 6, 2023 at 07:00:30
Life360 Error [Errno Expecting value] <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
: 0

Jun 6, 2023 at 07:01:05
Life360 Error Error in plugin execution runConcurrentThread:

File "plugin.py", line 99, in runConcurrentThread
File "plugin.py", line 214, in get_new_life360json
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 37, in authenticate
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 26, in make_request
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/models.py", line 917, in json
type: [Errno Expecting value] <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
: 0

Life360 Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Life360 Error Error in plugin execution runConcurrentThread:

File "plugin.py", line 99, in runConcurrentThread
File "plugin.py", line 214, in get_new_life360json
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 37, in authenticate
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 26, in make_request
File "/Library/Application Support/Perceptive Automation/Indigo 2022.2/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/models.py", line 917, in json
type: [Errno Expecting value] <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
: 0

Life360 Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Posted on
Tue Jun 06, 2023 12:09 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

I also got this error in my log today for the first time in months. I'm suspecting something was down with the API gateway.

A reload fixed my issue and I haven't seen it come back. Thanks for the feedback, I'll take a look.

Posted on
Wed Jun 07, 2023 8:27 am
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

Re: Life 360 Plugin Locked up

Thank you for checking—. It doesn’t seem like the plug-in can recover from this error and requires a reload to function. As I mentioned, I do a reload at 2am— that would straighten out any of these strange problems once each day.

Thank you again for a great plug-in.

Posted on
Thu Jun 08, 2023 7:34 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

cjp767 wrote:
Thank you for checking—. It doesn’t seem like the plug-in can recover from this error and requires a reload to function. As I mentioned, I do a reload at 2am— that would straighten out any of these strange problems once each day.

Thank you again for a great plug-in.


I'll look into better error trapping on that error to reduce the admin overhead. Thanks for the feedback.

Posted on
Sat Oct 07, 2023 2:25 pm
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

Re: Life 360 Plugin Locked up

I've been getting this error message fairly often. A quick plugin reload solves the problem-- but "the process fails to quit after polite request." and the reload procedure forces it to quit, reloads, and all is well.

Any suggestions? For now, I just schedule an automatic reload the plugin every few hours-- in case it happens while I am away. Thanks for checking--


Oct 7, 2023 at 13:15:02
Life360 Error Error in plugin execution runConcurrentThread:

File "plugin.py", line 100, in runConcurrentThread
File "plugin.py", line 215, in get_new_life360json
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 39, in authenticate
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 26, in make_request
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/api.py", line 117, in post
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/api.py", line 61, in request
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/sessions.py", line 529, in request
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/sessions.py", line 645, in send
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/adapters.py", line 501, in send
type: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

Life360 Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Oct 7, 2023 at 13:17:53
Reloading plugin "Life360 2022.1.0" using API v3.0
Stopping plugin "Life360 2022.1.0" (pid 69812)

Oct 7, 2023 at 13:18:18
Warning process (pid 69812) failed to quit after polite request -- forcing it to quit now
Stopped plugin "Life360 2022.1.0"
Starting plugin "Life360 2022.1.0" (pid 71007)
Life360
Life360 ==================================================Starting Life360 Plugin Engine==================================================
Life360 Plugin name: Life360
Life360 Plugin version: 2022.1.0
Life360 Plugin ID: com.ryanbuckner.indigoplugin.life360
Life360 Refresh Frequency: 30 seconds
Life360 Indigo version: 2023.1.0
Life360 Python version: 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)]
Life360 Python Directory: /Library/Frameworks/Python.framework/Versions/3.10
Life360 =============================================

Posted on
Sat Oct 07, 2023 7:30 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

That didn't happen to me today, but I have seen it. Sometimes the API goes down and the plugin doesn't handle it well. I may need some veteran tips on how to recover.

Posted on
Sun Oct 08, 2023 2:58 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Life 360 Plugin Locked up

This should point you in the right direction https://www.geeksforgeeks.org/exception-handling-of-python-requests-module/amp/

Basically wrap your api call in a try/except and the skip your updates if the call fails ideally reporting the more detailed error.

Neil

Posted on
Mon Oct 09, 2023 9:01 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

neilk wrote:
This should point you in the right direction https://www.geeksforgeeks.org/exception-handling-of-python-requests-module/amp/

Basically wrap your api call in a try/except and the skip your updates if the call fails ideally reporting the more detailed error.

Neil


I do have exception handling currently but I must be missing one. I'll look into it

Posted on
Mon Oct 09, 2023 9:41 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Life 360 Plugin Locked up

If it's at all reproducible, running the plugin in the "Interactive Shell" mode will sometimes show additional errors in the Terminal window.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Oct 09, 2023 11:41 am
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

I'm not able to reproduce the issue. It seems like when there is a problem with the life360 API, the plugin doesn't handle it well and doesn't recover well.

Posted on
Mon Oct 09, 2023 2:48 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Life 360 Plugin Locked up

It was a quick look and I may have misread but I think the api.authenticate could be the issue as that call doesn’t have the exception handling and it is called just before your main api call.

If the api is down then that itself may fail and I don’t think that failure is caught.

Neil

Posted on
Mon Oct 09, 2023 6:27 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

I saw that too. I patched it and I'm now testing it

Posted on
Wed Oct 11, 2023 6:13 pm
ryanbuckner offline
Posts: 1080
Joined: Oct 08, 2011
Location: Northern Virginia

Re: Life 360 Plugin Locked up

Please try this update to see if the API fails are handled better.

https://github.com/ryanbuckner/life360-plugin/releases/tag/2023.1.0

Posted on
Wed Dec 20, 2023 9:16 am
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

Re: Life 360 Plugin Locked up

I upgraded to the plugin version in the prior post-- and all seemed well for a long time. This morning however, my log was bloody with Life360 Errors. It actually goes on for much longer than this, and repeats every 10 seconds or so. Any suggestions?

Starting plugin "Life360 2023.1.0" (pid 89705)
Life360
Life360 ==================================================Starting Life360 Plugin Engine==================================================
Life360 Plugin name: Life360
Life360 Plugin version: 2023.1.0
Life360 Plugin ID: com.ryanbuckner.indigoplugin.life360
Life360 Refresh Frequency: 30 seconds
Life360 Indigo version: 2023.1.1
Life360 Python version: 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)]
Life360 Python Directory: /Library/Frameworks/Python.framework/Versions/3.10
Life360 ==================================================================================================================================
Started plugin "Life360 2023.1.0"
Life360 Error Error in plugin execution runConcurrentThread:

File "plugin.py", line 110, in runConcurrentThread
File "plugin.py", line 285, in get_new_life360json
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 39, in authenticate
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/Plugins/life360.indigoPlugin/Contents/Server Plugin/life360.py", line 28, in make_request
File "/Library/Application Support/Perceptive Automation/Indigo 2023.1/IndigoPluginHost3.app/Contents/Resources/PlugIns/requests/models.py", line 917, in json
type: [Errno Expecting value] <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" /><![endif]-->
<style>body{margin:0;padding:0}</style>

Posted on
Wed Dec 20, 2023 9:20 am
cjp767 offline
Posts: 136
Joined: May 02, 2013
Location: Gig Harbor, WA

Re: Life 360 Plugin Locked up

And I saw this further down the extensive set of error messages-- Looks like Life360 may have changed something that makes our data request look like an attack on their servers. And I have been blocked.



div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>

<p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
</div>

<div class="cf-column">
<h2 data-translate="blocked_resolve_headline">What can I do to resolve this?</h2>

<p data-translate="blocked_resolve_detail">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>
</div>
</div>

Who is online

Users browsing this forum: No registered users and 2 guests

cron