Page 1 of 1

zmfilter SQL failed

Posted: Thu Mar 03, 2022 5:30 pm
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.

Re: zmfilter SQL failed

Posted: Fri Mar 04, 2022 11:10 am
by Magic919
Stating the bleeding obvious, the DB can't keep up.

Re: zmfilter SQL failed

Posted: Mon Mar 07, 2022 3:46 pm
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.

Re: zmfilter SQL failed

Posted: Mon Mar 07, 2022 4:31 pm
by Magic919
That's good. Well deduced.