Unable to view event & create s.sock files

Forum for questions and support relating to the 1.25.x releases only.
Post Reply
fri.K
Posts: 4
Joined: Tue Jul 26, 2011 7:53 pm

Unable to view event & create s.sock files

Post by fri.K » Wed Oct 26, 2011 9:25 pm

Hi, for some time (maybe since -3500?) I can't view events.
When I start to play event (middle network usage), I see black window with text

Code: Select all

Time to next event = 1 seconds
Then in debug log I get

Code: Select all

zm_debug.log.10604:10/26/11 22:52:53.876232 web_php[10604].ERR [socket_sendto( /tmp/zm/zms-712705s.sock ) failed: No such file or directory] at includes/functions.php line 2322
But in same time

Code: Select all

ll /tmp/zm
razem 3756
drwxrwxrwx  2 www-data www-data    4096 2011-10-26 22:52 ./
drwxrwxrwt 62 root     root       20480 2011-10-26 22:52 ../
-rw-r--r--  1 www-data www-data       0 2011-10-26 22:50 zmaudit.log
-rw-r--r--  1 www-data www-data    1032 2011-10-26 22:50 zmdc.log
srwxr-xr-x  1 www-data www-data       0 2011-10-26 22:50 zmdc.sock=
-rw-r--r--  1 www-data www-data      67 2011-10-26 22:50 zmfilter.log
-rw-r--r--  1 www-data www-data      59 2011-10-26 22:50 zmpkg.log
srwxr-xr-x  1 www-data www-data       0 2011-10-26 22:52 zms-712705w.sock=    <---
When I switch to high net usage i see first image of event but it doesn't run. There is no "socet_sendto" error in log but:

Code: Select all

# ll -h /tmp/zm
razem 14M
drwxrwxrwx  2 www-data www-data 4,0K 2011-10-26 23:01 ./
drwxrwxrwt 62 root     root      20K 2011-10-26 23:00 ../
-rw-r--r--  1 www-data www-data    0 2011-10-26 22:50 zmaudit.log
-rw-r--r--  1 www-data www-data 1,1K 2011-10-26 22:50 zmdc.log
srwxr-xr-x  1 www-data www-data    0 2011-10-26 22:50 zmdc.sock=
-rw-r--r--  1 www-data www-data   67 2011-10-26 22:50 zmfilter.log
-rw-r--r--  1 www-data www-data   59 2011-10-26 22:50 zmpkg.log
srwxr-xr-x  1 www-data www-data    0 2011-10-26 22:58 zms-027347s.sock=
srwxr-xr-x  1 www-data www-data    0 2011-10-26 23:01 zms-704233w.sock=
srwxr-xr-x  1 www-data www-data    0 2011-10-26 22:57 zms-878201s.sock=
After while sock= files are auto removed.

OS: Ubuntu 11.04 x86_64
kernel: 2.6.38
ZM: 1.25.0-3500
Two cams: 1x bttv, 1x http

Recording and motion detection is working ok, streaming in high and middle is also ok, making video of event is ok.

So is there bug with names mismatch: w != s and last character "="?

-----
Edit 1
I read code a bit. Now I know that it spose to be two sock files w.sock and s.sock. Before s.sock file appears for a second and die, now it doesn't appear at all.
I renamed my 1.25 database and made default one. Now I'm unable to see stream either. I modified code to see more in debug log. Fist I modified ajax/stream.php - there is no much to see - it able to access w.sock file, gets some connkey and unable find s.sock file.
Then I modified src/zm_stream.cpp

Code: Select all

void StreamBase::openComms()
{
    if ( connkey > 0 )
    {
        sd = socket( AF_UNIX, SOCK_DGRAM, 0 );
        if ( sd < 0 )
        {
            Fatal( "Can't create socket: %s", strerror(errno) );
            Debug(3, "openComms() Cant create sd ");
        }

        snprintf( loc_sock_path, sizeof(loc_sock_path), "%s/zms-%06ds.sock", config.path_socks, connkey );
        
        Debug(3, "openComms() Unlinking loc_sock_path: %s ", loc_sock_path);
        unlink( loc_sock_path );

        strncpy( loc_addr.sun_path, loc_sock_path, sizeof(loc_addr.sun_path) );
        loc_addr.sun_family = AF_UNIX;
        if ( bind( sd, (struct sockaddr *)&loc_addr, strlen(loc_addr.sun_path)+sizeof(loc_addr.sun_family)) < 0 )
        {
            Fatal( "Can't bind socket: %s", strerror(errno) );
        }

        snprintf( rem_sock_path, sizeof(rem_sock_path), "%s/zms-%06dw.sock", config.path_socks, connkey );
        strncpy( rem_addr.sun_path, rem_sock_path, sizeof(rem_addr.sun_path) );
        rem_addr.sun_family = AF_UNIX;
    }
}

