Second remote monitor throws socket errors on view

Forum for questions and support relating to the 1.28.x releases only.
Locked
cornbread
Posts: 14
Joined: Wed May 08, 2013 12:44 am

Second remote monitor throws socket errors on view

Post by cornbread »

Okay, here's the setup. I'm running ZM in a docker. I can add the first remote monitor (axis 207) totally fine with:

Remote host name: myuser:mypass@192.168.0.22
Remote host path: /axis-cgi/mjpg/video.cgi?resolution=640x480

I'm not sure what's going on and google warrioring didn't turn up much. I have posted instructions (if you're semi familiar with docker) at the bottom to getting this if you need to inspect it. The install is on ubuntu 14.04.
first monitor works all honkey dory when I view it. The second however throws:

Code: Select all

2015-04-05 04:18:40.965010 zmdc 441 INF 'zmc -m 2' crashed, signal 134 zmdc.pl
2015-04-05 04:18:40.114790 zmdc 609 INF 'zmc -m 2' started at 15/04/05 04:18:40 zmdc.pl
2015-04-05 04:18:40.114750 zmdc 441 INF 'zmc -m 2' starting at 15/04/05 04:18:40, pid = 609 zmdc.pl
2015-04-05 04:18:40.059550 zmdc 441 INF Starting pending process, zmc -m 2 zmdc.pl
2015-04-05 04:18:34.196043 web_js 125 ERR getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-634403s.sock ) failed: No such file or directory - checkStreamForErrors() ?view=watch
2015-04-05 04:18:34.025372 web_php 125 ERR socket_sendto( /var/run/zm/zms-634403s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2330
2015-04-05 04:18:14.010170 web_js 125 ERR getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-634403s.sock ) failed: No such file or directory - checkStreamForErrors() ?view=watch
2015-04-05 04:18:13.926651 web_php 125 ERR socket_sendto( /var/run/zm/zms-634403s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2330
2015-04-05 04:18:00.033830 zmdc 441 INF 'zmc -m 2' crashed, signal 134 zmdc.pl
2015-04-05 04:17:59.182290 zmdc 607 INF 'zmc -m 2' started at 15/04/05 04:17:59 zmdc.pl
2015-04-05 04:17:59.182240 zmdc 441 INF 'zmc -m 2' starting at 15/04/05 04:17:59, pid = 607 zmdc.pl
2015-04-05 04:17:59.103950 zmdc 441 INF Starting pending process, zmc -m 2 zmdc.pl
2015-04-05 04:17:53.940499 web_js 599 ERR getStreamCmdResponse stream error: socket_sendto( /var/run/zm/zms-634403s.sock ) failed: No such file or directory - checkStreamForErrors() ?view=watch
2015-04-05 04:17:53.837221 web_php 599 ERR socket_sendto( /var/run/zm/zms-634403s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2330
2015-04-05 04:17:39.507118 zms 604 INF Terminating Logger zm_logger.cpp 235
2015-04-05 04:17:39.453712 zms 604 WAR Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor outside zm_monitor.cpp 426
2015-04-05 04:17:39.009610 zmdc 441 INF 'zmc -m 2' crashed, signal 134 zmdc.pl
2015-04-05 04:17:38.142210 zmdc 602 INF 'zmc -m 2' started at 15/04/05 04:17:38 zmdc.pl
2015-04-05 04:17:38.142160 zmdc 441 INF 'zmc -m 2' starting at 15/04/05 04:17:38, pid = 602 zmdc.pl
2015-04-05 04:17:38.044940 zmdc 441 INF Starting pending process, zmc -m 2 zmdc.pl
2015-04-05 04:17:28.967320 zmdc 441 INF 'zmc -m 2' crashed, signal 134 zmdc.pl
2015-04-05 04:17:28.107530 zmdc 600 INF 'zmc -m 2' started at 15/04/05 04:17:28 zmdc.pl
2015-04-05 04:17:28.107460 zmdc 441 INF 'zmc -m 2' starting at 15/04/05 04:17:28, pid = 600 zmdc.pl
2015-04-05 04:17:28.043920 zmdc 441 INF Starting pending process, zmc -m 2 zmdc.pl
2015-04-05 04:17:23.662720 zmdc 441 INF 'zmc -m 2' crashed, signal 134 zmdc.pl
2015-04-05 04:17:22.806970 zmdc 595 INF 'zmc -m 2' started at 15/04/05 04:17:22 zmdc.pl
2015-04-05 04:17:22.806870 zmdc 441 INF 'zmc -m 2' starting at 15/04/05 04:17:22, pid = 595 zmdc.pl
2015-04-05 04:17:22.760640 zmdc 441 INF Starting pending process, zmc -m 2 zmdc.pl
2015-04-05 04:17:22.666840 zmdc 441 ERR 'zmc -m 2' exited abnormally, exit status 255 zmdc.pl
2015-04-05 04:17:22.148130 zmdc 441 WAR Can't find process with command of 'zma -m 2' zmdc.pl
2015-04-05 04:17:21.954450 zmdc 573 INF 'zmc -m 2' started at 15/04/05 04:17:21 zmdc.pl
2015-04-05 04:17:21.953540 zmdc 441 INF 'zmc -m 2' starting at 15/04/05 04:17:21, pid = 573 zmdc.pl
2015-04-05 04:17:21.794000 zmdc 441 WAR Can't find process with command of 'zmc -m 2' zmdc.pl
2015-04-05 04:17:21.611600 zmdc 441 WAR Can't find process with command of 'zma -m 2' zmdc.pl
2015-04-05 04:16:44.070591 zms 549 INF Terminating Logger zm_logger.cpp 235
2015-04-05 04:16:43.837723 zms 549 INF Got signal 15 (Terminated), exiting
The ZM docker setup I'm using is here on github:
QuantumObject/docker-zoneminder/

If you'd like to just use the one I've already built feel free to grab it and run it with:
sudo docker run -d -p 80:80 hrwebasst/zoneminder

if you are wanting to take a peek inside of the container you can install nsenter:
sudo docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter

and then a sudo docker ps will give you something like this:
e430db294535 hrwebasst/zoneminder:latest "/sbin/my_init" 4 seconds ago Up 4 seconds 0.0.0.0:80->80/tcp zoneminder

using sudo docker-enter e430db294535 will give you access to inside of the docker instance. (the hash value will be different for you)
cornbread
Posts: 14
Joined: Wed May 08, 2013 12:44 am

Re: Second remote monitor throws socket errors on view

Post by cornbread »

And for the record yes my remote host name has http on it but this stupid damn forum kept telling me it was "too spammy" and I had to remove anything that remotely looked like a url.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Second remote monitor throws socket errors on view

Post by asker »

:lol: keeping posting - I had the same issue in my first few posts.

So I had a similar issue when I started with ZM. First camera worked great, second one bonked just like yours with similar messages. The problem was I was running out of "mapped memory" (the space inside /var/run). Increasing shm does not make a difference as newer versions use mmap (yet another example of outdated information hanging around in various wikis)

a) Try this, while running your first camera do a "df -h" on a terminal and please post the results
b) How much memory do you have?

