Can't view camera images

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
llamafilm
Posts: 1
Joined: Wed May 26, 2021 6:33 am

Can't view camera images

Post by llamafilm »

Hello. I'm brand new to Zoneminder. I already had a server running on Ubuntu 20.14 with nginx and PHP 7.4 so I installed Zoneminder on that. I added a monitor and the source IP turned green, so I believe it's connected. But the thumbnail shows an error question mark. First I was getting an access denied error, which I fixed by setting security.limit_extensions to a blank value in /etc/php/7.4/fpm/pool.d/www.conf. After fixing that, the console error is this:
getStreamCmdResponse stream error: Socket /run/zm/zms-162560s.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
Is there something wrong with my nginx config file? It's like this, I only changed the CGI path for my PHP version

Code: Select all

server {
  listen 81;
  location /zm/cgi-bin {
      gzip off;
      alias /usr/lib/zoneminder/cgi-bin;

      include /etc/nginx/fastcgi_params;
      fastcgi_param SCRIPT_FILENAME $request_filename;
      fastcgi_pass        unix:/var/run/php/php7.4-fpm.sock;

  }

  location /zm {
  #   if ($scheme ~ ^http:){
  #       rewrite ^(.*)$  https://$host$1 permanent;
  #   }

      gzip off;
      alias                   /usr/share/zoneminder/www;
      index                   index.php;

      location ~ \.php$ {
          if (!-f $request_filename) { return 404; }
          expires             epoch;
          include             /etc/nginx/fastcgi_params;
          fastcgi_param       SCRIPT_FILENAME         $request_filename;
          fastcgi_index       index.php;
	  fastcgi_pass        unix:/var/run/php/php7.4-fpm.sock;
      }

      location ~ \.(jpg|jpeg|gif|png|ico)$ {
          access_log          off;
          expires         33d;
      }
  }
}
In /var/log/zm/zmc_m1.log I see this which seems like a good sign:

Code: Select all

05/25/21 23:55:01.358734 zmc_m1[790148].INF-zm_monitor.cpp/1663 [Front: 2000 - Capturing at 19.90 fps, capturing bandwidth 208225bytes/sec]
05/25/21 23:55:05.145038 zmc_m1[790151].INF-zm_monitor.cpp/1704 [Front: 1800 - Analysing at 4.35 fps from 445 - 420=25 / 1622012105.145030 - 1622012099.399291 = 5.745739]
Trying to run zmc manually fails:

Code: Select all

$ sudo zmc -m 1
05/25/21 23:57:11.845281 zmc_m1[791086].ERR-zm_monitor.cpp/916 [Can't open memory map file /dev/shm/zm.mmap.1: Permission denied]
05/25/21 23:57:11.845553 zmc_m1[791086].WAR-zmc.cpp/243 [Couldn't connect to monitor 1]
05/25/21 23:57:11.845793 zmc_m1[791086].ERR-zm_signal.cpp/49 [Got signal 11 (Segmentation fault), crashing]
05/25/21 23:57:11.846005 zmc_m1[791086].ERR-zm_signal.cpp/79 [Signal address is 0x58, from 0x5619dfbd9a16]
05/25/21 23:57:11.846706 zmc_m1[791086].ERR-zm_signal.cpp/100 [Backtrace 0: zmc(+0xc4bba) [0x5619dfc60bba]]
05/25/21 23:57:11.847009 zmc_m1[791086].ERR-zm_signal.cpp/100 [Backtrace 1: /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0) [0x7fc2cc1623c0]]
05/25/21 23:57:11.847275 zmc_m1[791086].ERR-zm_signal.cpp/100 [Backtrace 2: zmc(+0x3da16) [0x5619dfbd9a16]]
05/25/21 23:57:11.847459 zmc_m1[791086].ERR-zm_signal.cpp/100 [Backtrace 3: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fc2c99900b3]]
05/25/21 23:57:11.847635 zmc_m1[791086].ERR-zm_signal.cpp/100 [Backtrace 4: zmc(+0x4048e) [0x5619dfbdc48e]]
That file /dev/shm/zm.mmap.1 does exist. It contains about 18MB of binary.
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Can't view camera images

Post by bbunge »

Use these instructions for a guide. Make changes, PHP version, as needed: https://wiki.zoneminder.com/Ubuntu_Serv ... .2C_PHP.29

But, your issue may reside here:

Change the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/

nano /etc/zm/conf.d/01-system-paths.conf
rizarefaldi
Posts: 1
Joined: Sat Jun 05, 2021 4:25 pm

Re: Can't view camera images

Post by rizarefaldi »

bbunge wrote: Thu May 27, 2021 3:18 pm Use these instructions for a guide. Make changes, PHP version, as needed: https://wiki.zoneminder.com/Ubuntu_Serv ... .2C_PHP.29

But, your issue may reside here: ukuran a4

Change the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/

nano /etc/zm/conf.d/01-system-paths.conf
nice, got the same issue but fixed by that solution.
Donatellodzg
Posts: 1
Joined: Mon Jan 23, 2023 3:08 pm

Re: Can't view camera images

Post by Donatellodzg »

bbunge wrote: Thu May 27, 2021 3:18 pm Use these instructions for a guide. Make changes, PHP version, as needed: https://wiki.zoneminder.com/Ubuntu_Serv ... .2C_PHP.29

But, your issue may reside here: Ukuran A4

Change the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/

nano /etc/zm/conf.d/01-system-paths.conf
Thank for sharing bro.
night-gold
Posts: 7
Joined: Mon May 15, 2023 11:04 am

Re: Can't view camera images

Post by night-gold »

bbunge wrote: Thu May 27, 2021 3:18 pm Use these instructions for a guide. Make changes, PHP version, as needed: https://wiki.zoneminder.com/Ubuntu_Serv ... .2C_PHP.29

But, your issue may reside here:

Change the ZM_PATH_ZMS in the 01-system-paths.conf file to /cgi-bin/nph-zms by dropping the /zm/

nano /etc/zm/conf.d/01-system-paths.conf
Thank you, I have been trying to understand what was wrong in my apache configuration for more than an hour and it was just that.
Post Reply