Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Forum for questions and support relating to the 1.30.x releases only.
Post Reply
hud
Posts: 3
Joined: Fri Apr 28, 2017 11:25 am

Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by hud » Fri Apr 28, 2017 12:28 pm

Issue is I'm getting infinite repeating errors in the log even though my camera is working (video shows when clicking it's name in zm gui).

I've noticed that /var/run/zm/zms-307984w.sock keeps appearing and disappearing.

www/ajax/stream.php is a place to start looking...

= Repeating Errors =
2017-04-28 06:34:45.320737 web_php 826 ERR Socket does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. /usr/share/zoneminder/www/includes/functions.php 2031
2017-04-28 06:34:45.309201 web_js 829 ERR getStreamCmdResponse stream error: socket_bind( /var/run/zm/zms-307984w.sock ) failed: Address already in use - checkStreamForErrors() ?view=watch
2017-04-28 06:34:45.304287 web_php 829 ERR socket_bind( /var/run/zm/zms-307984w.sock ) failed: Address already in use /usr/share/zoneminder/www/includes/functions.php 2031
2017-04-28 06:34:42.317222 web_js 826 ERR getStreamCmdResponse stream error: Socket does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors() ?view=watch
= Things I have already tried that don't help =
cgi is enabled and I've changed Options->PATH_ZMS=/zm/cgi-bin/nph-zms which matches ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin" in /etc/apache2/conf-enabled/zoneminder.conf (the default PATH_ZMS was /cgi-bin/nph-zms and I did NOT get video with this path)

= Install Details =
ZoneMinder 1.30.2, Ubuntu Server 16.04.2 LTS (Xenial Xerus) (issue also happens on my CentOS install).
Used the "easy" way: http://zoneminder.readthedocs.io/en/sta ... buntu.html

Hikivision DS-2CD2032-I firmware V5.2.5 build 14120, tested rscp path in vlc, works great there.

Had to use general->ffmpeg/sourcePath->rtsp after 1.5 days of failing to get general->remote/source->Remote Method->rscp to work.
If anyone knows the (EXACT Screenshot) settings to make remote/rscp work let me know. After some googling it seems the boxes in the gui have changed quite a bit between versions of zoneminder or do they vary per camera firmwares?

As a first time user of zoneminder, I wish:
1: the default config worked without changing PATH_ZMS.
2: there was a clearer error is gui when camera settings were incorrect
3: #2 would save time being confused by possibly unrelated repeating errors (subject of this post)

User avatar
knight-of-ni
Posts: 2257
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by knight-of-ni » Fri Apr 28, 2017 12:48 pm

I'm sorry you spent 1.5 days trying to use the remote -> RTSP method, but the documentation does tell you that method is deprecated:
http://zoneminder.readthedocs.io/en/sta ... source-tab

Always start with ffmpeg as it tends to work the best by a good margin.

Have you read the documentation in the wiki for your Hikvision camera?
https://wiki.zoneminder.com/Hikvision

You could also try our new Onvif probe. The link shows in the top right on the monitor configuration popup window.

If you still have issues, then we need to see exactly how you populated all the fields on the source tab, including the full rtsp url. Don't forget to change the camera password before posting it if it is visible.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

hud
Posts: 3
Joined: Fri Apr 28, 2017 11:25 am

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by hud » Fri Apr 28, 2017 1:09 pm

Source Tab->Source Path: rtsp://admin:pwhere@10.0.0.22:554/Streaming/Channels/1?transportmode=mcast&profile=Profile_1

Full Settings:
http://imgur.com/a/VQhKH

I started with that wiki page, but didn't know about PATH_ZMS yet so got lost on remote/rscp after lots of googling.

Your Onvif probe is the only reason my camera works so thanks for that :)

User avatar
knight-of-ni
Posts: 2257
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by knight-of-ni » Fri Apr 28, 2017 1:18 pm

So by your last sentence, does that mean the camera is working now and you can see a live stream??
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

mcornhill
Posts: 3
Joined: Wed May 03, 2017 5:54 am

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by mcornhill » Thu Jun 08, 2017 7:29 am

