Cannot veiw some events

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
jono
Posts: 5
Joined: Mon Aug 02, 2021 12:01 am

Cannot veiw some events

Post by jono »

Problem: zm is recording events but I can only view some of the events, maybe only 1/4 of all events listed for each camera.

I have previously experimented with zomeminder on my ubuntu desktop, but have now installed on a fresh ubuntu 20.04 server. So not yet very familiar with zm. Server hardware = HP Pro 630 SFF box, i5, 8Gb ram (DDR3 1600), OS on a 500Gb HDD, 1000Gb HDD mounted at /video for zoneminder events/recording. Two H265 2MP/1920x1080 cameras connected Ffmpeg, RTSP, TCP, 32bit colour, 640x400, Image Buffer Size (frames) = 5.

I can view live camera streams 1) in the console view as thumbnails, 2) in montage view, and 3) when expanded to view individual camera. Zm is recording events (shows for each camera and have thumbnails in events screen, and files are written in /video/). I can view some events without problem, but when I mouse hover over other events the pop-up expanded preview thumbnail does not show an image but rather just states "event 1247" etc, and clicking through opens a window that fails to open the event stream.

So, some events are viewable and some are not. the majority are not. Can anyone point me in the right direction to solve this? Many thanks.

Error logs:

2021-08-02 13:00:18 web_js 11869 ERR getCmdResponse stream error: Socket /run/zm/zms-983968s.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() ?view=event&eid=1247&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=MonitorId&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=3&sort_field=StartDateTime&sort_asc=1&page=1 -

2021-08-02 13:00:14 web_php 16699 ERR Socket /run/zm/zms-983968s.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.



sudo nano /etc/apache2/conf-enabled/zoneminder.conf
# Remember to enable cgi mod (i.e. "a2enmod cgi").
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>


sudo nano /etc/zm/conf.d/01-system-paths.conf
# ZoneMinder url path to the zms streaming server
ZM_PATH_ZMS=/zm/cgi-bin/nph-zms
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Cannot veiw some events

Post by kitkat »

When this happened to me, it was caused by PHP's date.timezone setting being different from the server's timezone.

Check php.ini in case there's a duplicate entry, and also check "Timezone" on the Options -> System page (available in later versions for ZM - I noticed it in 1.36.5 but it may have appeared in an earlier version)
bbunge
Posts: 2950
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Cannot veiw some events

Post by bbunge »

Your 1 TB drive mounted at /video, does it contain a sub folder such as events? (/video/events) if not it should and make sure the events folder has permissions for www-data That is full read write permissions and ownership.

Better install instructions: https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.36.x

I have also discovered that Debian 10 server performs a bit better than Ubuntu server with all the snap and cloud crap.
jono
Posts: 5
Joined: Mon Aug 02, 2021 12:01 am

Re: Cannot veiw some events

Post by jono »

kitkat wrote: Mon Aug 02, 2021 11:44 am When this happened to me, it was caused by PHP's date.timezone setting being different from the server's timezone.

Check php.ini in case there's a duplicate entry, and also check "Timezone" on the Options -> System page (available in later versions for ZM - I noticed it in 1.36.5 but it may have appeared in an earlier version)
Thanks for the response. Yes, I initially did have a timezone issue, but I have then made sure that the system, mysql and zm timezones are all set the same.

I have now found all the php.ini files (three of them) and uncommented date.timezone and set it Pacific/Auckland like all other timezone values.

So I don't think that that is the cause at this point in time.?

Regards,
Jono
Last edited by jono on Tue Aug 03, 2021 6:17 am, edited 1 time in total.
jono
Posts: 5
Joined: Mon Aug 02, 2021 12:01 am

Re: Cannot veiw some events

Post by jono »

bbunge wrote: Mon Aug 02, 2021 4:47 pm Your 1 TB drive mounted at /video, does it contain a sub folder such as events? (/video/events) if not it should and make sure the events folder has permissions for www-data That is full read write permissions and ownership.

Better install instructions: https://wiki.zoneminder.com/Ubuntu_Serv ... der_1.36.x
Thanks for your response.

