Events in DB but not on Disk

Forum for questions and support relating to the 1.30.x releases only.
Locked
ranciso
Posts: 20
Joined: Wed Apr 19, 2017 3:19 pm

Events in DB but not on Disk

Post by ranciso »

We are running into an issue where many events including recent events that have written to the DB but cannot be found on the disk. Looking in the events directory for the monitor seems to confirm this. Attempting to view through the browser console results in the standard broken image link.

Not sure what could be causing this and I'm hoping to get some help. Below are the system setup details:

Running Zoneminder 1.30.4. Using 150 IP cameras / ffmepg / modect / 4fps / with zones.

Had opt_fast_delete on (switched it off to troubleshoot issue)

Additionally audit_min_age is set to: 2592000

run_audit is checked and interval is 3600.

I also have a purge filter which is set to delete events older than 30days.
ranciso
Posts: 20
Joined: Wed Apr 19, 2017 3:19 pm

Re: Events in DB but not on Disk

Post by ranciso »

A little more information on this. We had footage archived just a couple of days ago. After attempting to replay the footage we receive the image broken link in the web console. All DB data related to the footage is listed however the footage is gone.
rockedge
Posts: 1174
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Events in DB but not on Disk

Post by rockedge »

this sounds like the zmaudit.pl has gone awry.
bbunge
Posts: 2935
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Events in DB but not on Disk

Post by bbunge »

Might be an issue with the database. Suggest run mysqltuner to see what it recommends. With a lot of cameras connections may need to be 500 or greater (I run 1000 for 17 cameras and half dozen PC'c viewing montage)
ranciso
Posts: 20
Joined: Wed Apr 19, 2017 3:19 pm

Re: Events in DB but not on Disk

Post by ranciso »

max connections is currently set to 1000. You think that might need to be higher?
bbunge
Posts: 2935
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Events in DB but not on Disk

Post by bbunge »

ranciso wrote: Wed Jan 24, 2018 8:48 pm max connections is currently set to 1000. You think that might need to be higher?
Well, run mysqltuner to see. If you really have 150 cameras you will need to push other mysql settings up as well. My system with 17 cameras gets aboit 60k events i. 30 days. Need to have innodb_buffer_pool_size set to 1G to work well. Do not remember other settings that have been changed but mysqtuner will tell you...
ranciso
Posts: 20
Joined: Wed Apr 19, 2017 3:19 pm

Re: Events in DB but not on Disk

Post by ranciso »

Made suggested adjustments from mysqltunner.

We total 813928 events in 30 days. Any idea why zmaudit (i assume it's zmaudit) would delete disk items even though the still exist in the DB, including archived items which are specifically set to not be deleted.
User avatar
iconnor
Posts: 2916
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Events in DB but not on Disk

Post by iconnor »

There is no reason for zmaudit to delete the disk items. It would have deleted the database event too.

I suspect that the images are not being created in the first place.
ranciso
Posts: 20
Joined: Wed Apr 19, 2017 3:19 pm

Re: Events in DB but not on Disk

Post by ranciso »

I'm not sure I agree with that. There was an event that was archived, viewed and downloaded to the users computer. Coming back to the archived event in zm just few hours later and the data is gone while the DB information is still intact.
rockedge
Posts: 1174
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Events in DB but not on Disk

Post by rockedge »

There is no reason for zmaudit to delete the disk items. It would have deleted the database event too.
yes it can, I have experienced this happening! But it was not zmaudit.pl that did this ....it was the Filters and something was causing /usr/share/zoneminder/www/skins/classic/views/filter.php and /usr/share/zoneminder/www/skins/classic/views/filtersave.php to almost immediatley after an event creation just delete it. the actual event data was erased and some of the database info related to these events was gone but some of it was not. I think I started to look into it...

I would suggest looking into what the Filters are doing!
rockedge
Posts: 1174
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Events in DB but not on Disk

Post by rockedge »

looking at my notes the time it took for the events to be deleted by the Purge when full filter varied from almost immediately to up to an hour later. I turned off the filter(s) running in the background and it stopped. I never went any deeper on that install to find a good fix.
Locked