Hi guys,
Ubunutu server 1604 fresh install.
apt-get method of install which installed Zoneminder 1.30.4
Hikvision DS-2CD3145 camera (and other Foscams)

I'm experiencing the same issue where the unix socket file cannot be found when trying to view the cameras in monitor or modetect modes. This happens from the camera view and the zones configuration view. Here is the log entry.
Jun 8 17:06:20 zm web_php[1655]: ERR [getStreamCmdResponse stream error: Socket /tmp/zm/zms-430269s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. - checkStreamForErrors()]
I understand that the ScriptAlias has to agree with what is in PATH_ZMS under options. I've checked and these are correct. I've also verified the cgi is enabled in Apache2 also.

Code: Select all

ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    Require all granted
</Directory>
Options -> paths

Code: Select all

PATH_ZMS    zm/cgi-bin/nph-zms
zmc is running also:

Code: Select all

1268 ?        Ss     0:00 /usr/sbin/apache2 -k start
 1610 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1611 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1612 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1613 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1614 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1617 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1653 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1655 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1656 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1657 ?        S      0:00  \_ /usr/sbin/apache2 -k start
 1314 ?        S      0:00 /usr/bin/perl -wT /usr/bin/zmdc.pl startup
 1352 ?        R      2:36  \_ /usr/bin/zmc -m 2
 1355 ?        S      0:00  \_ /usr/bin/perl -wT /usr/bin/zmfilter.pl
 1362 ?        S      0:00  \_ /usr/bin/perl -wT /usr/bin/zmaudit.pl -c
 1368 ?        S      0:00  \_ /usr/bin/perl -wT /usr/bin/zmwatch.pl
 1375 ?        S      0:00  \_ /usr/bin/perl -w /usr/bin/zmupdate.pl -c
 1379 ?        S      0:00  \_ /usr/bin/perl -w /usr/bin/zmtelemetry.pl
 1385 ?        S      1:08  \_ /usr/bin/zma -m 2
I've checked the ownership of the /var/run/zm directory and also tried pointing to /tmp/zm, no luck here either.

Has anyone found the root cause of this error and resolved it?

Any help is greatly appreciated.

User avatar
knight-of-ni
Posts: 2257
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by knight-of-ni » Thu Jun 08, 2017 2:07 pm

Your PATH_ZMS is wrong. You are missing a "/"
It should be "/zm/cgi-bin/nph-zms"
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

mcornhill
Posts: 3
Joined: Wed May 03, 2017 5:54 am

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by mcornhill » Mon Jun 12, 2017 12:38 am

Thank you knnniggett, your help is greatly appreciated. This fixed my problem!

martianable
Posts: 4
Joined: Thu Jun 08, 2017 3:21 pm

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by martianable » Mon Jun 12, 2017 11:19 am

Well hello and good morning / wishing a good week to all viewers - it's Monday !! ( after a long weekend ! )
I am also getting errors from ZM - just like the previous posters and I am sorry to say I am completely snowed after building 3 ZM jails on FreeNAS according to the instructions found in the circulating PDF created by Al Mello ( june 2016 ) -
  • 1st try was a package install and everything is up and running except for being able to see the images when looking at the camera - ( a broken link shows )
  • the other 2 jails have been installed from ports ( both took so long I fell asleep and they bombed near the end - ugh )
