ZM crashes with latest update - ZM_AUDIT_MIN_AGE is missing

Forum for questions and support relating to the 1.28.x releases only.
Locked
Jeremy
Posts: 8
Joined: Fri Feb 27, 2015 11:42 pm

ZM crashes with latest update - ZM_AUDIT_MIN_AGE is missing

Post by Jeremy »

I just updated with apt-get dist-upgrade and my Zoneminder died. I figured out that it was because the config file was missing a value for "ZM_AUDIT_MIN_AGE". It looks like that variable was recently added in code (a5fed0352457aebbee05fcd8f76312410e28d480) but the required value wasn't automatically added to the config files during the update, so everyone's ZM will probably break like mine when they update.


Errors show in the ZM log:
1) Config mismatch, expected 220 items, read 219. Try running 'zmupdate.pl -f' to reload config.
2) ZM_AUDIT_MIN_AGE is not set in config.


How to fix your ZM:
1) Add the following two lines to the bottom of your config file (I think it was /etc/zm.conf):
# The minimum age in seconds event data must be in order to be deleted.
ZM_AUDIT_MIN_AGE = 86400

2) run 'zmupdate.pl -f' to reload config

3) restart ZM service
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: ZM crashes with latest update - ZM_AUDIT_MIN_AGE is miss

Post by knight-of-ni »

This is actually a case of working as intended.

For clarification, you are running a development snapshot of the master branch, rather than a release of zoneminder. This is important to note for others who read this and might not know the difference.

Note that the "config" the error message is referring to, is the Config table in the mysql database. It is not referring to the zoneminder config file on your local filesystem. You should remove the entry you placed into the zoneminder config file. Yes, it seemed to solve your immediate problem, but that will likely cause problems further down the line.

The way to solve this is to stop zoneminder, execute sudo zmupdate.pl -f from the command line, and then start zoneminder back up. Zmupdate -f will search for and add any missing values in the Config table for you. It will also remove any variables we depreciate.

Note that this will happen anytime we create or remove a ZM_ variable.

I have recommended to iconnor that he add "zmupdate -f" to the post installation script of his packages to minimize the chances of seeing this in the future.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Locked