zmfilter won´t work. The log give me the reason but why?
ZM was installed on fresh Debian Buster Minimal from zmrepo.
On console i got an error also:
Code: Select all
MariaDB [zm]> SELECT * FROM `Filters` WHERE `Id` = ? AND( `AutoArchive` = 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`;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '? AND( `AutoArchive` = 1 or `AutoVideo` = 1 or `AutoUpload` = 1 or `AutoEmail` =' at line 1
MariaDB [zm]>
By removing "id = ?" it works:
Code: Select all
MariaDB [zm]> SELECT * FROM `Filters` WHERE ( `AutoArchive` = 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`;
+----+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-----------+------------+-----------+-------------+-------------+----------------+------------+----------+------------+----------+------------+-----------------+------------+------------+
| Id | Name | Query | AutoArchive | AutoVideo | AutoUpload | AutoEmail | AutoMessage | AutoExecute | AutoExecuteCmd | AutoDelete | AutoMove | AutoMoveTo | AutoCopy | AutoCopyTo | UpdateDiskSpace | Background | Concurrent |
+----+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-----------+------------+-----------+-------------+-------------+----------------+------------+----------+------------+----------+------------+-----------------+------------+------------+
| 1 | PurgeWhenFull | {"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":100,"sort_asc":1} | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| 2 | Update DiskSpace | {"terms":[{"attr":"DiskSpace","op":"IS","val":"NULL"}]} | 0 | 0 | 0 | 0 | 0 | 0 | | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
+----+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-----------+------------+-----------+-------------+-------------+----------------+------------+----------+------------+----------+------------+-----------------+------------+------------+
2 rows in set (0.000 sec)
Code: Select all
root@zm:~# zmfilter.pl
11/15/19 21:43:59.084465 zmfilter[25816].INF [main:185] [Scanning for events using all filters]
11/15/19 21:44:04.086320 zmfilter[25816].WAR [ZoneMinder::Filter:137] [No query in Filter!]
11/15/19 21:44:04.089508 zmfilter[25816].ERR [main:260] [Error parsing Sql. skipping filter 'PurgeWhenFull']
11/15/19 21:44:04.090003 zmfilter[25816].WAR [ZoneMinder::Filter:137] [No query in Filter!]
11/15/19 21:44:04.091132 zmfilter[25816].ERR [main:260] [Error parsing Sql. skipping filter 'Update DiskSpace']
11/15/19 21:44:04.091573 zmfilter[25816].WAR [main:267] [No filter found for SELECT * FROM `Filters` WHERE `Background` = 1 AND( `AutoArchive` = 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()]
Code: Select all
MariaDB [zm]> SELECT * FROM `Filters` WHERE `Background` = 1 AND( `AutoArchive` = 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`;
+----+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-----------+------------+-----------+-------------+-------------+----------------+------------+----------+------------+----------+------------+-----------------+------------+------------+
| Id | Name | Query | AutoArchive | AutoVideo | AutoUpload | AutoEmail | AutoMessage | AutoExecute | AutoExecuteCmd | AutoDelete | AutoMove | AutoMoveTo | AutoCopy | AutoCopyTo | UpdateDiskSpace | Background | Concurrent |
+----+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-----------+------------+-----------+-------------+-------------+----------------+------------+----------+------------+----------+------------+-----------------+------------+------------+
| 1 | PurgeWhenFull | {"sort_field":"Id","terms":[{"val":0,"attr":"Archived","op":"="},{"cnj":"and","val":95,"attr":"DiskPercent","op":">="}],"limit":100,"sort_asc":1} | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| 2 | Update DiskSpace | {"terms":[{"attr":"DiskSpace","op":"IS","val":"NULL"}]} | 0 | 0 | 0 | 0 | 0 | 0 | | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 |
+----+------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+-------------+-----------+------------+-----------+-------------+-------------+----------------+------------+----------+------------+----------+------------+-----------------+------------+------------+
2 rows in set (0.000 sec)