1.24.2 - Exit status 255, 1.23 is OK until reboot,plus 1970

Forum for questions and support relating to the 1.24.x releases only.
Locked
theemed
Posts: 9
Joined: Sun Jan 25, 2009 1:17 pm

1.24.2 - Exit status 255, 1.23 is OK until reboot,plus 1970

Post by theemed »

I finally wired the heck out of my house after months keeping the cameras inside a bag with a Ubuntu Jaunty server lying there with nothing to do.
I followed the step-by-step wiki for Hardy to install 1.24.2 on Jaunty, I own a 8-chips (SAA7130), 8-inputs PCI card which goes without saying is recognized at kernel level, I add the monitors (just two for now, the other 6 cams are still in the bag) and everything goes perfectly fine, until randomly the monitors start showing red /dev/video*; they usually go back to green by themselves because zmc restarts, as this excerpt from zmdc.log shows:

Code: Select all

09/04/2009 17:53:40.622801 zmdc[19689].INF [Server starting at 09/09/04 17:53:40]
09/04/2009 17:53:43.915424 zmdc[19689].INF ['zmfilter.pl' starting at 09/09/04 17:53:43, pid = 19711]
09/04/2009 17:53:44.378994 zmdc[19689].INF ['zmaudit.pl -c' starting at 09/09/04 17:53:44, pid = 19713]
09/04/2009 17:53:44.935021 zmdc[19689].INF ['zmwatch.pl' starting at 09/09/04 17:53:44, pid = 19715]
09/04/2009 17:53:45.411018 zmdc[19689].INF ['zmupdate.pl -c' starting at 09/09/04 17:53:45, pid = 19718]
09/04/2009 17:56:20.264268 zmdc[19689].WAR [Can't find process with command of 'zmc -d /dev/video4']
09/04/2009 17:56:20.540924 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 17:56:20, pid = 21600]
09/04/2009 17:56:20.998036 zmdc[19689].WAR [Can't find process with command of 'zma -m 1']
09/04/2009 17:56:21.300697 zmdc[19689].INF ['zma -m 1' starting at 09/09/04 17:56:21, pid = 21605]
09/04/2009 17:57:11.057533 zmdc[19689].WAR [Can't find process with command of 'zmc -d /dev/video5']
09/04/2009 17:57:11.483212 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 17:57:11, pid = 21636]
09/04/2009 17:57:11.994146 zmdc[19689].WAR [Can't find process with command of 'zma -m 2']
09/04/2009 17:57:12.470550 zmdc[19689].INF ['zma -m 2' starting at 09/09/04 17:57:12, pid = 21641]
09/04/2009 17:59:17.810153 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 17:59:17.810640 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
09/04/2009 17:59:17.861115 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 17:59:17, pid = 21695]
09/04/2009 18:00:40.302439 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:00:40.302934 zmdc[19689].INF [Starting pending process, zmc -d /dev/video5]
09/04/2009 18:00:40.355286 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 18:00:40, pid = 24983]
09/04/2009 18:01:45.154433 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:01:50.064098 zmdc[19689].INF [Starting pending process, zmc -d /dev/video5]
09/04/2009 18:01:50.109751 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 18:01:50, pid = 24998]
09/04/2009 18:02:25.870483 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 18:02:30.079103 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
09/04/2009 18:02:30.118351 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 18:02:30, pid = 25007]
09/04/2009 18:04:17.708853 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 18:04:27.027466 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
09/04/2009 18:04:27.059987 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 18:04:27, pid = 25031]
09/04/2009 18:04:38.473674 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:04:40.062499 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 18:04:48.074244 zmdc[19689].INF [Starting pending process, zmc -d /dev/video5]
09/04/2009 18:04:48.104380 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 18:04:48, pid = 25036]
09/04/2009 18:05:00.029712 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
09/04/2009 18:05:00.083034 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 18:05:00, pid = 25040]
09/04/2009 18:05:11.503648 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:05:31.077532 zmdc[19689].INF [Starting pending process, zmc -d /dev/video5]
09/04/2009 18:05:31.112677 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 18:05:31, pid = 26011]
09/04/2009 18:05:52.766289 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:06:32.059439 zmdc[19689].INF [Starting pending process, zmc -d /dev/video5]
09/04/2009 18:06:32.101162 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 18:06:32, pid = 26024]
09/04/2009 18:12:33.533437 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 18:13:13.020734 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
09/04/2009 18:13:13.057056 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 18:13:13, pid = 28822]
09/04/2009 18:14:53.431334 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:16:07.478887 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 18:16:13.088258 zmdc[19689].INF [Starting pending process, zmc -d /dev/video5]
09/04/2009 18:16:13.119919 zmdc[19689].INF ['zmc -d /dev/video5' starting at 09/09/04 18:16:13, pid = 30911]
09/04/2009 18:17:27.009107 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
09/04/2009 18:17:27.053440 zmdc[19689].INF ['zmc -d /dev/video4' starting at 09/09/04 18:17:27, pid = 31749]
09/04/2009 18:19:11.378037 zmdc[19689].ERR ['zmc -d /dev/video4' exited abnormally, exit status 255]
09/04/2009 18:20:55.610662 zmdc[19689].ERR ['zmc -d /dev/video5' exited abnormally, exit status 255]
09/04/2009 18:21:51.017138 zmdc[19689].INF [Starting pending process, zmc -d /dev/video4]
or I can do that manually by opening the settings panel and pressing save without doing anything else, thus I suppose restarting zmc anyway.
Note that reducing max FPS or buffer size solved nothing for me, and my setting is 7fps at 400x300 with a buffer of 40 (1GB of ram installed, can handle 2 cams like that).
Also note that I get the events from 1970 that other users reported about: if I try to play them I only get a still, and after that apache is not responding anymore, I have to restart it from init.d

