blank zones image: Shared data not initialised by capture...

Forum for questions and support relating to the 1.28.x releases only.
Locked
ummmcam
Posts: 2
Joined: Sun Apr 19, 2015 4:57 am

blank zones image: Shared data not initialised by capture...

Post by ummmcam »

Hi guys, this forum makes it very difficult to post in given I can't post "offsite links", and the "board attachment quota has been reached". :?

I've been reading through here extensively and I know there is a lot of discussion about the log message: "

Code: Select all

Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor mon1	zm_monitor.cpp	426
" being unimportant or related to various other issues but I have yet to find a topic or answer that can solve this for me.

My issue is I have 3 monitors (2 are in use currently). I have good video from them and they capture events without a problem, I can review the captures. The only problem is when I click to add/edit the zones of the cameras from the console I get a blank image (with the chrome 'not found icon').

First off here is my setup:

Code: Select all

user@host:/var/log/apache2$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.2 LTS
Release:	14.04
Codename:	trusty

Code: Select all

user@host:/$ sudo apt-cache policy zoneminder
zoneminder:
  Installed: 1.28.1-trusty-1
  Candidate: 1.28.1-trusty-1
  Version table:
 *** 1.28.1-trusty-1 0
        500 offsite link amd64 Packages
        100 /var/lib/dpkg/status
     1.26.5-1ubuntu3 0
        500 offsite link amd64 Packages

Code: Select all

user@host:/etc/zm$ cat zm.conf 
# ==========================================================================
#
# ZoneMinder Base Configuration, $Date$, $Revision$
#
# ==========================================================================
#
# This file is generated by 'configure'. Care should be taken if manually
# editing this file as an changes may be overwritten by subsequent configuration
# or installations.
#

# Path to installed data directory, used mostly for finding DB upgrade scripts
ZM_PATH_DATA=/usr/share/zoneminder

# Path to ZoneMinder binaries
ZM_PATH_BIN=/usr/bin

# Path to ZoneMinder libraries (none at present, for future use)
ZM_PATH_LIB=/usr/lib/x86_64-linux-gnu

# Path to ZoneMinder configuration (this file only at present)
ZM_PATH_CONF=/etc/zm

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

# Path to ZoneMinder cgi files
ZM_PATH_CGI=/usr/lib/cgi-bin

# Username and group that web daemon (httpd/apache) runs as
ZM_WEB_USER=www-data
ZM_WEB_GROUP=www-data

# ZoneMinder database type: so far only mysql is supported
ZM_DB_TYPE=mysql

# ZoneMinder database hostname or ip address
ZM_DB_HOST=localhost

# ZoneMinder database name
ZM_DB_NAME=zm

# ZoneMinder database user
ZM_DB_USER=zmuser

# ZoneMinder database password
ZM_DB_PASS=zmpass

# Host of this machine
ZM_SERVER_HOST=

Code: Select all

user@host:/etc/zm$ cat apache.conf
Alias /zm /usr/share/zoneminder

<Directory /usr/share/zoneminder>
  php_flag register_globals off
  Options Indexes FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>
The directories where zoneminder events and stuff are stores. I don't think its a permissions problem as you can see:

Code: Select all

user@host:/usr/share/zoneminder$ ls -la
total 132
drwxr-xr-x  13 www-data www-data  4096 Apr 19 00:52 .
drwxr-xr-x 222 root     root     12288 Mar 30 21:27 ..
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 ajax
-rwxrwxr-x   1 www-data www-data 62936 Jul 26  2014 cambozola.jar
lrwxrwxrwx   1 www-data www-data    17 Feb 17 10:31 cgi-bin -> ../../lib/cgi-bin
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 css
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 db
lrwxrwxrwx   1 www-data www-data    28 Feb 17 10:31 events -> /var/cache/zoneminder/events
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 graphics
lrwxrwxrwx   1 www-data www-data    28 Feb 17 10:31 images -> /var/cache/zoneminder/images
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 includes
-rw-r--r--   1 www-data www-data  4543 Feb 17 10:31 index.php
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 js
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 lang
drwxr-xr-x   6 www-data www-data  4096 Apr 19 00:52 skins
drwxr-xr-x   2 www-data www-data  4096 Feb 17 10:31 sounds
lrwxrwxrwx   1 www-data www-data    26 Feb 17 10:31 temp -> /var/cache/zoneminder/temp
drwxr-xr-x   3 www-data www-data  4096 Apr 19 00:52 tools
drwxr-xr-x   2 www-data www-data  4096 Apr 19 00:52 views

Code: Select all

user@host:/var/cache/zoneminder$ ls -la
total 20
drwxr-xr-x  5 www-data www-data 4096 Apr 19 00:52 .
drwxr-xr-x 19 root     root     4096 Mar 30 21:20 ..
drwxrwxr-x  5 www-data www-data 4096 Jan 25 17:40 events
drwxrwxr-x  2 www-data www-data 4096 Apr 12 22:03 images
drwxr-xr-x  2 www-data www-data 4096 Feb 17 10:31 temp
This is the closest forum topic I could find but didn't seem to help.
http://www.zoneminder.com/forums/viewto ... emon+zones

As soon as I click the zones link I get the following in the zoneminder log:

Code: Select all

2015-04-19 08:05:41.149088	zma_m1	1672	INF	mon1: 3000 - Processing at 12.99 fps	zm_monitor.cpp	1160
2015-04-19 08:05:40.988191	zmc_m1	1668	INF	mon1: 3000 - Capturing at 12.99 fps	zm_monitor.cpp	2907
2015-04-19 08:05:10.967813	zmu	2057	INF	Terminating Logger	zm_logger.cpp	235
2015-04-19 08:05:10.908114	zmu	2057	WAR	Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor mon1	zm_monitor.cpp	426
2015-04-19 08:05:10.857818	zmu	2057	INF	Authenticated user 'user'	zm_user.cpp	241
/var/syslog

Code: Select all

Apr 19 08:03:55 localhost zmu[2048]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor mon1]
/var/apache2/error.log
Unable to post, due to "offsite links" but there didn't look like there was anything helpful in it. Let me know if this would make a difference for you and I'll figure out a way to post it.

This is reproducible with both cameras and happens every time. I don't THINK it is a permissions problem because I have made everything I can think of belong to the www-data user and group and even made the images director 777 which I would prefer not to do of course.

I'm a bit at a loss right now, I wish the logs were more detailed so I could pinpoint where it goes wrong. I looked through the source code but I am not very knowledgable in programming and minimally knowledgable in php. It seems the error is coming from this section in the zm_monitor.cpp:

Code: Select all

  if ( ( ! mem_ptr ) || ! shared_data->valid )
    {
        if ( purpose != QUERY )
        {
            Error( "Shared data not initialised by capture daemon for monitor %s", name );
            exit( -1 );
        }
        else
        {
            Warning( "Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor %s", name );
        }
    }

	// Will this not happen everytime a monitor is instantiated?  Seems like all the calls to the Monitor constructor pass a zero for n_zones, then load zones after..
    if ( !n_zones ) {
		Debug( 1, "Monitor %s has no zones, adding one.", name );
        n_zones = 1;
        zones = new Zone *[1];
        Coord coords[4] = { Coord( 0, 0 ), Coord( width-1, 0 ), Coord( width-1, height-1 ), Coord( 0, height-1 ) };
        zones[0] = new Zone( this, 0, "All", Zone::ACTIVE, Polygon( sizeof(coords)/sizeof(*coords), coords ), RGB_RED, Zone::BLOBS );
    }
    start_time = last_fps_time = time( 0 );

    event = 0;
Any more suggestions on what to try or thoughts on what is going on would be much appreciated.

Thanks!
Cam
ummmcam
Posts: 2
Joined: Sun Apr 19, 2015 4:57 am

Re: blank zones image: Shared data not initialised by captur

Post by ummmcam »

I found the problem. I don't remember if I changed the path from something else but it seems that the images path was outside the web root.

According to the apache.conf file the alias points as follows:
Alias /zm /usr/share/zoneminder

Within /usr/share/zoneminder there is a symlink to /var/cache/zoneminder/images

Even though both are writable and owned by www-data it was outside the webroot according to apache so it was not being served. By changing the path in the configuration utility to just 'images' instead of '/var/cache/zoneminder/images' I was able to see the images in the zones editor.

The weird thing is the events folder is still set as '/var/cache/zoneminder/events' in the config but seems to work just fine.

Also, this did not get rid of the log entry:

Code: Select all

Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results for monitor mon1
So the symptoms described in the original post were likely unrelated to it.

Hopefully this helps someone in the future, I have literally been using zoneminder for 2 years without the zones image function because I couldn't find the correct forum topic.
px03afk
Posts: 77
Joined: Wed Nov 30, 2011 4:53 pm

Re: blank zones image: Shared data not initialised by captur

Post by px03afk »

I've just hit the same problem and I got the message about shared data not being initialized, but I had already read elsewhere that that error was a bit of red herring. Initially I couldn't see what was happening with the images directory but then I found that it was in the wrong place, probably my fault. However in the process I actually found an error message in the system messages file which was reasonably indicative of the problem:

ttpd2-prefork[32068]: PHP Warning: chdir(): No such file or directory (errno 2) in /srv/www/htdocs/zoneminder/skins/classic/views/zones.php on line 29

I'm guessing that php errors don't get posted to the zm log file. If they should then something is wrong.
Locked