'zmfilter.pl ' exited abnormally, exit status 9

Forum for questions and support relating to the 1.25.x releases only.
Locked
jamesfromkent
Posts: 1
Joined: Sat Oct 08, 2011 11:53 pm

'zmfilter.pl ' exited abnormally, exit status 9

Post by jamesfromkent »

I'm running Ubuntu 11.04 and compiled ZoneMinder from the latest source (1.25) one week ago. I'm using ZM to motion detect two FOSCAM IP cameras (my neighbors deal meth). I had to download a bunch of libraries to do this, following some online instructions and it just seemed to work in the end.

ZoneMinder seems to work OK except for the background filter functionality. I can see the images and videos. Motion detection events are being saved and can be replayed.

In zmdc.log I get "'zmfilter.pl ' exited abnormally, exit status 9" error every time motion is detected and I have a filter running in the background:

Code: Select all

10/08/11 17:29:04.033586 zmdc[6538].INF [Starting pending process, zmfilter.pl]
10/08/11 17:29:04.037209 zmdc[6538].INF ['zmfilter.pl' starting at 11/10/08 17:29:04, pid = 6670]
10/08/11 17:29:04.037217 zmdc[6670].INF ['zmfilter.pl' started at 11/10/08 17:29:04]
10/08/11 17:29:04.219942 zmdc[6538].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
10/08/11 17:29:44.082763 zmdc[6538].INF [Starting pending process, zmfilter.pl]
10/08/11 17:29:44.086392 zmdc[6714].INF ['zmfilter.pl' started at 11/10/08 17:29:44]
10/08/11 17:29:44.086383 zmdc[6538].INF ['zmfilter.pl' starting at 11/10/08 17:29:44, pid = 6714]
10/08/11 17:29:44.259561 zmdc[6538].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
10/08/11 17:31:04.089721 zmdc[6538].INF [Starting pending process, zmfilter.pl]
10/08/11 17:31:04.093339 zmdc[6538].INF ['zmfilter.pl' starting at 11/10/08 17:31:04, pid = 6727]
10/08/11 17:31:04.093348 zmdc[6727].INF ['zmfilter.pl' started at 11/10/08 17:31:04]
10/08/11 17:31:04.270506 zmdc[6538].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
I don't seem to be getting any other errors in other log files. I've tried turning off the send email and upload functionality. I've checked my postfix logs and nothing is being sent to PostFix. Nothing was being FTP'd anywhere either. I've tried turning off email and upload functionality, but it doesn't make a difference. I had to change my shared memory settings to get ZM to work in the first place.

I've previously had ZM working fine (with a fair bit of tinkering) from the Ubuntu Software Center, though had to completely rebuild my machine since then.

