Blank image and errors in logs

Forum for questions and support relating to the 1.30.x releases only.
Locked
BurningSky
Posts: 16
Joined: Sun Jun 25, 2017 7:57 pm

Blank image and errors in logs

Post by BurningSky »

Hi,

I just installed Zoneminder v1.30.4 on Ubuntu 16.04 following the "Easy Way" guide. I have added a camera, a Wansview Q2, and when I go to the monitor page it is just blank.

I looked in the logs and saw the errors below, so I read the FAQ and unfortunately I don't really understand the fix. I don't think the IE part applies as I am only using Chrome so it must be the 2nd part.

Errors:

Code: Select all

getStreamCmdResponse stream error: Socket /var/run/zm/zms-594670s.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/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information. - checkStreamForErrors()

Socket /var/run/zm/zms-594670s.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/latest/faq.html#why-can-t-i-see-streamed-images-when-i-can-see-stills-in-the-zone-window-etc for more information.
This is what's set in apache:

Code: Select all

cat /etc/apache2/conf-enabled/zoneminder.conf 
# Remember to enable cgi mod (i.e. "a2enmod cgi").
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
The cgi folder looks correct to my untrained eye

Code: Select all

burningsky@ubuntu:~$ sudo ls /usr/lib/zoneminder/cgi-bin
nph-zms  zms
The PATH_ZMS path is set to "/cgi-bin/nph-zms". Am I overlooking something?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Blank image and errors in logs

Post by rockedge »

Hello! which fix are you referring to? There is probably a easy fix for your issue. This sounds very much like a /cgi-bin alias configuration error somewhere in the setup.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Blank image and errors in logs

Post by bbunge »

Your PATH_ZMS is wrong. Go back to the WIKI instructions and look for the IMPORTANT FINAL STEP. It has been there for quite a while!
BurningSky
Posts: 16
Joined: Sun Jun 25, 2017 7:57 pm

Re: Blank image and errors in logs

Post by BurningSky »

rockedge, it was the 2nd one.

bbunge, you are right, I completely missed those. I got to the line "Congratulations Your installation is complete" and finished there. I did look at that bit but seeing as I hadn't even opened the web front end by then it didn't mean much to me. I also missed the bit about default db user and password. I am assuming this is the mysql user? I remember what password I set but it didn't ask me for a user. Should I create a separate one for ZM to use? And where is the zm.conf file it refers to?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Blank image and errors in logs

Post by rockedge »

zm.conf is here: /etc/zm/zm.conf
the default database user is "zmuser"
the default password is "zmpass". these are for establishing a connection to the mysql db and can be changed.
BurningSky
Posts: 16
Joined: Sun Jun 25, 2017 7:57 pm

Re: Blank image and errors in logs

Post by BurningSky »

Thanks for your help, I managed to get the images up and running
BurningSky
Posts: 16
Joined: Sun Jun 25, 2017 7:57 pm

Re: Blank image and errors in logs

Post by BurningSky »

I have moved my images and events folders to an NFS share mounted through fstab following this guid: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive. I am having issues with the permissions and I think it might be to do with the permissions for the www-data user and group. On my NAS I created a user and group both called www-data and gave them write permissions on the folder. My Qnap doesn't allow (to my knowledge) the ability to change the uid and gid through the web client so I had to try and manually change it in the /etc/passwd and /etc/group files. The gid on the nas seems to have reset to 100 though.

Is it possible to change the uid and gid for www-data to a different number or is there a better way to get the nfs share mounted so I can use it?
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Blank image and errors in logs

Post by bbunge »

BurningSky wrote: Mon Jun 26, 2017 2:06 pm I have moved my images and events folders to an NFS share mounted through fstab following this guid: https://wiki.zoneminder.com/Using_a_ded ... Hard_Drive. I am having issues with the permissions and I think it might be to do with the permissions for the www-data user and group. On my NAS I created a user and group both called www-data and gave them write permissions on the folder. My Qnap doesn't allow (to my knowledge) the ability to change the uid and gid through the web client so I had to try and manually change it in the /etc/passwd and /etc/group files. The gid on the nas seems to have reset to 100 though.