void StreamBase::closeComms()
{
	Debug(3, "closeComms() Attempting to close sockets");
    if ( connkey > 0 )
    {
        if ( sd >= 0 )
        {
        		Debug(3, "closeComms() Closing sd ");
            close( sd );
            sd = -1;
        }
        if ( loc_sock_path[0] )
        {
        		Debug(3, "closeComms() Unlinking loc_sock_path: %s ", loc_sock_path);
            unlink( loc_sock_path );
        }
    }
}
compiled and repleced in proper path but there is no any "closeComms" word in logs, why?
--------
Edit 2
I switched to 1.24.2-8 (Ubuntu package), now I able to see live jpeg stream but no mpeg stream in browser - mpeg plays well in Totem.
There is steel "socket_sendto( /tmp/zm/zms-399721s.sock ) failed: Connection refused, " issue, but this time s.sock files are created and newer destroyed:

Code: Select all

ll
razem 56
drwxr-xr-x  5 www-data www-data  4096 2011-11-01 10:24 ./
drwxrwxrwt 41 root     root     20480 2011-11-01 11:05 ../
drwxr-xr-x  2 www-data www-data  4096 2011-11-01 09:27 log/
-rw-r--r--  1 www-data www-data     0 2011-11-01 09:40 zmaudit.log
-rw-r--r--  1 www-data www-data  1557 2011-11-01 09:40 zmdc.log
srwxr-xr-x  1 www-data www-data     0 2011-11-01 09:40 zmdc.sock=
-rw-r--r--  1 www-data www-data   198 2011-11-01 09:40 zmfilter.log
-rw-r--r--  1 www-data www-data    58 2011-11-01 09:40 zmpkg.log
srwxr-xr-x  1 www-data www-data     0 2011-11-01 10:21 zms-177825s.sock=
srwxr-xr-x  1 www-data www-data     0 2011-11-01 09:57 zms-235785s.sock=
srwxr-xr-x  1 www-data www-data     0 2011-11-01 10:16 zms-399721s.sock=
srwxr-xr-x  1 www-data www-data     0 2011-11-01 09:50 zms-413119s.sock=
srwxr-xr-x  1 www-data www-data     0 2011-11-01 10:14 zms-497295s.sock=
srwxr-xr-x  1 www-data www-data     0 2011-11-01 10:21 zms-624466s.sock=
srwxr-xr-x  1 www-data www-data     0 2011-11-01 10:04 zms-965676s.sock=
drwxr-xr-x  8 www-data www-data  4096 2011-11-01 10:23 zmswap-m1/
drwxr-xr-x  3 www-data www-data  4096 2011-11-01 10:22 zmswap-m3/
-rw-r--r--  1 www-data www-data   420 2011-11-01 09:40 zmwatch.log
So it seems to be operating system/http server related?

Jason_Bassett
Posts: 42
Joined: Wed Mar 05, 2008 10:33 pm
Location: Stanford-Le-Hope, Thurrock, Essex
Contact:

Re: Unable to view event & create s.sock files

Post by Jason_Bassett » Mon Nov 21, 2011 5:09 pm

Seems similar to my issue, did you get this sorted out 1.25.0?

My Apache logs show the following when I try to view a monitor:

[Sat Nov 19 19:57:32 2011] [error] [client 172.16.1.210] ERR [socket_sendto( /tmp/zm/zms-862166s.sock ) failed: No such file or directory], referer: http://myhomepc/index.php?view=watch&mid=2

The /tmp/zm folder exists with just 1 file in it (zmdc.sock) and the /tmp/zm/zms-862166s.sock file is created and destroyed every five seconds or so.

Images are being recorded and stored and I can see the preview image when I go into the zone configuration area.

Jason
Corrilan IT Consultancy Ltd
http://www.corrilan.com
01375 403508
enquiries@corrilan.com

Classic
Posts: 16
Joined: Mon Aug 02, 2010 10:48 pm

Re: Unable to view event & create s.sock files

Post by Classic » Sun Apr 08, 2012 1:06 am

Hi, can you resolv it? i have the same problem, but only when i want stream mpeg (swf)...

Jason_Bassett
Posts: 42
Joined: Wed Mar 05, 2008 10:33 pm
Location: Stanford-Le-Hope, Thurrock, Essex
Contact:

Re: Unable to view event & create s.sock files

Post by Jason_Bassett » Sun Apr 08, 2012 11:29 am

Not yet, I have abandoned by Zoneminder box at the moment in favor of tinkering with MythTV and Airtime. When I get it going I will post my findings though.

J
Corrilan IT Consultancy Ltd
http://www.corrilan.com
01375 403508
enquiries@corrilan.com

_saiko
Posts: 16
Joined: Wed Apr 04, 2012 8:48 pm

Re: Unable to view event & create s.sock files

Post by _saiko » Sun Apr 08, 2012 6:13 pm

Same problem here regarding the ERR socket_sendto in my logs.

timmans
Posts: 3
Joined: Sat Jul 18, 2009 1:48 pm

Re: Unable to view event & create s.sock files

Post by timmans » Sat Apr 28, 2012 5:42 pm

Has anybody got a answer to this problem?

I am running Ubuntu Server 12.04 with Zoneminder 1.25 installed from the software centre. I have so far reinstalled it twice and have got the same problem:

2012-04-28 13:08:01.708001 web_php 19296 ERR socket_sendto( /tmp/zm/zms-988694s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2322
2012-04-28 13:07:55.684833 web_php 19296 ERR socket_sendto( /tmp/zm/zms-988694s.sock ) failed: No such file or directory /usr/share/zoneminder/includes/functions.php 2322



Interestingly I have installed Zoneminder on Ubuntu Desktop 12.04 and it works fine.

Classic
Posts: 16
Joined: Mon Aug 02, 2010 10:48 pm

Re: Unable to view event & create s.sock files

Post by Classic » Tue May 01, 2012 1:45 am

really? you don`t change anything...only the dist? it`s so rare...please check an tellus if you see some diference can explain that...(sorry for my english...)

Classic
Posts: 16
Joined: Mon Aug 02, 2010 10:48 pm

Re: Unable to view event & create s.sock files

Post by Classic » Wed May 02, 2012 3:06 am

after try many times with different configuration, i think this error it`s about shared memory, because when i set mpeg(swf) low resolution and 1/2 scale work well,more than this, not work, maybe the ffmpeg encoder need more memory for create swf live stream, because with asf work ok, but have buffering and swf not.
In other post I read the solution it`s configure zoneminder with mmap enable, but i test it on ubuntu server 11.10 64 bits version 1.25.0 with quad core 9550 and 8g ram (1600 mhz bus) with only one cam axis 207 in 640x480 and not work!
well, i`m keep trying, any news i post here..

piglet_74
Posts: 5
Joined: Thu May 03, 2012 11:43 am

Re: Unable to view event & create s.sock files

Post by piglet_74 » Fri May 04, 2012 12:07 pm

I'm also getting a similar error. I have had a few installations of zoneminder over the years. This time I was building a system using the 12.04 Beta version of ubuntu. It worked well for a few weeks. I made the mistake of messing with ffmpeg and apt-get uninstalled my zm install. I tried re-installing and started having problems with all sorts of stuff. So I downloaded the latest 12.04 and tried a clean install. I started noticing the error every 5 seconds or so and the w.sock file being created in the /tmp/zm/ folder. When I try to watch live video I get unable to authenticate user in the log file.

I tried upgrading php to 5.4 dev but that made the main page completely useless. I tried re-installing from the beta cd I made but the problems are still there. I'm wondering when php 5.3.10 was released and if that's the issue. I've tried to install 5.3.9 but don't know how to make zm use that instead of 5.4 since apt-get puts that on the machine when I install zoneminder. I also tried to build zm from source but failed make with errors about zm_local_camera or something and didn't have the time to chase it down.

If anyone has any ideas on how to get 5.3.9 running with zm 1.25 I'd like to give it a try just don't know how.

Thanks, Rob.

cbagwell
Posts: 4
Joined: Sat Jun 16, 2012 1:59 am

Re: Unable to view event & create s.sock files

Post by cbagwell » Sat Jun 30, 2012 6:24 pm

piglet_74 wrote:I'm also getting a similar error. I have had a few installations of zoneminder over the years. This time I was building a system using the 12.04 Beta version of ubuntu. It worked well for a few weeks. I made the mistake of messing with ffmpeg and apt-get uninstalled my zm install. I tried re-installing and started having problems with all sorts of stuff. So I downloaded the latest 12.04 and tried a clean install. I started noticing the error every 5 seconds or so and the w.sock file being created in the /tmp/zm/ folder. When I try to watch live video I get unable to authenticate user in the log file.
I was having similar issues and the solution turned out more related to the "unable to authenticate" message then it was to the socket. The socket message just shows up more in the log file.

Based on hints in other threads, I traced issue down to at least AUTH_RELAY setting in options. If you set to "plain" or "none" then it started working.

I reviewed zm_user.cpp, were authentication is occuring when in default "hash" mode. I noticed among other items, its including the current hour in hash string. Finally, I tracked down PHP to default to UTC timezone and so its hash was based on wildly different hours.

The fix for me was to edit /etc/php.ini, uncomment the date.timezone line and and; in my case; change the line 'date.timezone = America/Chicago'.

Now the hash is built with matching hour+date.

Chris

piglet_74
Posts: 5
Joined: Thu May 03, 2012 11:43 am

Re: Unable to view event & create s.sock files

Post by piglet_74 » Wed Jul 04, 2012 2:23 pm

Thanks for the reply. I'm looking forward to backing up my 1.24 install now and trying 1/25 again. Thanks, Rob.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests