Socket error - failed: No such file or directory

Forum for questions and support relating to the 1.29.x releases only.
Locked
FvdLaar
Posts: 10
Joined: Sat Apr 02, 2016 12:55 pm

Socket error - failed: No such file or directory

Post by FvdLaar »

Hallo forum members,

My new Zoneminder 1.29 on Ubuntu 14.04 is working except for viewing streams (watching a monitor or replay events). I can watch individual frames and alarm detection is working fine.

After installing 1.29 from ppa::iconnor having the socket error: [socket_sendto( /var/run/zm/zms-841293s.sock ) failed: No such file or directory], referer: https:/ /www.example.com/zm/index.php?view=watch&mid=1

Can't figure out why socket is not being made!

For clean installation I followed : http://zoneminder.readthedocs.org/en/la ... buntu-14-x

Tried without success: https://bugs.launchpad.net/ubuntu/+sour ... ug/1159361 step #8

Regards,
Frank
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Socket error - failed: No such file or directory

Post by bbunge »

Another set of instructions:

https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

You may need to
Set permissions of /etc/zm/zm.conf to root:www-data 740

chmod 740 /etc/zm/zm.conf

chown root:www-data /etc/zm/zm.conf

Create a new user

adduser www-data video

Socket sento errors can be caused by several things. Restarting ZM while watching stream or montage, watching stream or montage from the same login name. Neither are really setup problems but do fill up the log with lots of red.
FvdLaar
Posts: 10
Joined: Sat Apr 02, 2016 12:55 pm

Re: Socket error - failed: No such file or directory

Post by FvdLaar »

Followed https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way at an earlier try. Didn't work for me.

Followed your suggestion to check and change permission and ownership of /etc/zm/zm.conf, but didn't help either.

I also believe it isn't a setup of config issue within the Zoneminder 1.29 parameters, but .... it used to work with Zoneminder 1.28 which I completely removed.

A solution could be starting again with Zoneminder 1.28, make it work and try to upgrade to 1.29

But I'am wondering what the difference is between 1.28 and 1.29 that might be the cause of the socket failure.

Note: I don't see any socket file being made accept for :

Code: Select all

webmanager@localhost:~$ ls /var/run/zm -al
total 4
drwxr-xr-x  2 www-data www-data  80 apr  3 18:02 .
drwxr-xr-x 25 root     root     880 apr  3 17:56 ..
srwxr-xr-x  1 www-data www-data   0 apr  3 18:02 zmdc.sock
-rw-r--r--  1 www-data www-data   5 apr  3 18:02 zm.pid
webmanager@localhost:~$
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Socket error - failed: No such file or directory

Post by bbunge »

Maybe you should start with a fresh Ubuntu install? I just ran the Ubuntu 14.04 with ZM 1.29.0 yesterday and had no issues.

As I said, it may not be ZM that is causing the socket sendto "errors" Could be your browser...
FvdLaar
Posts: 10
Joined: Sat Apr 02, 2016 12:55 pm

Re: Socket error - failed: No such file or directory

Post by FvdLaar »

The zoneminder web page is trying to open http:/ /localhost/zm/cgi-bin/nph-zms?mode=jpeg&scale=100&maxfps=5&buffer=1000&monitor=1&auth=.......

Copy-pasting this to my browser gives following: The requested URL /zm/cgi-bin/nph-zms was not found on this server.

Hence, cgi-bin seems to be the problem. I'll check apache and site config again:

/etc/zm/zm.conf

Code: Select all

# Path to ZoneMinder web files
ZM_PATH_WEB=/usr/share/zoneminder/www

# Path to ZoneMinder cgi files
ZM_PATH_CGI=/usr/lib/zoneminder/cgi-bin
Where is nph-cgi and what permissions and ownership does it have?

Code: Select all

webmanager@localhost:~$ ls /usr/lib/zoneminder/cgi-bin -al
total 1460
drwxr-xr-x 2 root root    4096 apr  2 17:05 .
drwxr-xr-x 3 root root    4096 apr  2 17:05 ..
lrwxrwxrwx 1 root root       3 feb  4 18:43 nph-zms -> zms
-rwxr-xr-x 1 root root 1485336 feb  4 18:43 zms
webmanager@localhost:~$ 
Zoneminder options, path settings:

Code: Select all

PATH_ZMS     Web path to zms streaming server (?)                                     /zm/cgi-bin/nph-zms
PATH_SOCKS   Path to the various Unix domain socket files that ZoneMinder uses (?)    /var/run/zm
FvdLaar
Posts: 10
Joined: Sat Apr 02, 2016 12:55 pm

SOLVED - Re: Socket error - failed: No such file or directory

Post by FvdLaar »

After long investigation I found out it's a webserver config mistake!

I can't and I shouldn't combine an active zoneminder.conf while having a virtual host running in which its site configuration includes "Alias /zm /usr/share/zoneminder/www"!

That messes up the objective of ScriptAlias in the zoneminder.conf

Apache2 on Ubuntu 14.04 or later:
- disable all sites (list of sites by executing command line: "sudo ls /etc/apache2/sites-enabled -al")
- enable zoneminder.conf
- restart of reload Apache

Code: Select all

sudo ls /etc/apache2/sites-enabled -al
Gives a list of site config files like follow example:
default-000.conf

Code: Select all

sudo a2dissite default-000
Repeat for all of my sites.

Code: Select all

sudo a2enconf zoneminder
To enable zoneminder.conf

Code: Select all

sudo service apache2 reload
To start webserver with new config.

Worked for me as long as I followed the regular installation instructions!

Even provides the solution for a similar problem when trying a clean install of Zoneminder on Docker on top op Ubuntu Host.

Lesson learned for this issue: DO NOT put Alias /zm directive in any of the site config files (vhosts)!
Locked