zmc/zmdc crashing when trying to monitor web ip camera

Forum for questions and support relating to the 1.25.x releases only.
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

Hi experts,

First of all, I must say ZoneMinder is a nice piece of software! Short story:

Zoneminder 1.25.0
Ubuntu Server 12.04 i386

Got my Zoneminder installation up and running on my Ubuntu 12.04 server a couple of days ago, connect to successfully to the same IP camera that I am now having problems connecting to. I decided to move the server and server to a different location yesterday and before that I updated my system with "apt-get" to download all updates for the packages I have installed. After this it all went down hill....

I am now having problems connecting to the IP camera(correct IP set), nothing else change. The ZM log shows me:

2013-01-09 23:35:13.506450 zmdc 1034 ERR 'zmc -m 1' exited abnormally, exit status 255 zmdc.pl
2013-01-09 23:35:13.407646 zmc_m1 1499 ERR Failed to pre-capture monitor 1 (0/1) zmc.cpp 256
2013-01-09 23:35:13.406858 zmc_m1 1499 ERR Unable to connect to camera zm_remote_camera_http.cpp 1069
2013-01-09 23:35:13.405431 zmc_m1 1499 ERR Can't connect to remote camera: Connection timed out zm_remote_camera_http.cpp 101
2013-01-09 23:34:10.319548 zmc_m1 1499 INF Starting Capture zmc.cpp 191

Before that I had the classic:
zms 3684 ERR Terminating, last frame sent time
zms 2484 ERR Got unexpected memory map file size

... but these are now fixed as far as I can say, took help from a guide I found on how to fix both issues (modify shmall and shmmax in sysctls and set the correct format on the video)

Any ideas on where to look next? I have a feeling the apt-get update/upgrade was not such a good idea....

Thanks in advance,
Keda
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

Seem to have the same problem ... all works fine for couple of minuts and suddenty can't see any more picture from my 5 cams ...
Using ubuntu 12.04.1 64b server edition; completely clean installation

/EDIT
Getting alot of those in syslog:

Jan 10 01:38:08 gecko web_php[1241]: ERR [socket_sendto( /tmp/zm/zms-994903s.sock ) failed: No such file or directory]
Jan 10 01:38:21 gecko web_php[1558]: ERR [socket_sendto( /tmp/zm/zms-994903s.sock ) failed: No such file or directory]

/EDIT2
I also updated everything but did this before I installed Zoneminder using the guide ... since mine is a clean install i ll just reinstall ubuntu from scracth and reinstall zoneminder without the dist updates/upgrades ...

I ll keep you guys posted :)
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

Reinstall seems to work .. but i only installed my ipcams; still need to add my other ones ... i think the update fucked something up ...
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

keda: you sure your webcam settings are ok in the config; i don't think ip alone will work.

I fixed my problem by switching from 64b to 32b (read reinstall)

I updated all my stuff first so that can't be the problem your side ... suppose it is a config problem; can you still access the camera outside zm?
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

Thanks Tiggy, good to know you got things working again!

I am fairly sure I got the config right, everything was working before I move to a different subnet AND did the apt-get update/upgrade. The only config change I did was changing the "Remote Host Name"(Source) to the correct IP address.

The IP cam(Foscam) can be accessed directly and live stream works fine outside ZM.

Do you think the xmc/zmdc would crash if I got the config wrong? So what you are saying is that a reinstall will most likely do the trick then.... sigh. Not sure if I am up for it! :)

BTW, I only have 384mb of physical RAM in the server but only 136MB is used when the monitor is not running. But changing to 320x240 greyscale makes no different(if considering RAM usage)

Thanks,
Keda
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

BTW, your 64bit -> 32bit issue, could it have been related to the $arch issue in /usr/share/perl5/ZoneMinder/Memory.pm?

*****
our $arch = int(3.2*length(~0));