/video did not contain an events directory, but I have added it now and given it permissions. Rebooted all. Zm is still writing to the /video directory, setting up sub-directories under the camera ID number (rather than the camera name (which it had done initially).

I changed the names of the cameras, and zm started writing to new folders under new camera names, and it seems to have improved the problem, i.e. it seems that I can access more event playbacks. But zm is still writing in the /video folder, not anything written to /video/events.

Regards
Jono
jono
Posts: 5
Joined: Mon Aug 02, 2021 12:01 am

Re: Cannot veiw some events

Post by jono »

If someone can please provide the correct content/syntax for that new configuration file [ZoneMinder System Paths Configuration] and tell me where to put it, etc, etc, that would be very much appreciated!
===

In the error logs it instructs:
Response stream error: Socket /run/zm/zms-114864s.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...."

Please go to http://zoneminder.readthedocs.io/en/lat ... window-etc for more information.
Following the link, it instructs:
Why can’t I see streamed images when I can see stills in the zone window etc?

This issue is normally down to one of two causes

2) The other common cause for being unable to view streams is that you have installed the ZoneMinder cgi binaries (zms and nph-zms) in a different directory than your web server is expecting. Make sure that the –with-cgidir option you use to the ZoneMinder configure script is the same as the CGI directory configure for your web server. If you are using Apache, which is the most common one, then in your httpd.conf file there should be a line like ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" where the last directory in the quotes is the one you have specified. If not then change one or the other to match. Be warned that configuring apache can be complex so changing the one passed to the ZoneMinder configure (and then rebuilding and reinstalling) is recommended in the first instance. If you change the apache config you will need to restart apache for the changes to take effect.If you still cannot see stream reliably then try changing ZM_PATH_ZMS in your /etc/zm/config directory to just use zms if nph-zms is specified, or vice versa.Also check in your apache error logs.
So, in my /etc/zm/conf.d/01-system-paths.conf it says, # ZoneMinder url path to the zms streaming server ZM_PATH_ZMS=/zm/cgi-bin/nph-zms.

I therefore wish to edit to remove the nph.

But in that file it states in the header comments
# ==========================================================================
#
# ZoneMinder System Paths Configuration
#
# ==========================================================================
#
# This config file contains the variables previously found under Options -> Paths
#
# *** DO NOT EDIT THIS FILE ***
#
# To make custom changes to the variables below, create a new configuration
# file, with an extention of .conf, containing your desired modifications.
#
#

If someone can please provide the correct content/syntax for that new configuration file, and tell me where to put it, etc, etc, that would be very much appreciated!

Regards
Jono
jono
Posts: 5
Joined: Mon Aug 02, 2021 12:01 am

Re: Cannot veiw some events

Post by jono »

No, I was wrong, it has not improved, still cannot access majority of events.

Jono
dougmccrary
Posts: 1320
Joined: Sat Aug 31, 2019 7:35 am
Location: San Diego

Re: Cannot veiw some events

Post by dougmccrary »

Unfortunately, much of what you've been fighting doesn't apply to 1.35.

Try Image Buffer Size (frames) = 5 to = 0 = unlimited.

The stuff about " web_php 16699 ERR Socket /run/zm/zms-983968s.sock does not exist. This file is created by zms, a..." just means you switched away from the camera or montage live view. They should probably change that message.
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Cannot veiw some events

Post by kitkat »

jono wrote: Tue Aug 03, 2021 3:52 am If someone can please provide the correct content/syntax for that new configuration file [ZoneMinder System Paths Configuration] and tell me where to put it, etc, etc, that would be very much appreciated!
You need to create a new file containing only the paths you want to change, and then put that file in /etc/zm/conf.d

I think it needs to be named such that it loads after and overrides 01-system-paths.conf in that same directory - I went with my-system-paths.conf

This is what's in it:

Code: Select all

# Full path to the folder events are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_EVENTS=/home/zoneminder/events

# Full path to the folder images, not directly associated with events,
# are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_IMAGES=/home/zoneminder/images

# Full path to the folder where exported archives are stored
# The web account user must have full read/write permission to this folder.
ZM_DIR_EXPORTS=/home/zoneminder/temp

# Full Path to ZoneMinder's socket folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SOCKS=/home/zoneminder/sock

# Full path to ZoneMinder's swap folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SWAP=/home/zoneminder/temp
And it's located here:

Code: Select all

/etc/zm/conf.d/my-system-paths.conf
bbunge
Posts: 2950
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Cannot veiw some events

Post by bbunge »

kitkat wrote: Wed Aug 04, 2021 7:15 pm
jono wrote: Tue Aug 03, 2021 3:52 am If someone can please provide the correct content/syntax for that new configuration file [ZoneMinder System Paths Configuration] and tell me where to put it, etc, etc, that would be very much appreciated!
You need to create a new file containing only the paths you want to change, and then put that file in /etc/zm/conf.d

I think it needs to be named such that it loads after and overrides 01-system-paths.conf in that same directory - I went with my-system-paths.conf

This is what's in it:

Code: Select all

# Full path to the folder events are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_EVENTS=/home/zoneminder/events

# Full path to the folder images, not directly associated with events,
# are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_IMAGES=/home/zoneminder/images

# Full path to the folder where exported archives are stored
# The web account user must have full read/write permission to this folder.
ZM_DIR_EXPORTS=/home/zoneminder/temp

# Full Path to ZoneMinder's socket folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SOCKS=/home/zoneminder/sock

# Full path to ZoneMinder's swap folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SWAP=/home/zoneminder/temp
And it's located here:

Code: Select all

/etc/zm/conf.d/my-system-paths.conf
Nope. You should not edit 01-system-paths.conf unless there is a really good reason such as setting up Zoneminder on NGINX.

In Options - Storage - Add New Storage. Enter the path to the new storage directory such as /video/events
Make sure you create a new filter to purge the new storage area of old events.
When you add a cam select the "new" storage area.
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Cannot veiw some events

Post by kitkat »

bbunge wrote: Thu Aug 05, 2021 1:20 am
kitkat wrote: Wed Aug 04, 2021 7:15 pm
jono wrote: Tue Aug 03, 2021 3:52 am If someone can please provide the correct content/syntax for that new configuration file [ZoneMinder System Paths Configuration] and tell me where to put it, etc, etc, that would be very much appreciated!
You need to create a new file containing only the paths you want to change, and then put that file in /etc/zm/conf.d

I think it needs to be named such that it loads after and overrides 01-system-paths.conf in that same directory - I went with my-system-paths.conf

This is what's in it:

Code: Select all

# Full path to the folder events are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_EVENTS=/home/zoneminder/events

# Full path to the folder images, not directly associated with events,
# are recorded to.
# The web account user must have full read/write permission to this folder.
ZM_DIR_IMAGES=/home/zoneminder/images

# Full path to the folder where exported archives are stored
# The web account user must have full read/write permission to this folder.
ZM_DIR_EXPORTS=/home/zoneminder/temp

# Full Path to ZoneMinder's socket folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SOCKS=/home/zoneminder/sock

# Full path to ZoneMinder's swap folder
# The web account user must have full read/write permission to this folder.
ZM_PATH_SWAP=/home/zoneminder/temp
And it's located here:

Code: Select all

/etc/zm/conf.d/my-system-paths.conf
Nope. You should not edit 01-system-paths.conf unless there is a really good reason such as setting up Zoneminder on NGINX.

In Options - Storage - Add New Storage. Enter the path to the new storage directory such as /video/events
Make sure you create a new filter to purge the new storage area of old events.
When you add a cam select the "new" storage area.
I'm not sure if you're agreeing with me or telling me I'm wrong :)

I didn't want to add storage but to change the default, and I did it in the way that the guide to using a dedicated partition advises by creating a new file (my-system-paths.conf) and putting the changes in there.

I did alter a couple of other paths at the same time and put them in the same file, but I think that's probably OK.
Post Reply