Is it possible to change the uid and gid for www-data to a different number or is there a better way to get the nfs share mounted so I can use it?
Suggest using systemd to mount the drive. See: https://wiki.zoneminder.com/Common_Issu ... ive_or_NAS

And the instructions in the readthedocs site are out of date. Use the WIKI instructions:https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way
BurningSky
Posts: 16
Joined: Sun Jun 25, 2017 7:57 pm

Re: Blank image and errors in logs

Post by BurningSky »

I've tried following the cifs mount but I'm getting the error below, any thoughts what it means?

Code: Select all

root@ubuntu:# cat /etc/systemd/system/recordings.mount 
# systemd mount unit for ZoneMinder event storage
 
[Unit]
Description=systemd mount unit for ZoneMinder event storage
After=networking.service
Before=zoneminder
 
[Mount]
What=//192.168.0.20/Recordings
Where=/smb/recordings
Type=cifs
Options=credentials=/root/.smbcredentials,uid=33,gid=33,rw
 
[Install]
WantedBy=multi-user.target
root@ubuntu:# systemctl status recordings.mount
● recordings.mount - systemd mount unit for ZoneMinder event storage
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
    Where: /smb/recordings
     What: //192.168.0.20/Recordings

Jun 26 21:11:16 ubuntu systemd[1]: [/etc/systemd/system/recordings.mount:6] Failed to add dependency on zoneminder, ignoring: Invalid argument
Jun 26 21:11:16 ubuntu systemd[1]: recordings.mount: Where= setting doesn't match unit name. Refusing.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Blank image and errors in logs

Post by bbunge »

BurningSky wrote: Mon Jun 26, 2017 8:32 pm I've tried following the cifs mount but I'm getting the error below, any thoughts what it means?

Code: Select all

root@ubuntu:# cat /etc/systemd/system/recordings.mount 
# systemd mount unit for ZoneMinder event storage
 
[Unit]
Description=systemd mount unit for ZoneMinder event storage
After=networking.service
Before=zoneminder
 
[Mount]
What=//192.168.0.20/Recordings
Where=/smb/recordings
Type=cifs
Options=credentials=/root/.smbcredentials,uid=33,gid=33,rw
 
[Install]
WantedBy=multi-user.target
root@ubuntu:# systemctl status recordings.mount
● recordings.mount - systemd mount unit for ZoneMinder event storage
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
    Where: /smb/recordings
     What: //192.168.0.20/Recordings

Jun 26 21:11:16 ubuntu systemd[1]: [/etc/systemd/system/recordings.mount:6] Failed to add dependency on zoneminder, ignoring: Invalid argument
Jun 26 21:11:16 ubuntu systemd[1]: recordings.mount: Where= setting doesn't match unit name. Refusing.
Well, it looks like you did not follow the instructions! Back up and try again.
BurningSky
Posts: 16
Joined: Sun Jun 25, 2017 7:57 pm

Re: Blank image and errors in logs

Post by BurningSky »

You're right, I think the program I was using was messing up the files as I copied and pasted using putty and it worked first time.

1 final question for now. Is there a built in method of putting a schedule in place for when motion detection is enabled? I have found some posts for older versions about scripts that run to change the function but not much referenced for the newer version.
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Blank image and errors in logs

Post by bbunge »

BurningSky wrote: Tue Jun 27, 2017 8:02 am You're right, I think the program I was using was messing up the files as I copied and pasted using putty and it worked first time.

1 final question for now. Is there a built in method of putting a schedule in place for when motion detection is enabled? I have found some posts for older versions about scripts that run to change the function but not much referenced for the newer version.
What you are looking for is called Run State. I have set Run States for day and night on systems. I wanted cameras to do mocord in certain areas during day but modect at night. Then I set a cron job to switch the Run State based on time. I also install Webmin so I can have a good GUI to do settings without impacting system performance.
Locked