ZoneMinder filters not working in v1.18.1 ?

Support and queries relating to all previous versions of ZoneMinder
Locked
jpboggis
Posts: 4
Joined: Wed Mar 03, 2004 3:38 pm

ZoneMinder filters not working in v1.18.1 ?

Post by jpboggis »

I've recently installed ZoneMinder v1.18.1 on a GNU/Debian Linux 'stable' (Woody) box with a Logitech Quickcam Pro 4000 webcam connected.

Everything is working fine, except that most of the filter rules will not work (They work fine on another Debian box running 'testing' (Sarge) and ZoneMinder 1.17.2 with two webcams.)

For example, if I apply the following filter:

Time greater than 9:00

...It returns a blank page. Viewing the source reveals the following error:

You have an error in your SQL syntax near '2004-03-03 09:00:00' )') )' at line 1

The 'date' and 'weekday' filters also appear to be broken, but the 'date/time' filter still seems to be working OK, e.g:

Date/Time greater than 03/02 9:00

...Returns the expected results.
enrico1301
Posts: 11
Joined: Thu Mar 04, 2004 9:35 pm

Re: ZoneMinder filters not working in v1.18.1 ?

Post by enrico1301 »

I have the same problem on a GNU/Debian Linux 'stable' (Woody) box

Enrico
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZoneMinder filters not working in v1.18.1 ?

Post by zoneminder »

Hmm, ok. I will suggest some debug that can be put into that file to figure out what the problem is shortly. In the meantime if you go into mysql interactively and do a

select * from Filters

what do you get?

Phil,
jpboggis
Posts: 4
Joined: Wed Mar 03, 2004 3:38 pm

Re: ZoneMinder filters not working in v1.18.1 ?

Post by jpboggis »

I get the following when I run the query 'select * from Filters;' -

mysql> select * from Filters;
+----+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+------------+------------+-----------+-------------+
| Id | Name | Query | AutoArchive | AutoDelete | AutoUpload | AutoEmail | AutoMessage |
+----+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+------------+------------+-----------+-------------+
| 1 | Delete old events | trms=1&obr1=&cbr1=&attr1=Date&op1=<&val1=-30 days | 0 | 1 | 0 | 0 | 0 |
| 2 | Out of hours | trms=4&obr1=&cbr1=&attr1=Time&op1=<&val1=8:00&cnj2=or&obr2=&cbr2=&attr2=Time&op2=>=&val2=17:00&cnj3=or&obr3=&cbr3=&attr3=Weekday&op3==&val3=Sat&cnj4=or&obr4=&cbr4=&attr4=Weekday&op4==&val4=Sun | 0 | 0 | 0 | 0 | 0 |
| 3 | Weekend | trms=2&obr1=&cbr1=&attr1=Weekday&op1==&val1=Sat&cnj2=or&obr2=&cbr2=&attr2=Weekday&op2==&val2=Sun | 0 | 0 | 0 | 0 | 0 |
| 4 | Working day | trms=4&obr1=&cbr1=&attr1=Time&op1=>=&val1=8:00&cnj2=and&obr2=&cbr2=&attr2=Time&op2=<=&val2=17:00&cnj3=and&obr3=&cbr3=&attr3=DateTime&op3=!=&val3=Sat&cnj4=and&obr4=&cbr4=&attr4=DateTime&op4=!=&val4=Sun | 0 | 0 | 0 | 0 | 0 |
| 5 | Working day | trms=4&obr1=&cbr1=&attr1=Time&op1=>=&val1=8:00&cnj2=and&obr2=&cbr2=&attr2=Time&op2=<=&val2=17:00&cnj3=and&obr3=&cbr3=&attr3=Weekday&op3=!=&val3=Sat&cnj4=and&obr4=&cbr4=&attr4=Weekday&op4=!=&val4=Sun | 0 | 0 | 0 | 0 | 0 |
| 6 | Working day | trms=4&obr1=&cbr1=&attr1=Time&op1=>=&val1=8:00&cnj2=and&obr2=&cbr2=&attr2=Time&op2=<=&val2=17:00&cnj3=and&obr3=&cbr3=&attr3=Weekday&op3=!=&val3=Sat&cnj4=and&obr4=&cbr4=&attr4=Weekday&op4=!=&val4=Sun | 0 | 0 | 0 | 0 | 0 |
| 7 | Delete old events | trms=1&obr1=&cbr1=&attr1=DateTime&op1=<&val1=-30 days | 0 | 1 | 0 | 0 | 0 |
+----+-------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------+------------+------------+-----------+-------------+
7 rows in set (0.01 sec)


I'm not sure why the 'Working day' filter is listed 3 times and the 'Delete old events' is listed twice - These only shows up once in the drop-down list in the ZM filter window.

Creating filters manually using the Date, Time or Weekday options also do not work. The Date/Time filter works fine though.

The same events are also setup on my v1.17.2 system running two webcams under Debian 'testing' (Sarge) and these work without any problems.

I also get the following in zmfilter.log:

Scanning for events since id -1 DBD::mysql::st execute failed: You have an error in your SQL syntax near '2004-02-04 11:21:01' )' ) order by E.Id' at line 1 at /usr/local/bin/zmfilter.pl line 407.
Can't execute: You have an error in your SQL syntax near '2004-02-04 11:21:01' )' ) order by E.Id' at line 1 at /usr/local/bin/zmfilter.pl line 407.
User avatar
rdmelin
Posts: 863
Joined: Wed Oct 29, 2003 2:23 pm
Location: Ellensburg, WA USA

Re: ZoneMinder filters not working in v1.18.1 ?

Post by rdmelin »

Hi Jonathan,
Did you edit your filters and save them with the same name? I am experiencing the same thing. Check this post:

http://www.zoneminder.com/forum_general ... 814fe8dec0

Anyone else?

Regards,
Ross
jpboggis
Posts: 4
Joined: Wed Mar 03, 2004 3:38 pm

Re: ZoneMinder filters not working in v1.18.1 ?

Post by jpboggis »

I edited and re-saved a couple of the saved filters in my attempts to get the filters working.

However, I had the filter problems before doing this (Date, Time and Weekday rules don't seem to be working - These generate MySQL errors as above.)

I've now manually removed the duplicate entries from the Filters table, but with the exception of 'Delete old events' (Date/Time based rules seem to work OK), none of the saved filters work due to the MySQL syntax errors.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZoneMinder filters not working in v1.18.1 ?

Post by zoneminder »

One reason you may have multiple filters is that previously filters were keyed by name and monitor id. However the association with monitor was removed recently so if you had a filter called 'Filter' for monitor 1 and another filter called 'Filter' for monitor 2 etc they would not have conflicted. However since a monitor association is now just another filter terms they will all have expanded into the same namespace.

If it's not that then it's a bug which I will have to have a look at. I'll try and do something with your filters when I get a minute.

Phil,
enrico1301
Posts: 11
Joined: Thu Mar 04, 2004 9:35 pm

Re: ZoneMinder filters not working in v1.18.1 ?

Post by enrico1301 »

Hi all,

mysql> select * from Filters;
+----+----------+--------------------------------------------------+-------------+------------+------------+-----------+-------------+
| Id | Name | Query | AutoArchive | AutoDelete | AutoUpload | AutoEmail | AutoMessage |
+----+----------+--------------------------------------------------+-------------+------------+------------+-----------+-------------+
| 1 | Delete_3 | trms=1&obr1=&cbr1=&attr1=Time&op1=<=&val1=-3 day | 0 | 1 | 0 | 0 | 0 |
+----+----------+--------------------------------------------------+-------------+------------+------------+-----------+-------------+
1 row in set (0.00 sec)

and when submit the filter :

You have an error in your SQL syntax near '2004-03-02 18:22:38' )' )' at line 1

Enrico
jpboggis
Posts: 4
Joined: Wed Mar 03, 2004 3:38 pm

Re: ZoneMinder filters not working in v1.18.1 ?

Post by jpboggis »

This machine is a new install rather than an upgrade from a previous version (Only 1 webcam connected), so I think it's a bug when editing a filter and then re-saving it with the same name (There's another thread on this board about this problem.)

Thanks in advance for looking into the filter problem.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Re: ZoneMinder filters not working in v1.18.1 ?

Post by zoneminder »

I've found a problem which I'll fix in either a patch or the next release if I can get it out quick enough.

Enrico, your filter is probably wrong however as 'Time' is used for time of day so effectively your filter will match any events that have occurred on any day but before the current time. This is because it will find a date/time of -3 days, so for instance that would be March 2nd 18:45 and look for any events with a time component less than that, ie any events that happened before 18:45 on any day. If you want both date and time included use date/time and not time. The added benefit is that that isn't broken so should actually work!

Phil,
enrico1301
Posts: 11
Joined: Thu Mar 04, 2004 9:35 pm

Re: ZoneMinder filters not working in v1.18.1 ?

Post by enrico1301 »

thank you Phil
Locked