Page 1 of 1

Time Issue & Filters Not Deleting

Posted: Tue Mar 19, 2019 5:25 am
by n8klayko
Hello, I am using the FreeNAS plugin version of ZM on the latest version of FreeNAS 11.2 U2.1 with ZM version 1.32.3 installed. I have a system configured and recording events (h264 passthrough) with only two issues.

1. The first issue is related to the incorrect time being recognized in the logs. Although recorded events and live feeds show the correct time in the event list and on the event recording overlay, the time shown in the log section is off by 4 hours. I am located in the same timezone as New York. My timezone is and has been set correctly in FreeNAS and on my networking gear. I am thinking that this could be an issue with UTC being set somewhere, but I cannot find anywhere to change the timezone. I am not sure but maybe the MySQL instance has the wrong timezone set? Any thoughts on this?
Capture.PNG
Capture.PNG (492.23 KiB) Viewed 18197 times

2. The second issue is related to events not being deleted by filters. I have tried using the built in Purge filter as well as creating my own filters to automatically delete events, but cannot get the events to delete. I know that my filters are set correctly and saved as they do show the correct results when using the "Execute" command or the "List Matches" button. I am not sure if this could be a permission issue or something else. The only other thing is that I am storing events to a different location on the FreeNAS server than in the default location. The added folder is named "ZM-Storage" and should have sufficient permissions for deleting as events are being saved there without issue. I have also tried enabling "OPT_FAST_DELETE" to see if the events would at least be removed from ZM and the database, but this did not work. I am really thinking that this may be a MySQL or database issue. Any thoughts would be greatly appreciated.


I am happy to provide log files, just let me know what logs files I need to export.

Re: Time Issue & Filters Not Deleting

Posted: Tue Mar 19, 2019 5:58 am
by andrew-yu
For the first question - yes, looks like your mysql using UTC time (or maybe only log_timestamps variable set to UTC).

https://stackoverflow.com/questions/930 ... e-of-mysql
https://stackoverflow.com/questions/351 ... e-of-mysql

Re: Time Issue & Filters Not Deleting

Posted: Tue Mar 19, 2019 5:50 pm
by n8klayko
andrew-yu wrote: Tue Mar 19, 2019 5:58 am For the first question - yes, looks like your mysql using UTC time (or maybe only log_timestamps variable set to UTC).

https://stackoverflow.com/questions/930 ... e-of-mysql
https://stackoverflow.com/questions/351 ... e-of-mysql
I logged into MySQL and checked the timezone and current time and it is being reported correctly by MySQL (the time is off by a few minutes, but this is more or less correct). I checked to see if I could change the "log_timestamps" variable, but MySQL reports that this variable doe not exist. Additionally, changing the my.cnf file as the referenced link suggested breaks MySQL.
Capture.PNG
Capture.PNG (53.35 KiB) Viewed 18176 times
I am thinking that there must be another variable or a different way to change this that won't break MySQL or ZM.

Re: Time Issue & Filters Not Deleting

Posted: Tue Mar 19, 2019 7:15 pm
by n8klayko
Regarding the issue with the ZMFilter. Please see the reference error log lines below:
Capture.PNG
Capture.PNG (6.87 KiB) Viewed 18176 times

Also, notice that the time is also off in this error log as well. I am thinking that these could be linking issues.

Re: Time Issue & Filters Not Deleting

Posted: Tue Mar 19, 2019 7:43 pm
by n8klayko
Okay, so I think I figured out the issue for the log times. It looks like the timezone in the "php.ini" needed to be set to match FreeNAS and MySQL.

In the FreeNAS plugin the "php.ini" file is located at "/iocage/jails/zoneminder/root/usr/local/etc/php.ini"

This helped me find the solution for #1:
https://github.com/ZoneMinder/zoneminde ... -449013998


I am still looking into the issue with the filters not working, but could use some help or direction if anyone has any ideas. Please see my above post for more details and a error message related to the issue.

Re: Time Issue & Filters Not Deleting

Posted: Fri Mar 22, 2019 2:41 pm
by n8klayko
Anyone have any thoughts about how to fix the filters not working issue on ZM plugin 1.32.3 on FreeNAS 11.2 U2.1?

Re: Time Issue & Filters Not Deleting

Posted: Thu Apr 11, 2019 1:00 pm
by siconic
I am also having the same issue with files not being purged/deleted off my disk. It is 100% full, and the only way I can clean it up is to manually delete them, which is of course stupid.

Re: Time Issue & Filters Not Deleting

Posted: Tue Jul 02, 2019 6:20 pm
by n8klayko
I'm still having this issue with the plugin. Anyone have any fix ideas?

Re: Time Issue & Filters Not Deleting

Posted: Thu Jul 11, 2019 12:13 am
by icono2
Same here, on Debian, no way to make it work, even with storage area defined on Purge Filter, chmod 777 on every file and folder. Tried everything, just doesn't work!

Re: Time Issue & Filters Not Deleting

Posted: Mon Jul 15, 2019 2:00 pm
by ortelious
n8klayko wrote: Tue Mar 19, 2019 7:15 pm Regarding the issue with the ZMFilter. Please see the reference error log lines below:
Capture.PNG