I have tried to find the answer to the problem of zm not displaying the images from the camera SV3C 1080P Full HD Poe IP Camera, Bullet Outdoor Security Camera with 2.8MM-12MM Varifocal Lens ( https://www.amazon.com/dp/B01N2R5THA/_e ... 9M704HYWB )

I am getting errors just like reported here in this post
"Socket /var/run/zm/zms-112003s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information. "

I have been following many posts but as an example cannot finde my apache2 folder ( running nginx ? ) so I am unable to find a place to insert the 'scriptAlias' code as mentioned in other posts - I have been able to affect a few other settings, from other posts, however nothing has been effective.

Just to be clear, I am getting capture records in the logfile and can see jpgs when they are downloaded, just no live video or images when clicking on the camera link from the web gui

I am getting nowhere - Please help - thank you in advance.

rockedge
Posts: 1147
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by rockedge » Mon Jun 12, 2017 12:05 pm

your problem involves the /cgi-bin. Somewhere your web server config is not correctly declaring the /cgi-bin and so zms and nph-zms are not found hence no live stream but the camera(s) are connected and images are created.
There is a difference using ZM with different web servers when it comes to how this configuration is done. Significant differences between using Apache or nginx or one of my favorites, Hiawatha, when setting up ZM.

martianable
Posts: 4
Joined: Thu Jun 08, 2017 3:21 pm

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by martianable » Mon Jun 12, 2017 7:47 pm

rockedge wrote:
Mon Jun 12, 2017 12:05 pm
your problem involves the /cgi-bin. Somewhere your web server config is not correctly declaring the /cgi-bin and so zms and nph-zms are not found hence no live stream but the camera(s) are connected and images are created.
There is a difference using ZM with different web servers when it comes to how this configuration is done. Significant differences between using Apache or nginx or one of my favorites, Hiawatha, when setting up ZM.
Thank you rockedge ! I appreciate your quick response - I will begin searching how to 'use ZM with Nginx' or 'declaring the /cgi-bin in Nginx' or the like I suppose. Thanks Again !! I'll probably be right back with more questions -

martianable
Posts: 4
Joined: Thu Jun 08, 2017 3:21 pm

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by martianable » Tue Jun 20, 2017 12:52 pm

Well, I am back to ask for more info and need someone's help - I have not found a solution yet though I have been trying hard to do so. Please help - thanks -
I am wondering how the /cgi-bin needs to be setup so I can view images properly in the web interface - here is a summary of my project so far:

I am having the same problem as many - images are being saved but there is no image showing in the web interface when clicking on a particular camera. Here is what I have done so far ( also have done the install several times in different jails in FreeNAS - I've tried different methods of resolution from other posts too )

I am still getting a broken image placeholder when I click on the camera monitor under ZoneMinder. arghhh - I am frustrated because I am sure this is something simple -

Here is what I am trying to do exactly:

Run ZoneMinder on Freenas

system: Build FreeNAS-9.10.2-U1 (86c7ef5)
Platform Intel(R) Xeon(R) CPU 5110 @ 1.60GHz
Memory 8161MB
Load Average 0.88, 0.76, 0.69

I built the jail from the FN console - nothing special /
I did NOT add Storage using the FN Jail Gui as others have suggested here ( post 194 from joshua Parker Ruehlig on 7/2/2016)
I followed the pkg install instructions to the letter from here:
Zoneminder 1.30 FreeBSD Installation and configuration - (links to a PDF on google drive)
Version: 1.02 dated 6/23/2016 ( * thanks Melloa * )
I did NOT modify FSTAB as recommended on page 12 of Melloa's Doc. - FSTAB / tmpfs /tmp tmpfs rw,nosuid,mode=01777 0 0 ( becasue fstab was empty )
I did correct the path as recommended by other posts - ZM web Gui / Options / Paths - PATH_ZMS = /zm/cgi-bin/nph-zms

The Good News
ZM is up and running ( just like the first build ) - I have the web front end and can add CAMS
The Cams work in ZM - capturing / motion detection / etc
I can save images on an alert as is designed - I can download them in a zip file

The Bad News
When clicking on a Cam I still get a broken image placeholder and the error log shows :
getCmdResponse stream error: Socket /var/run/zm/zms-898367s.sock does not exist. This file is created by zms, and since it does not exist, either zms did not run, or zms exited early. Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly. Make sure that ZM is actually recording. If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zoneminder.readthedocs.io/en...- ... window-etc for more information. - checkStreamForErrors()

In this thread rockedge said something about CGI not working correctly - a path issue ?

Any help would be appreciated - I have also posted this information in the FreeNAS forums, requesting help there as well - and I am posting here in the event the fix is related to a configuration or setting particular to the Camera I am using: an SV3C POE Cam with varifocal lens

- https://www.amazon.com/dp/B01N2R5THA/re ... szbE6EGND8

Ok that's all I have - again thanks

rockedge
Posts: 1147
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by rockedge » Tue Jun 20, 2017 2:21 pm

the /cgi-bin directory that contains the program zms and the symlink nph-zms. These are needed to to see a live stream. The /cgi-bin needs to be declared or assigned an alias, as is done in Apache or Hiawatha in the configuration file. This also is the case with nginx. So I think that your issue involves the path to the /cgi-bin....which on my system which is at the moment Puppy Linux Tahr 6.0.6 (Ubuntu 14.04 binaries), lives at /usr/lib/zoneminder/cgi-bin and is aliased to http://your_server/cgi-bin.

look at Options->Paths->Path_ZMS....does this path match the alias setup in your web servers config?
I definitely think your problem involves this issue in someway.

farolone
Posts: 1
Joined: Wed Jul 19, 2017 12:39 pm

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by farolone » Wed Jul 19, 2017 12:45 pm

Hi, yesterday I had the same problem. You cannot see either picture of the recorded streams:

in FreeBSD change the owner of the socket file from root:wheel to the following:

nano /usr/local/etc/rc.d/fcgiwrap

Code: Select all

fcgiwrap_socket_owner=${fcgiwrap_socket_owner:-"www"}
fcgiwrap_socket_group=${fcgiwrap_socket_group:-"www"}
then restart. Eventually you will have to create the directory

Code: Select all

mkdir /var/run/fcgiwrap
and chown it to www:www:

Code: Select all

chown -R  www:www /var/run/fcgiwrap
kind regards.

Aen5quai
Posts: 4
Joined: Wed Nov 16, 2011 11:36 am

Re: Infinite Race: /var/run/zm/zms-307984w.sock does not exist / already in use

Post by Aen5quai » Sat Sep 16, 2017 10:21 am

I've this issue with this settings (see attachments). And may be more:
1. if an alarm accours, then ZM start record and don't stop, while not restart zm service.
2. if I set "Reference Image Blend %ge" and "Alarm Reference Image Blend %ge" to 6.25%, then it's works fine
Logs:

Code: Select all

[Sat Sep 16 12:26:57.342781 2017] [:error] [pid 6033] [client 172.16.0.112:41573] PHP Notice:  Undefined variable: remSocketFile in /usr/share/zoneminder/www/ajax/strea
m.php on line 55, referer: https://www.example.com/zm/?view=event&eid=5296&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3E%3D&filter[terms][0][val]=-1+hour&filte
r[terms][1][cnj]=and&filter[terms][1][attr]=MonitorId&filter[terms][1][op]=%3D&filter[terms][1][val]=1&sort_field=StartTime&sort_asc=0&page=1
[Sat Sep 16 12:26:57.351963 2017] [:error] [pid 6033] [client 172.16.0.112:41573] ERR [Socket  does not exist.  This file is created by zms, and since it does not exist
, either zms did not run, or zms exited early.  Please check your zms logs and ensure that CGI is enabled in apache and check that the PATH_ZMS is set correctly.  Make
sure that ZM is actually recording.  If you are trying to view a live stream and the capture process (zmc) is not running then zms will exit. Please go to http://zonemi
nder.readthedocs.io/en/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information.], referer: https://www.linsys.
ru/zm/?view=event&eid=5296&filter[terms][0][attr]=DateTime&filter[terms][0][op]=%3E%3D&filter[terms][0][val]=-1+hour&filter[terms][1][cnj]=and&filter[terms][1][attr]=Mo
nitorId&filter[terms][1][op]=%3D&filter[terms][1][val]=1&sort_field=StartTime&sort_asc=0&page=1
Attachments
screen64-1.png
screen64-1.png (14.72 KiB) Viewed 15709 times
screen63-1.png
screen63-1.png (19.81 KiB) Viewed 15709 times
screen62-1.png
screen62-1.png (21.64 KiB) Viewed 15709 times

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests