zmfilter problem

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
User avatar
funix
Posts: 14
Joined: Mon Aug 12, 2024 6:39 pm

zmfilter problem

Post by funix »

Hello,

I have this message for a filter that is not working.

Code: Select all

"04/05/2025 10:17:22 UTC+2",zmfilter_2,2367361,WAR,"No filter found for SELECT * FROM `Filters` WHERE `Id` = ? AND( `AutoArchive` = 1    or `AutoUnarchive` = 1    or `AutoVideo` = 1    or `AutoUpload` = 1    or `AutoEmail` = 1    or `AutoMessage` = 1    or `AutoExecute` = 1    or `AutoDelete` = 1    or `UpdateDiskSpace` = 1    or `AutoMove` = 1    or `AutoCopy` = 1    ) ORDER BY `Name` with values(2)",zmfilter.pl,245
any idea ?
_______________________
Blog https://olivier.hoarau.org
Funix https://www.funix.org
User avatar
burger
Posts: 472
Joined: Mon May 11, 2020 4:32 pm

Re: zmfilter problem

Post by burger »

I'm not familiar with this particular error. You could look at the database.

Refer to https://wiki.zoneminder.com/Filters#Troubleshooting there are some things you can try there.

Maybe post a screenshot of the filter that you are having trouble with.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
funix
Posts: 14
Joined: Mon Aug 12, 2024 6:39 pm

Re: zmfilter problem

Post by funix »

my filter

Image

'list matches" works
_______________________
Blog https://olivier.hoarau.org
Funix https://www.funix.org
User avatar
burger
Posts: 472
Joined: Mon May 11, 2020 4:32 pm

Re: zmfilter problem

Post by burger »

Contains is the proper syntax for the notes field for this SQL. Is that the french translation? Or do you have it set to equal? Equal may not work. I can't tell what the translation is without looking it up... Github is requiring me to sign in to search the code, so that's a fail.

EDIT: Ah I found it. I'm not sure this is the cause of the error but you are using 'ne correspond pas' which refers to the french translation https://github.com/ZoneMinder/ZoneMinde ... /fr_fr.php of 'OpNotMatches' => 'ne correspond pas' In my notes field search filter I use something different. I use: 'OpLike' => 'contains', https://github.com/ZoneMinder/zoneminde ... /en_gb.php which in french is... Well, that looks like an error. OpLike is not there in the french translation. Bug maybe? Yes, looking at this, it appears the french translation has an error.

There are at least three other things I can think of trying.
1) Click the option on the filters page for 'debug'. What does that output?
2) Check the database by logging into mysql and looking at the filters table. There are instructions here: https://wiki.zoneminder.com/MySQL but I'll paraphrase here:

Code: Select all

sudo mysql -u root zm
select * from Filters\G
You may need to scroll to see the entry if you have many filters.
3) Enable debug logging on the filter as described in https://wiki.zoneminder.com/Filters#Log ... r_in_Debug What does that output?
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
funix
Posts: 14
Joined: Mon Aug 12, 2024 6:39 pm

Re: zmfilter problem

Post by funix »

Thank you for taking care of my case

I changed my interface to English, I actually have the choice between "does not contain" and "does not match", but for both "list matches" works very well and I still have the same error in the logs with no possibility to execute the filter

Code: Select all

No filter found for SELECT * FROM `Filters` WHERE `Id` = ? AND( `AutoArchive` = 1 or `AutoUnarchive` = 1 or `AutoVideo` = 1 or `AutoUpload` = 1 or `AutoEmail` = 1 or `AutoMessage` = 1 or `AutoExecute` = 1 or `AutoDelete` = 1 or `UpdateDiskSpace` = 1 or `AutoMove` = 1 or `AutoCopy` = 1 ) ORDER BY `Name` with values(2)
and phpmyadmin gives me

Image

with the command mariadb

Code: Select all

MariaDB [zm]> select * from Filters\G
*************************** 1. row ***************************
             Id: 1
           Name: PurgeWhenFull
         UserId: 1
ExecuteInterval: 60
     Query_json: {"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="},{"cnj":"and","obr":"0","attr":"EndDateTime","op":"IS NOT","val":"NULL","cbr":"0"}],"limit":100,"sort_asc":1}
    AutoArchive: 0
  AutoUnarchive: 0
      AutoVideo: 0
     AutoUpload: 0
      AutoEmail: 0
        EmailTo: 
   EmailSubject: 
      EmailBody: 
    EmailServer: NULL
    EmailFormat: Individual
    AutoMessage: 0
    AutoExecute: 0
 AutoExecuteCmd: 
     AutoDelete: 1
       AutoMove: 0
     AutoMoveTo: 0
       AutoCopy: 0
     AutoCopyTo: 0
UpdateDiskSpace: 0
     Background: 1
     Concurrent: 0
       LockRows: 0
*************************** 2. row ***************************
             Id: 2
           Name: Suppresion-event-sans-detection
         UserId: 1
ExecuteInterval: 60
     Query_json: {"terms":[{"attr":"Notes","op":"NOT LIKE","val":"person"},{"cnj":"and","attr":"EndDateTime","op":"<=","val":"-30 minute"}],"sort_field":"Id","sort_asc":"1","skip_locked":"0","limit":"0"}
    AutoArchive: 0
  AutoUnarchive: 0
      AutoVideo: 0
     AutoUpload: 0
      AutoEmail: 0
        EmailTo: 
   EmailSubject: 
      EmailBody: 
    EmailServer: NULL
    EmailFormat: Individual
    AutoMessage: 0
    AutoExecute: 0
 AutoExecuteCmd: 
     AutoDelete: 0
       AutoMove: 0
     AutoMoveTo: 0
       AutoCopy: 0
     AutoCopyTo: 0
UpdateDiskSpace: 0
     Background: 1
     Concurrent: 0
       LockRows: 0
*************************** 3. row ***************************
             Id: 3
           Name: Envoi-mail-detection
         UserId: 1
ExecuteInterval: 60
     Query_json: {"terms":[{"attr":"Notes","op":"=~","val":"person"},{"cnj":"and","attr":"EndDateTime","op":"<=","val":"-1 minute"}],"sort_field":"StartDateTime","sort_asc":"1","skip_locked":"0","limit":"0"}
    AutoArchive: 0
  AutoUnarchive: 0
      AutoVideo: 0
     AutoUpload: 0
      AutoEmail: 0
        EmailTo: monmail
   EmailSubject: Détection
      EmailBody: Détection
    EmailServer: NULL
    EmailFormat: Individual
    AutoMessage: 1
    AutoExecute: 0
 AutoExecuteCmd: mail -s "Detection person" olivier
     AutoDelete: 0
       AutoMove: 0
     AutoMoveTo: 0
       AutoCopy: 0
     AutoCopyTo: 0
UpdateDiskSpace: 0
     Background: 0
     Concurrent: 0
       LockRows: 0
3 rows in set (0,001 sec)
_______________________
Blog https://olivier.hoarau.org
Funix https://www.funix.org
User avatar
burger
Posts: 472
Joined: Mon May 11, 2020 4:32 pm

Re: zmfilter problem

Post by burger »

You didn't specify an action.

You might expect a warning/error in ZM that if no action is selected it doesn't allow the filter to be saved... But that is not there, unfortunately.

I have seen the filters page glitch where I had to save the filter a second time to get the action or option to be registered. Maybe that happened. Always double check your filters.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
User avatar
funix
Posts: 14
Joined: Mon Aug 12, 2024 6:39 pm

Re: zmfilter problem

Post by funix »

I'm an idiot it was so obvious! thank you
_______________________
Blog https://olivier.hoarau.org
Funix https://www.funix.org
Post Reply