zmaudit crashes once in a while

Forum for questions and support relating to the 1.30.x releases only.
Locked
raymonvdm
Posts: 23
Joined: Thu Jan 16, 2014 3:01 pm

zmaudit crashes once in a while

Post by raymonvdm »

I`m running several ZoneMinder machines al running Ubuntu 16.04 and ZoneMinder v1.30.4 and once in a while the zoneminder process stops running

I cannot figure out what`s happening, this is some logging of one of the machines

Code: Select all



Dec  6 09:05:16 zm zmaudit[7649]: FAT [Can't execute log entry 'insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )': Lost connection to MySQL server during query]
Dec  6 09:05:16 zm zmdc[7388]: ERR ['zmaudit.pl -c' exited abnormally, exit status 255]
Dec  6 09:05:16 zm zmdc[7388]: FAT [Can't execute log entry 'insert into Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, NULL )': Lost connection to MySQL server during query]
Dec  6 09:05:16 zm systemd[1]: zoneminder.service: Main process exited, code=exited, status=255/n/a
Dec  6 09:05:17 zm sudo:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/bin/true
Dec  6 09:05:17 zm sudo: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Dec  6 09:05:17 zm sudo: pam_unix(sudo:session): session closed for user www-data
Dec  6 09:05:17 zm sudo:     root : TTY=unknown ; PWD=/usr/share/zoneminder/www ; USER=www-data ; COMMAND=/usr/bin/zmdc.pl check
Dec  6 09:05:17 zm sudo: pam_unix(sudo:session): session opened for user www-data by (uid=0)
Dec  6 09:05:18 zm sudo: pam_unix(sudo:session): session closed for user www-data
Dec  6 09:05:18 zm systemd[1]: zoneminder.service: Control process exited, code=exited status=1
Dec  6 09:05:18 zm zmc_m19[7612]: ERR [Select error: Interrupted system call]
Dec  6 09:05:18 zm zmc_m19[7612]: ERR [Unable to read header]
Dec  6 09:05:18 zm zmc_m19[7612]: ERR [Unable to get response, disconnecting]
Dec  6 09:05:18 zm systemd[1]: zoneminder.service: Unit entered failed state.
Dec  6 09:05:18 zm systemd[1]: zoneminder.service: Failed with result 'exit-code'.
Dec  6 09:05:40 zm snmpd[1588]: error on subcontainer 'ia_addr' insert (-1)
Dec  6 09:05:40 zm snmpd[1588]: message repeated 2 times: [ error on subcontainer 'ia_addr' insert (-1)]

The PurgeWhenFull scripts is active and cleaning up on 85% (changed from 75% tot 85% and this maybe triggered the issue?)
bbunge
Posts: 2944
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: zmaudit crashes once in a while

Post by bbunge »

Is your database server on a different machine? First line says lost connection with MySQL... Or is your database server having issues? Is it running out of memory? Suggest running mysqltuner. Possible that you will have to increase innodb_buffer_pool_size
User avatar
iconnor
Posts: 3124
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: zmaudit crashes once in a while

Post by iconnor »

zmaudit goes to sleep and runs all the time. At some time in the night/morning log rotation happens and mysql goes away. I havn't been able to track down a fix. Instead I tend to run zmaudit.pl from cron.
raymonvdm
Posts: 23
Joined: Thu Jan 16, 2014 3:01 pm

Re: zmaudit crashes once in a while

Post by raymonvdm »

- I have disabled OPT_FAST_DELETE (as stated here https://github.com/ZoneMinder/ZoneMinder/issues/1597)
- I have disabled RUN_AUDIT
- I have created the following CRON

Code: Select all


#ZoneMinder
30 14 * * *  /etc/init.d/zoneminder restart
*/30 * * * * /usr/bin/zmaudit.pl

Locked