SecuritySpy Plugin Run Away

Posted on
Mon Sep 02, 2013 3:04 pm
GRWilde offline
User avatar
Posts: 173
Joined: Nov 15, 2005
Location: Los Angeles

SecuritySpy Plugin Run Away

I am using the Cynical SecuritySpy Plugin 1.4.2 with Indigo 6.0.1. SecuritySpy 3.1.1 is managing two cameras. Normally the plugin works fine with Indigo, but every day or two the plugin seems to run away, consuming large amounts of cpu resources on my Mac Mini Server. The activity monitor indicates that Indigo and the Indigo plugin handler are consuming almost all of the Mac Mini's resources. Reloading the Cynical SecuritySpy Plugin solves the problem, reducing Indigo cpu usage to a very reasonable level. When I reload the Cynical SecuritySpy Plugin, the Indigo logs usually report that Indigo could not quit the plugin normally, and had to force quit it. After force quitting, the plugin does start up normally with both cameras being reported properly.

I have created an Indigo Action Group to restart the Cynical SecuritySpy plugin, but periodically restarting the plugin is not a very satisfactory long term solution. Any ideas?

George Wilde

Posted on
Mon Sep 02, 2013 5:36 pm
kw123 offline
User avatar
Posts: 8392
Joined: May 12, 2013
Location: Dallas, TX

Re: SecuritySpy Plugin Run Away

I have been using one applescript per camera in Security spy (under camera settings/ action .. the compiled script (.app) goes into .. documents/securityspy/scripts)
The script sets a variable in indigo. That then triggers actions in indigo. Very simple and very reliable and good enough for what I need.

Code: Select all
--this camera is setup in front of  rat trap.
-- in principle you only need to change one variable and trigger on change, but if you want to reset after action is done .. its good to have an on/off  --time stamp is for the night to check if there were more than one trigger.

set theTime to (current date) as text

tell application "IndigoServer"
   set timeStamp to get (value of variable "ratAlarmTime") as text
   set timeStamp to timeStamp & ",  " & theTime as text -- append time stamp to variable
   set value of variable "ratAlarm" to "true"
   set value of variable "ratAlarmTime" to timeStamp
end tell

return true

Posted on
Mon Sep 09, 2013 10:43 pm
Perry The Cynic offline
Posts: 840
Joined: Apr 07, 2008

Re: SecuritySpy Plugin Run Away

Try version 1.6.1. It doesn't contain anything specifically dealing with this run-away syndrome (that I can't reproduce), but it has a bunch of other internal updates, so there's a bit of hope...

Let me know if it makes a difference (either way :-)).

Cheers
-- perry

Posted on
Sat Sep 28, 2013 8:46 am
rjs104 offline
Posts: 55
Joined: Jun 21, 2013

Re: SecuritySpy Plugin Run Away

Hi Perry,

Just to say that I've been having this memory leak problem as well - within 24 hours I have an "IndigoPluginHost" using 1.85Gb of memory.

This happened with a previous version of the Cynical SecuritySpy. I took the opportunity to upgrade to 1.6.1 as in your post, and I'm afraid to report it still does it.

Any help you can offer gratefully received!

Best wishes,

Richard.

Posted on
Sat Sep 28, 2013 10:45 am
Korey offline
User avatar
Posts: 816
Joined: Jun 04, 2008
Location: Henderson, NV

Re: SecuritySpy Plugin Run Away

I've also run in to this problem occasionally (Pegging CPU and Memory)

It seemed to happen once I added a third camera to Security Spy, I never had an issue before that.

KIlling it via indigopluginhost in activity monitor fixes it for awhile (Days / Weeks?)

Plugin 1.6.1
Indigo 3.0.2
SS 3.1.1

--
Korey

Posted on
Sat Sep 28, 2013 11:12 am
Perry The Cynic offline
Posts: 840
Joined: Apr 07, 2008

Re: SecuritySpy Plugin Run Away

A free copy of all my plugins to whoever can show me how to reproduce this problem. :-) Seriously: I'm running six cameras in my house, and have never seen this problem. And my server stays up for weeks...

Seriously, I have no clue what's happening there. The guts of the plugin runtime have had major changes since the Indigo 5/version 1.1 days, so I can't just "go back" and forget about it. As far as I can tell, only the SecuritySpy plugin is affected. (The cyin runtime runs in all my plugins. The only thing special about this plugin is that it keeps a permanent network connection to SecuritySpy.)

I'll be taking a stab at putting pre-emptive cleansing code into the plugin to combat this - restarting network connections ever so often, checking for bloat and logging messages; that kind of stuff. I hate doing this blind stuff, but I'm running out of ideas.

Those of you seeing this - how often does it happen? Hourly, daily, weekly? How do you currently work around it? Is there anything you know will make it happen faster?

Cheers
-- perry

Posted on
Sat Sep 28, 2013 11:58 am
rjs104 offline
Posts: 55
Joined: Jun 21, 2013

Re: SecuritySpy Plugin Run Away

Hi Perry,

and thanks for your swift response!

I could be a useful test bed, because this fault happens reliably everytime I enable the plugin. If I come back in about a day, it will have ramped up to using 1.8Gb. I have iStats running on my server, and you can see a lovely graph of the memory "fading up' over time ;)

Picking up on what someone else said, I do have 3 cameras. I could try disabling one to see if that has any effect as a starting point?

Cheers,

R.

Posted on
Sat Sep 28, 2013 5:21 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: SecuritySpy Plugin Run Away

Perry The Cynic wrote:
A free copy of all my plugins to whoever can show me how to reproduce this problem. :-) Seriously: I'm running six cameras in my house, and have never seen this problem. And my server stays up for weeks...

Seriously, I have no clue what's happening there. The guts of the plugin runtime have had major changes since the Indigo 5/version 1.1 days, so I can't just "go back" and forget about it. As far as I can tell, only the SecuritySpy plugin is affected. (The cyin runtime runs in all my plugins. The only thing special about this plugin is that it keeps a permanent network connection to SecuritySpy.)

I'll be taking a stab at putting pre-emptive cleansing code into the plugin to combat this - restarting network connections ever so often, checking for bloat and logging messages; that kind of stuff. I hate doing this blind stuff, but I'm running out of ideas.

Those of you seeing this - how often does it happen? Hourly, daily, weekly? How do you currently work around it? Is there anything you know will make it happen faster?

Cheers
-- perry


I've seen the problem daily. I have sort of given up on security spy as a plugin and gave in and put a motion sensor in my daughter's nursery instead of trying to use the camera as a motion sensor. Would love to not have to do that, I have some other areas where I'd like to put a motion sensor, but I don't have time to babysit the server. I've tried triggering it manually, but nothing seems to do it. FWIW, I have a trigger for motion in indigo and it seems to run the trigger over and over and over again... the odd part is, that I have a condition on the trigger so it doesn't fire over and over again and can only TECHNICALLY fire again after 5 minutes of NO motion. Hope that helps.

Posted on
Sun Sep 29, 2013 3:13 pm
Bollar offline
Posts: 528
Joined: Aug 11, 2013

Re: SecuritySpy Plugin Run Away

FWIW, I have seen this once myself. I think I renamed a camera in SS right before it happened. Can't repro, of course.

Insteon / Z-Wave / Bryant Evolution Connex /Tesla / Roomba / Elk M1 / SiteSage / Enphase Enlighten / NOAA Alerts

Posted on
Mon Sep 30, 2013 9:10 pm
Perry The Cynic offline
Posts: 840
Joined: Apr 07, 2008

Re: SecuritySpy Plugin Run Away

Those of you who can reproduce this problem (if only daily :-)), there's one thing you can do to help: In the Debug modules field of the plugin, enter asyn.scan,spy.core, then reload the plugin and reproduce the problem. This might tell me something useful. (Or it might not. Sigh...) Note that this will produce a bunch of output, particularly on reload. Send it all. (You can just email it to me: indigo@cynic.org.) The output won't contain any passwords, though it will tell me pretty much everything about your cameras. :-)

Thanks
-- perry

Posted on
Wed Oct 16, 2013 12:29 pm
hensed offline
Posts: 61
Joined: Feb 01, 2012
Location: Oakland, CA

Re: SecuritySpy Plugin Run Away

GRWilde wrote:
I have created an Indigo Action Group to restart the Cynical SecuritySpy plugin...



How did you do this? I would like to reload plugins automatically but did not see an action that did this.

Posted on
Wed Oct 16, 2013 1:57 pm
GRWilde offline
User avatar
Posts: 173
Joined: Nov 15, 2005
Location: Los Angeles

Re: SecuritySpy Plugin Run Away

Just set the Action Group to execute an embedded Python Script like the following:

Code: Select all
pluginId = "org.cynic.indigo.securityspy"
plugin = indigo.server.getPlugin(pluginId)
if plugin.isEnabled():
   plugin.restart()

George Wilde

Posted on
Wed Oct 16, 2013 3:00 pm
hensed offline
Posts: 61
Joined: Feb 01, 2012
Location: Oakland, CA

Re: SecuritySpy Plugin Run Away

GRWilde wrote:
Just set the Action Group to execute an embedded Python Script like the following:

pluginId = "org.cynic.indigo.securityspy"
plugin = indigo.server.getPlugin(pluginId)
if plugin.isEnabled():
plugin.restart()



That worked great! Thanks!

Posted on
Wed Dec 18, 2013 10:08 am
CharlieParker offline
Posts: 241
Joined: Apr 10, 2006
Location: Lower Hudson Valley

Re: SecuritySpy Plugin Run Away

I've been seeing this using plugin 1.6.1, Indigo 6.0.7 and SS 3.2.1. Only happened since I upgraded (all at once) from 1.1 (max), 6.0.1 and 2.x.

I also see
2013-12-17 00:29:58 Cynical SecuritySpy Error Security Spy unavailable: [Errno 32] Broken pipe

Posted on
Wed Dec 18, 2013 11:35 am
Perry The Cynic offline
Posts: 840
Joined: Apr 07, 2008

Re: SecuritySpy Plugin Run Away

2013-12-17 00:29:58 Cynical SecuritySpy Error Security Spy unavailable: [Errno 32] Broken pipe

That's the plugin telling you that its network connection to SecuritySpy has broken. The run-away thing happens when SecuritySpy gets into some kind of trouble and its event-reporting pipe to the plugin becomes troubled and bursty. Eventually it (usually) breaks altogether, but by that time you've already experienced the plugin memory bloat that this triggers.

And that's all we know, so far. See earlier in this thread for instructions on how to collect more information, if you're willing.

(As far as I can tell, all reports of run-away plugins are associated with error reports from SecuritySpy, usually about trouble connecting to network cameras. It's possible that the common factor is actually network problems in your network. But I don't know that for sure.)

Cheers
-- perry

Who is online

Users browsing this forum: No registered users and 1 guest