The interesting part comes now: fed up with this behaviour, in the same session I did the following:
1) sudo dpkg -r zoneminder (the 1.24.2 compiled from source)
2) sudo aptitude install zoneminder (the 1.23 version in vanilla repos)
3) set monitors again and voilà, all working WITHOUT any blanks, monitors had consistently green sources, and all the recorded events (quite many just to test) had NO events from 1970.

After reboot tho (compelled by a blackout) 1.23 wasn't working anymore, all of /dev/video* are showed in red (with the same settings that work with 1.24 and that worked with 1.23 BEFORE reboot), even if zmu reported their presence (in less detail if compared to 1.24.2's zmu).
This is consistent: 1.23 just doesn't work on this system if installed first thing after a reboot, with my great surprise (while it works BETTER than latest version, if I uninstall 1.24.2 and install 1.23 right off without rebooting).

Someone reported running zmc as root instead of www-data to have the process keep running, I would like to know how to go about that, since manually doing

Code: Select all

sudo zmc -d /dev/videoN
doesn't make the monitor work in the console but effectively locks the device until I kill it.

Please be patient, I am a newbie, and actually tired of having wasted a day on this silly problem.

=============================================
EDIT:

I just thought of a workaround, which I didn't even try to put in action, but should work even if it's the ugliest thing you may encounter among workarounds:

1) Edit /etc/sudoers and add the line:
www-data ALL=(ALL) NOPASSWD:ALL
(this will let you run a command as the user www-data with sudo)
2) set a cron job for user root that for example each minute fires:
sudo -u www-data /usr/local/bin/zmc -d /dev/video<N>

