Page 1 of 1

zmaudit SQL error

Posted: Sun Aug 03, 2014 12:15 pm
by syntrax
I am encountering an error in the execution of the zmaudit script. The screenshot below describes the error sequence in the system log.
zm_audit_error.png
zm_audit_error.png (21.64 KiB) Viewed 33179 times
I am running zoneminder on a VBox virtual machine, ubuntu 14.04, zm version 1.26.5 via the iconnor ppa.
Basic initial setup. Three IP cameras connected. D-Link 932L and 933L.
/var/cache/... bind mounted to separate data disk. No issues.
Capturing appears to work just fine.
Other than a test to verify the working of the bind mount, no recording or motion detection configured. (Recording to the bind mount works just fine.)
No other apparent problems encountered.
Unchecking OPT_FAST_DELETE in the system options tab does not affect the error for the better.

Since the error mentions 'hours' on line 1 in the sql code, is it possible that his error is related to ntp/system time settings?

Please help.

For those who do not get to see the screenshot above, the following is the main line involved:

==begin==
Comment: zmaudit
PID: 24065
Level: FAT
Message: Can't execute: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hours)' at line 1
File: zmaudit.pl
==end==

Thank you.

Re: zmaudit SQL error

Posted: Fri Aug 15, 2014 3:08 pm
by knight-of-ni
While it might be possible to read through the forums and track down all the php related issues with running newer Ubuntu's on zoneminder, the best advice I can give you is to read the note stated on iconnor's PPA under the section at the top labeled "PPA description".

https://launchpad.net/~iconnor/+archive ... zoneminder

Re: zmaudit SQL error

Posted: Wed Feb 24, 2016 3:43 pm
by 6i6i
I had the same error too. It was a configuration problem of zoneminder. zmaudit.pl is deleting log entrys out of the zoneminder internal LOG table. I set the value of the zoneminder option Logging -> LOG_DATABASE_LIMIT from "2 hours" to "2 hour".
This is also specified like this in the help text.

If this does not solve the problem, it is possible that you can find it out if you execute sudo zmaudit.pl at the commandline and see at which line of zmaudit.pl the mysql errror happens.

BR