cornbread wrote:And for the record yes my remote host name has http on it but this stupid damn forum kept telling me it was "too spammy" and I had to remove anything that remotely looked like a url.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
cornbread
Posts: 14
Joined: Wed May 08, 2013 12:44 am

Re: Second remote monitor throws socket errors on view

Post by cornbread »

df -h
Filesystem Size Used Avail Use% Mounted on
none 5.5T 11G 5.4T 1% /
tmpfs 1.9G 4.0K 1.9G 1% /dev
shm 64M 64M 0 100% /dev/shm
/dev/disk/by-uuid/595c5d58-b12c-4cb4-b475-a5ddd716e310 5.5T 11G 5.4T 1% /etc/hosts

meminfo:

MemTotal: 7794284 kB
MemFree: 3537744 kB
MemAvailable: 6492104 kB
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Second remote monitor throws socket errors on view

Post by asker »

So this seems to be your problem. You are out of /dev/shm space.
Now you are running ubuntu 14 right? And I assume ZM 1.27 or above?

In my case (Ubuntu server 14.04) /dev/shm is a pointer to /run/shm (or /var/run/shm which in turn points to /run/shm). In other words, they are all the same.

Can you check the following:

a) Confirm that /dev/shm does indeed point to /var/run/shm or /run/shm

b) start zone minder with that one camera that works and go to /dev/shm

-- do you see a file there called zm.mmap.<whatever> ?

I just want to make sure your zone minder is using mapped memory and not shared memory.

If you do see it in /dev/shm, then you need to increase mapped memory space, not shared memory space.
cornbread wrote: shm 64M 64M 0 100% /dev/shm
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
cornbread
Posts: 14
Joined: Wed May 08, 2013 12:44 am

Re: Second remote monitor throws socket errors on view

Post by cornbread »

asker wrote:So this seems to be your problem. You are out of /dev/shm space.
Now you are running ubuntu 14 right? And I assume ZM 1.27 or above?

In my case (Ubuntu server 14.04) /dev/shm is a pointer to /run/shm (or /var/run/shm which in turn points to /run/shm). In other words, they are all the same.

Can you check the following:

a) Confirm that /dev/shm does indeed point to /var/run/shm or /run/shm

b) start zone minder with that one camera that works and go to /dev/shm

-- do you see a file there called zm.mmap.<whatever> ?

I just want to make sure your zone minder is using mapped memory and not shared memory.

If you do see it in /dev/shm, then you need to increase mapped memory space, not shared memory space.
cornbread wrote: shm 64M 64M 0 100% /dev/shm

root@73aef1088156:/dev/shm# ll
total 65536
drwxrwxrwt 2 root root 100 Apr 16 05:00 ./
drwxr-xr-x 5 root root 420 Apr 14 04:47 ../
-rwx------ 1 www-data www-data 67108904 Apr 16 05:00 pulse-shm-3144690490*
-rw------- 1 www-data www-data 61441760 Apr 16 05:06 zm.mmap.1
-rw------- 1 www-data www-data 61441760 Apr 16 05:06 zm.mmap.2
cornbread
Posts: 14
Joined: Wed May 08, 2013 12:44 am

Re: Second remote monitor throws socket errors on view

Post by cornbread »

wow so it looks like this is the problem the whole flipping time!

umount /dev/shm
mount -t tmpfs -o rw,nosuid,nodev,noexec,relatime,size=2048M tmpfs /dev/shm

fixes this problem. Is there a way around this? Any way we can have zoneminder allocate memory differently? the host has 8gb
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: Second remote monitor throws socket errors on view

Post by PacoLM »

Credits to asker:

## add fixed RAM disk to /etc/fstab (/dev/shm size to use 25% RAM, increase as needed)
sudo vi /etc/fstab
tmpfs /run/shm tmpfs defaults,noexec,nosuid,size=25% 0 0

Hope it helps,

PacoLM

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Locked