To the following (It's advisable to comment out the old line and leave it there).

our $arch = 32;
*****

Regards,
Keda
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

Don't think so ... that gave another error (some kinda memory error)

I did have it on my i386 comp but was able to fix it using by setting $arch to 32; I could have tried it on my 64b install but now everything works fine and i don't wanna reinstall everything from scratch for a 4th time lol

Did you solve your prob?
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

Nope, no solution yet, even though a reinstall appears to be the only way. Not looking forward to it ..... :)

Another idea is slowly building up though, maybe its time to take the step towards Raspberry Pi as I am still going to have to perform a reinstall .....

Any other ideas?

/Keda
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

I have no idea what that raspberry pi is lol

The error you get seems to be some kinda connection error to the camera itself ... can you still connect to the cam remotely(in IE or something)?
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

OK, I think I found the issue now.....

I wanted to see if the issue was reproducible, so I put together a virtual Ubuntu server 12.04 install limited to 384 MB of RAM. I made sure not to apply any updates via apt-get and the result is the same as the original issue. There were some minor glitches that I had to fix in the config, but still the issue with zmc crashing occured.

Based on this I increased the amount of RAM to 512, and voila, ZM runs perfectly! The funny thing though is that when I decreased the amount of RAM back to 384 ZM runs fine ....?

Any way, the apt-get upgrade most likely installed updates that uses more RAM which causes zmc to fail to start properly. I am guessing 384 MB with one camera is like "living on the edge".

Increasing RAM on the server that has the original issue is not possible. So, any ideas on what to shut down/kill on order to get things running again. This will be my last attempt, if I cant get it to run I will go ahead and order a Raspberry Pi .... :)

Thanks,
Keda
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

I don't see why ram could be the problem if you use an ipcam? Server just has to save the picture every x ...
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

Well, looks like my conclusions may not be 100% correct after all....

Some more testing shows that 360MB of RAM + a apt-get update/upgrade on Ubuntu 12.04 in a Virtual environment runs just fine. But it does not on my physical server....

Are you saying the only way is a reinstall then?

Best regards,
Kenneth
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

Turned on additional debugging and got this:

2013-01-16 22:22:34.915253 web_php 5786 ERR socket_sendto( /tmp/zm/zms-147549s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2322
2013-01-16 22:22:20.191383 web_php 27287 ERR socket_sendto( /tmp/zm/zms-147549s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2322
2013-01-16 22:22:19.519580 zmdc 6555 ERR 'zmc -m 2' exited abnormally, exit status 255 zmdc.pl
2013-01-16 22:22:19.422284 zmc_m2 6760 ERR Failed to pre-capture monitor 2 (0/1) zmc.cpp 256
2013-01-16 22:22:19.421507 zmc_m2 6760 ERR Unable to connect to camera zm_remote_camera_http.cpp 1069
2013-01-16 22:22:19.420275 zmc_m2 6760 ERR Can't connect to remote camera: Connection timed out zm_remote_camera_http.cpp 101
2013-01-16 22:22:15.171008 zms 6778 ERR Terminating, last frame sent time 1358371334.670763 secs more than maximum of 10.000000 zm_monitor.cpp 3639

Seen this before?

Thanks,
Keda
Tiggy
Posts: 62
Joined: Tue Mar 11, 2008 7:47 pm
Location: Belgium

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by Tiggy »

I get those socket error too but everything seems to work fine ... just removed them from my syslog

I don't think you should look at those errors.

Can you connect tot the ipcam using Internet Explorer or something? Does that work fine?
keda
Posts: 9
Joined: Wed Jan 09, 2013 10:27 pm

Re: zmc/zmdc crashing when trying to monitor web ip camera

Post by keda »

Yes, I can connect to the ip cam via IE AND from another ZM server that I have setup at home(failing ZM server is in the cabin 1h drive from where i live).

So the ZM config has been screwed up on the failing ZM server. Do you think a complete uninstall of ZM and all dependency packages might to the trick?

/K
Locked