When I restart ZM, I get the following sequence (this happens when I'm not running filters in the background):

Code: Select all

10/08/11 17:40:46.958773 zmdc[6538].INF [Server shutdown at 11/10/08 17:40:46]
10/08/11 17:40:47.307443 zmdc[6941].INF [Server starting at 11/10/08 17:40:47]
10/08/11 17:40:50.408991 zmdc[6941].INF ['zmc -m 1' starting at 11/10/08 17:40:50, pid = 6963]
10/08/11 17:40:50.411083 zmdc[6963].INF ['zmc -m 1' started at 11/10/08 17:40:50]
10/08/11 17:40:50.543402 zmdc[6941].INF ['zma -m 1' starting at 11/10/08 17:40:50, pid = 6965]
10/08/11 17:40:50.543407 zmdc[6965].INF ['zma -m 1' started at 11/10/08 17:40:50]
10/08/11 17:40:50.641145 zmdc[6967].INF ['zmc -m 2' started at 11/10/08 17:40:50]
10/08/11 17:40:50.641139 zmdc[6941].INF ['zmc -m 2' starting at 11/10/08 17:40:50, pid = 6967]
10/08/11 17:40:50.751563 zmdc[6969].INF ['zma -m 2' started at 11/10/08 17:40:50]
10/08/11 17:40:50.751558 zmdc[6941].INF ['zma -m 2' starting at 11/10/08 17:40:50, pid = 6969]
10/08/11 17:40:50.852985 zmdc[6973].INF ['zmfilter.pl' started at 11/10/08 17:40:50]
10/08/11 17:40:50.852981 zmdc[6941].INF ['zmfilter.pl' starting at 11/10/08 17:40:50, pid = 6973]
10/08/11 17:40:50.962319 zmdc[6976].INF ['zmaudit.pl -c' started at 11/10/08 17:40:50]
10/08/11 17:40:50.962314 zmdc[6941].INF ['zmaudit.pl -c' starting at 11/10/08 17:40:50, pid = 6976]
10/08/11 17:40:51.072254 zmdc[6941].INF ['zmwatch.pl' starting at 11/10/08 17:40:51, pid = 6978]
10/08/11 17:40:51.079637 zmdc[6978].INF ['zmwatch.pl' started at 11/10/08 17:40:51]
10/08/11 17:40:51.128329 zmdc[6941].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
10/08/11 17:40:51.129366 zmdc[6941].INF [Starting pending process, zmfilter.pl]
10/08/11 17:40:51.132064 zmdc[6941].INF ['zmfilter.pl' starting at 11/10/08 17:40:51, pid = 6980]
10/08/11 17:40:51.139205 zmdc[6980].INF ['zmfilter.pl' started at 11/10/08 17:40:51]
10/08/11 17:40:51.335372 zmdc[6982].INF ['zmupdate.pl -c' started at 11/10/08 17:40:51]
10/08/11 17:40:51.335367 zmdc[6941].INF ['zmupdate.pl -c' starting at 11/10/08 17:40:51, pid = 6982]
10/08/11 17:40:51.499569 zmdc[6941].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
10/08/11 17:40:56.028171 zmdc[6941].INF [Starting pending process, zmfilter.pl]
10/08/11 17:40:56.030926 zmdc[6941].INF ['zmfilter.pl' starting at 11/10/08 17:40:56, pid = 6998]
10/08/11 17:40:56.032982 zmdc[6998].INF ['zmfilter.pl' started at 11/10/08 17:40:56]
10/08/11 17:40:56.212072 zmdc[6941].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
10/08/11 17:41:06.027807 zmdc[6941].INF [Starting pending process, zmfilter.pl]
10/08/11 17:41:06.031638 zmdc[7000].INF ['zmfilter.pl' started at 11/10/08 17:41:06]
10/08/11 17:41:06.031629 zmdc[6941].INF ['zmfilter.pl' starting at 11/10/08 17:41:06, pid = 7000]
10/08/11 17:41:06.209210 zmdc[6941].ERR ['zmfilter.pl ' exited abnormally, exit status 9]
I also get the following errors in my Apache2 error.log but I don't think this is related:

Code: Select all

[Sat Oct 08 17:27:51 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: <I've removed the HTTP because message board wouldn't allow it>localhost/zm/index.php?view=log
[Sat Oct 08 17:42:57 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: <removed>/zm/index.php?view=log
[Sat Oct 08 17:46:16 2011] [error] [client 127.0.0.1] File does not exist: /var/www/css, referer: <removed>/zm/index.php?view=log
Any help would be appreciated. I'm a bit of Linux newbie but can work some stuff out. I've tried searching all over the place.

Many thanks.
norzaw
Posts: 7
Joined: Wed Aug 26, 2009 11:54 am

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by norzaw »

Hello!

I've got a very similar problem and the same error message.

zoneminder slowly fills up the disk because my newly definded background-filter "DeleteOld" does not execute.
Everytime when zmfilter is started I see that error message "'zmfilter.pl ' exited abnormally, exit status 9"

What doe status "9" mean?
Is there a list of status codes somewhere?

How can I track down this probblem ?????

Norbert
lucasnegrao
Posts: 4
Joined: Wed Feb 08, 2012 4:10 am

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by lucasnegrao »

i am having the exactly same problema. ZM simply doesnt run my filters.
on a closer inspection i have found that running zmfilter.pl from the console gives me this output

Unknown type '"'! at 2 at /usr/share/perl5/vendor_perl/PHP/Serialization.pm line 162
PHP::Serialization::_parse('PHP::Serialization=HASH(0x94655f0)') called at /usr/share/perl5/vendor_perl/PHP/Serialization.pm line 116
PHP::Serialization::decode('PHP::Serialization=HASH(0x94655f0)', '{"terms":[{"attr":"Archived","op":"=","val":"0"},{"cnj":"and"...') called at /usr/share/perl5/vendor_perl/PHP/Serialization.pm line 79
PHP::Serialization::unserialize('{"terms":[{"attr":"Archived","op":"=","val":"0"},{"cnj":"and"...') called at /srv/zoneminder/bin/zmfilter.pl line 268
main::getFilters('') called at /srv/zoneminder/bin/zmfilter.pl line 189

any thoughts on that?
lucasnegrao
Posts: 4
Joined: Wed Feb 08, 2012 4:10 am

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by lucasnegrao »

ok. i have solved my problem, maybe the solution for yours is the same.

i was using a SVN version of zoneminder and the zmfilter.pl in my version was using the function deserialize to get the filters from the db while the actions.php was using jsonEncode to get the filters into the database - this was causing the error. to fix it, i simply downloaded the official 1.25 version, copied the zmfilters.pl (ZONEMINDER_PATH/bin/) and set the chmod of it to a+x (without the chmod it causes a 255 error).
norzaw
Posts: 7
Joined: Wed Aug 26, 2009 11:54 am

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by norzaw »

no success :( :( :(
my installation is from rpm. I downloaded the 1.25 tar.gz version an compared the zmfilter files. they are equal.

zm still doesn't run my filters and therefore fills up the disk.
Intresting is, that if I open the "Filters" window from the zm-console, it first looks o.k.
But when I then select a filter from the combobox, an error is dsplayed:

Unable to decode JSON string '', syntax error

So I think, this whole problem is somehow related to that json stuff. But I don't know how to track it down ..
lucasnegrao
Posts: 4
Joined: Wed Feb 08, 2012 4:10 am

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by lucasnegrao »

can you try running zmfilter.pl from the console and paste the output?
also, if you can

Code: Select all

cat zmfilter.pl | grep "serialize\|json"
and

Code: Select all

cat actions.php | grep "serialize\|json"
we can try to track the problem.

zmfilter.pl is located on your zoneminder bin directory
and actions.php on your zoneminder web/includes
norzaw
Posts: 7
Joined: Wed Aug 26, 2009 11:54 am

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by norzaw »

o.k.:

rincewind:/etc # zmfilter.pl
Warning, overriding installed ./zm.conf file with local copy
Name "Net::SFTP::Foreign::debug" used only once: possible typo at /usr/bin/zmfilter.pl line 812.
rincewind:/etc #


rincewind:/etc # cat /usr/bin/zmfilter.pl | grep "serialize\|json"
my $filter_expr = jsonDecode( $db_filter->{Query} );
rincewind:/etc #

rincewind:/etc # cat /srv/www/htdocs/zm/includes/actions.php | grep "serialize\|json"
$sql = "replace into Filters set Name = '".dbEscape($filterName)."', Query = '".dbEscape(jsonEncode($_REQUEST['filter']))."'";
$optionString = jsonEncode( $options );
rincewind:/etc #
_saiko
Posts: 16
Joined: Wed Apr 04, 2012 8:48 pm

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by _saiko »

I'm also getting the

Code: Select all

'zmfilter.pl ' exited abnormally, exit status 9
On the console i'm getting:

Code: Select all

$ ./zmfilter.pl
Name "Net::SFTP::Foreign::debug" used only once: possible typo at ./zmfilter.pl line 812, <DATA> line 496.
Undefined subroutine &Date::Manip::UnixDate called at ./zmfilter.pl line 135, <DATA> line 496.
I'm on archlinux with latest -Syu performed.

Undefined subroutine sounds to me like i'm missing some perl libraries.
I do have the perl date-manip libraries installed tho.

Any clue?

Thanks


Edit:

I did a bit of research..
Apparently the problem is when perl is using the tainted mode (-T).

Code: Select all

$ perl -v
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-thread-multi
$ perl -MDate::Manip -e 'print DateManipVersion()."\n";'
6.30

Code: Select all

$ perl -w -MDate::Manip -e 'print DateManipVersion()."\n"; my $date = UnixDate("now", "%y"); print $date ."\n"'
6.30
12
$ perl -wT -MDate::Manip -e 'print DateManipVersion()."\n"; my $date = UnixDate("now", "%y"); print $date ."\n"'
Undefined subroutine &Date::Manip::UnixDate called at /home/saiko/test.pl line 5, <DATA> line 496.
_saiko
Posts: 16
Joined: Wed Apr 04, 2012 8:48 pm

Re: 'zmfilter.pl ' exited abnormally, exit status 9

Post by _saiko »

Solved!

The error message was so misleading.
In the end tried to use the -MDate::Manip::DM6 to define the exact location of the subroutine in question.
Only then I got the familiar error:

Code: Select all

$ perl -wT -MDate::Manip::DM6 -e 'print DateManipVersion() . "\n";'
Insecure $ENV{PATH} while running with -T switch at /usr/share/perl5/vendor_perl/Date/Manip/TZ.pm line 615, <DATA> line 429.
Compilation failed in require, <DATA> line 429.
BEGIN failed--compilation aborted, <DATA> line 429.
This made me remember a similar thread: https://bbs.archlinux.org/viewtopic.php?id=91981

Anyhow defining the /etc/timezone solves the problem.
Locked