This way you could restart zmc if it's gotten fubarr'ed (for the exit status 255 which I don't really know what stands for), or simply do nothing if zmc is already running for that device.
Thoughts anyone?



EDIT II:
one of the monitors went red-source, so I tried with
sudo -u www-data /usr/local/bin/zmc -d /dev/video4
it styed on hold for a while before going back to prompt, but didn't work, as refreshing console didn't show a green source... while opening and saving monitor properties did... workaround failed, so either I try and use a script that reloads the monitor property as if a user was browsing to it (which I have no idea how to achieve) or maybe we try solving the origin of the problem. Why should it be so frigging hard to make something like this simply work, sometimes I think about XP and MJPEG surveillance...
theemed
Posts: 9
Joined: Sun Jan 25, 2009 1:17 pm

Post by theemed »

Reply for UP.

I was apparently silly about thinking to restart the daemons with exotic methods, as I just decided to check the Options, and I've decreased MAX_RESTART_DELAY from 600 to 1.
I'll report on this situation, even if I'd still prefer to have the exit status 255 solved at the source...
theemed
Posts: 9
Joined: Sun Jan 25, 2009 1:17 pm

Post by theemed »

Ok, enabled full debug with level 5, and what I get is a common error in the debug logs whenever a monitor exits abnormally with ext status 255:

Code: Select all

09/09/09 23:44:47.608141 zmc_dvideo5[28913].DB3-zm_local_camera.cpp/1910 [Requeueing buffer 1]
09/09/09 23:44:47.807277 zmc_dvideo5[28913].DB2-zm_local_camera.cpp/1485 [Pre-capturing]
09/09/09 23:44:47.807335 zmc_dvideo5[28913].DB3-zm_local_camera.cpp/1491 [Capturing]
09/09/09 23:44:47.807357 zmc_dvideo5[28913].DB3-zm_local_camera.cpp/1514 [Capturing 1 frames]
09/09/09 23:44:47.807517 zmc_dvideo5[28913].WAR-zm_local_camera.cpp/1520 [Capture failure, possible signal loss?: Input/output error]
09/09/09 23:44:47.807584 zmc_dvideo5[28913].ERR-zmc.cpp/260 [Failed to capture image from monitor 2 (0/1)]
09/09/09 23:44:47.807677 zmc_dvideo5[28913].DB3-zm_local_camera.cpp/698 [Terminating video stream]
09/09/09 23:44:47.807738 zmc_dvideo5[28913].DB3-zm_local_camera.cpp/704 [Unmapping video buffers]
The only thing that changes from monitors debug logs is timestamp, device name and PID, error is always the same.
sef1976
Posts: 46
Joined: Sun Aug 16, 2009 5:24 am

Post by sef1976 »

1970 time to time i have too
i fix that not god but work

Code: Select all

cat /etc/cron.t/sql/del.sql

DELETE FROM `Events` WHERE StartTime = '1970-01-01 03:00:00' AND Name <> 'New Event' LIMIT 1000;

Code: Select all

cat /etc/cron.t/sql/mysql_clean.sh

#!/bin/bash

mysql zm -u zm -pPASSWORD </etc/cron.t/sql/del.sql

and add SCRIPT to crontab
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

sef1976 wrote:1970 time to time i have too
i fix that not god but work

Code: Select all

cat /etc/cron.t/sql/del.sql

DELETE FROM `Events` WHERE StartTime = '1970-01-01 03:00:00' AND Name <> 'New Event' LIMIT 1000;

Code: Select all

cat /etc/cron.t/sql/mysql_clean.sh

#!/bin/bash

mysql zm -u zm -pPASSWORD </etc/cron.t/sql/del.sql

and add SCRIPT to crontab
Why not make a new filter to delete all events before 2000 year runing at background?
execcr
Posts: 19
Joined: Tue May 02, 2006 3:58 pm
Location: Italy -- Cremona

Post by execcr »

you have resolved your issue? i have the same problem! I/O error and camera goes black! The zmc restart the deamon...works for a minute or so and then another error...

What is your hardware?
I use a AMD64 3200+ processor, asus motherboard, 1,5gb of ram: 1gm stick, 2*256 stick in dual channel mode.
littlej
Posts: 68
Joined: Sun Oct 18, 2009 11:46 am

Post by littlej »

i have same problem, but even if i use only as monitor i get the 255 error, no events and other stuff on my server, and i get this error. i disabled
STRICT_VIDEO_CONFIG in 1.24 and now at least i dont have to click on the source and click save again so the demon to start again. it only fils up my logs with 255 error. but still wana solve it for good. thanks
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

The 1970 or 1969 date in mysql is a result typically of a overloaded machine and or mysql server crashing. Either one is not good as this will corrupt the database. Check your loads and make adjustments accordingly.
littlej
Posts: 68
Joined: Sun Oct 18, 2009 11:46 am

Post by littlej »

my load keeps at 0.10 and peak its 0.70 so dont know if thats the problem...
Locked