zmfilter SQL failed

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
bspiegel
Posts: 20
Joined: Wed Oct 22, 2014 7:54 pm

zmfilter SQL failed

Post by bspiegel »

Upon an event, I start a bash script that sends an email, voices a message via Amazon Echo and sets the IPCAM to None. I use REST API to make the IPCAM change. The syntax works fine when I run it independently or manually start the script under user www-data. It does not seem to work when ZM starts it. It does all the tasks except turn off the IPCAM.

I get this error:

Code: Select all

Mar  3 09:16:28 server2 zmfilter_15[1395795]: ERR [SQL failed: (UPDATE `Events` SET `Archived` = 0,`AvgScore` = 1,`Scheme` = Medium,`DefaultVideo` = ,`Orientation` = ROTATE_0,`Name` = Event-2072,`Width` = 352,`DiskSpace` = 8005606,`Uploaded` = 0,`MonitorId` = 4,`Cause` = Mailbox,`Executed` = 0,`AlarmFrames` = 37,`StorageId` = 0,`Length` = 20.63,`Frames` = 63,`Notes` = Mailbox: ,`StartDateTime` = 2022-03-03 09:14:41,`Height` = 288,`SaveJPEGs` = 1,`SecondaryStorageId` = 0,`Videoed` = 0,`TotScore` = 37,`EndDateTime` = 2022-03-03 09:15:01,`Messaged` = 0,`StateId` = 1,`MaxScore` = 1,`Emailed` = 0 WHERE `Id`= 2072):Lock wait timeout exceeded; try restarting transaction]
Mar  3 09:17:49 server2 zmtrigger[1396045]: ERR [Shared data not valid for monitor 4]
Appreciate any guidance. If more info is needed, let me know.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zmfilter SQL failed

Post by Magic919 »

Stating the bleeding obvious, the DB can't keep up.
-
bspiegel
Posts: 20
Joined: Wed Oct 22, 2014 7:54 pm

Re: zmfilter SQL failed

Post by bspiegel »

I think I've solved the problem.

The script gets the status of the camera (using curl and REST API) before changing the setting. I believe the first curl command was hanging which might have kept the record locked. I added to the curl commands "-m 2" which sets a time-limit of 2 sec. My test shows this now works.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zmfilter SQL failed

Post by Magic919 »

That's good. Well deduced.
-
Post Reply