Also, notice that the time is also off in this error log as well. I am thinking that these could be linking issues.
Just had same issue since fresh install a couple of days ago, every 10mins i would get a alert about zmfilter.pl. I took a look in my apache error log (/var/log/apache2/error.log) and found this:
Can't locate Number/Bytes/Human.pm in @INC (you may need to install the Number::Bytes::Human module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/x86_64-linux-gnu/perl5/5.28 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/ZoneMinder/Event.pm line 39.
Compilation failed in require at /usr/bin/zmfilter.pl line 92.
Fixed it on ubuntu by:-

Code: Select all

sudo apt install libnumber-bytes-human-perl

Re: Time Issue & Filters Not Deleting

Posted: Thu Jul 18, 2019 12:30 am
by icono2
Ortelious, thank you, your answer fixed it immediately.

Re: Time Issue & Filters Not Deleting

Posted: Thu Aug 29, 2019 6:14 pm
by n8klayko
I finally figured out the fix for the filters! I know have the zoneminder plugin working 100%! To fix the filters issue I found that I needed to finish setting up PERL and install MIME. To do this I SSH'd into my zoneminder plugin's jail and ran the following:

Code: Select all

perl -MCPAN -eshell
Accept the defaults and don't install any new bundles for now. Then once the initial config is over just type:

Code: Select all

install MIME::Entity

This will take a while. Agree to any prompts by typing or selecting "Yes".
I came back after 10-20 minutes and it was done. Then just reboot your jail... and everything should be working!!!!


I used the following post for guidance:
viewtopic.php?t=3503

Re: Time Issue & Filters Not Deleting

Posted: Tue Sep 17, 2019 2:06 pm
by pms
ortelious wrote: Mon Jul 15, 2019 2:00 pm Fixed it on ubuntu by:-

Code: Select all

sudo apt install libnumber-bytes-human-perl
Thanks for sharing! "filters not working problem" solved on my Debian by installing this module

Re: Time Issue & Filters Not Deleting

Posted: Mon Jan 11, 2021 11:49 am
by Stasiks
hello,
i have a similar problem ZM filter stopped deleting events, the filter was working and pressing the "show matches" list opened empty.
From the event log /var/log/apache2/error.log
Mon Jan 11 10:42:24.523173 2021] [php7:notice] [pid 190154] [client 192.168.1.100:58238] PHP Notice: Undefined index: op in /usr/share/zoneminder/www/includes/functions.php on line 1294, referer: http: / /xxx.xxx.xx.xx/zm/index.php?view=filter&Id=6&action=&object=filter&filter%5BName%5D=Presse&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bobr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=StorageId&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=1&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bcbr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bcnj%5D=and&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bobr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Battr%5D=Archived&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bval%5D=0&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bcbr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B2%5D%5Bcnj%5D=and&filter%5BQuery%5D%5Bterms%5D%5B2%5D%5Bobr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B2%5D%5Battr%5D=StartWeekday&filter%5BQuery%5D%5Bterms%5D%5B3%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B2%5D%5Bval%5D=0&filter%5BQuery%5D%5Bterms%5D%5B2%5D%5Bcbr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B3%5D%5Bcnj%5D=and&filter%5BQuery%5D%5Bterms%5D%5B3%5D%5Bobr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B3%5D%5Battr%5D=EndWeekday&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B3%5D%5Bval%5D=4&filter%5BQuery%5D%5Bterms%5D%5B3%5D%5Bcbr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Bcnj%5D=and&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Bobr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Battr%5D=StartTime&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Bop%5D=%3E%3D&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Bval%5D=07%3A00%3A00&filter%5BQuery%5D%5Bterms%5D%5B4%5D%5Bcbr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B5%5D%5Bcnj%5D=and&filter%5BQuery%5D%5Bterms%5D%5B5%5D%5Bobr%5D=0&filter%5BQuery%5D%5Bterms%5D%5B5%5D%5Battr%5D=EndTime&filter%5BQuery%5D%5Bterms%5D%5B5%5D%5Bop%5D=%3C%3D&filter%5BQuery%5D%5Bterms%5D%5B5%5D%5Bval%5D=19%3A00%3A00&filter%5BQuery%5D%5Bterms%5D%5B5%5D%5Bcbr%5D=0&filter%5BQuery%5D%5Bsort_field%5D=Name&filter%5BQuery%5D%5Bsort_asc%5D=1&filter%5BQuery%5D%5Blimit%5D=100&filter%5BUpdateDiskSpace%5D=1&filter%5BAutoExecuteCmd%5D=&filter%5BAutoDelete%5D=1&filter%5BAutoCopyTo%5D=&filter%5BAutoMoveTo%5D=&filter%5BBackground%5D=1
System: Linux mint mate 20
I look forward to your help

Re: Time Issue & Filters Not Deleting

Posted: Tue Jan 12, 2021 11:19 am
by Stasiks
Everything is fine, I deleted the filter and made a new one with the same parameters and everything works.
Thank you for your attention.