FUBAR after last update - Arch

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

FUBAR after last update - Arch

Post by Onion »

Hi

I have had no end of problems lately with updating my system and Zoneminder breaking but after the last update it is totally broken and I can not fix it.

I was on version 1.30 and I got this error after the update.

Code: Select all

Sep 28 12:44:06 arch zmwatch[1541]: ERR [Can't open memory map file '/dev/shm/zm.mmap.1': Permission denied] Sep 28 12:44:06 arch zmwatch[1541]: INF [Restarting capture daemon for Monitor-1, shared data not valid] Sep 28 12:44:06 arch zmdc[952]: INF ['zmc -m 1' starting at 18/09/28 12:44:06, pid = 3240] Sep 28 12:44:06 arch zmdc[3240]: INF ['zmc -m 1' started at 18/09/28 12:44:06] Sep 28 12:44:06 arch zmdc[952]: ERR ['zmc -m 1' exited abnormally, exit status 127] Sep 28 12:44:16 arch zmwatch[1541]: ERR [Can't open memory map file '/dev/shm/zm.mmap.1': Permission denied] Sep 28 12:44:16 arch zmwatch[1541]: INF [Restarting capture daemon for Monitor-1, shared data not valid] Sep 28 12:44:16 arch zmdc[3251]: INF ['zmc -m 1' started at 18/09/28 12:44:16] Sep 28 12:44:16 arch zmdc[952]: INF ['zmc -m 1' starting at 18/09/28 12:44:16, pid = 3251] Sep 28 12:44:16 arch zmdc[952]: ERR ['zmc -m 1' exited abnormally, exit status 127]
I then tried a clean install using 1.32, fresh install PHP and running under Nginx, removed apache.
Same error:-

Code: Select all

2018-09-30 21:20:31 zmwatch 21857 ERR Memory map file '/dev/shm/zm.mmap.1' does not exist. zmc might not be running. zmwatch.pl
2018-09-30 21:20:27 zmdc 21797 ERR 'zmc -m 1' exited abnormally, exit status 127 zmdc.pl
I only updated the system to get this error, I did not change anything in my camera, zoneminder php, apache. here is a list of the packages which were updated:

-

Code: Select all

rw-r--r-- 1 root root     308456 Sep 28 08:15 brotli-1.0.6-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root    1020860 Sep 28 08:23 librsvg-2:2.44.6-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root      45128 Sep 28 12:52 ed-1.14.2-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root       9988 Sep 28 12:52 libsigsegv-2.12-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root      60932 Sep 28 12:52 zziplib-0.13.69-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root      87192 Sep 28 12:52 potrace-1.15-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root   12248040 Sep 28 12:52 texlive-bin-2018.47465-3-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root  152369384 Sep 28 12:52 texlive-core-2018.48566-1-any.pkg.tar.xz
-rw-r--r-- 1 root root     356224 Sep 28 12:52 nasm-2.13.03-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root    3619720 Sep 28 12:52 doxygen-1.8.14-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root      12236 Sep 28 12:52 perl-locale-gettext-1.07-6-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root     167940 Sep 28 12:52 help2man-1.47.7-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root   13247848 Sep 28 12:52 opencl-nvidia-410.57-2-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root      20556 Sep 28 12:52 egl-wayland-1.1.0-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root   41807564 Sep 28 12:52 nvidia-utils-410.57-2-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root       7084 Sep 28 12:52 eglexternalplatform-1.0+3+g7c8f8e2-1-any.pkg.tar.xz
-rw-r--r-- 1 root root      71724 Sep 28 12:52 opencl-headers-2:2.2.20170516-1-any.pkg.tar.xz
-rw-r--r-- 1 root root      47604 Sep 28 12:52 ffnvcodec-headers-8.1.24.2-2-any.pkg.tar.xz
-rw-r--r-- 1 root root    3568744 Sep 28 12:52 gavl-1.4.0-3-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root     388016 Sep 28 12:52 frei0r-plugins-1.6.1-5-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root    1013568 Sep 28 12:52 leptonica-1.76.0-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root    4305800 Sep 28 12:52 tesseract-3.05.01-6-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root     253424 Sep 28 12:52 zimg-2.7.5-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root      94648 Sep 28 12:52 sndio-1.5.0-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root    1255004 Sep 28 12:52 crypto++-7.0.0-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root    7658204 Sep 28 12:52 gcc7-libs-7.3.1+20180814-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root   27584448 Sep 28 12:52 gcc7-7.3.1+20180814-1-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root 1380898716 Sep 28 12:53 cuda-10.0.130-2-x86_64.pkg.tar.xz
-rw-r--r-- 1 root root     309040 Sep 28 12:53 gtest-1.8.1-2-x86_64.pkg.tar.xz
Anybody have a clue what has happened?

Many thanks
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: FUBAR after last update - Arch

Post by iconnor »

Norally zm runs are the user that apache runs as, which is often www-data or apache on redhat based distros.

Since you are running nginx that may be something you need to be aware of.

In any event, zmc and the other perl scripts need to be able to create and access files at /dev/shm
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

Re: FUBAR after last update - Arch

Post by Onion »

Thanks iconnor for your reply

I had a look at the Arch guide for both Apache and Nginx and see both users are http.

I can create files in /dev/shm as user http

Code: Select all

ian@arch:/dev/shm$ l
-rw-r--r-- 1 http http    0 Oct  1 16:23 zonemindertest.txt
Apache was working but stopped after the Linux update something has busted it and I have no idea what im looking for.

Is there any clues to what this actually means is there a debug mode I can use to find out?

Code: Select all

zmwatch 21857 ERR Memory map file '/dev/shm/zm.mmap.1' does not exist. zmc might not be running. zmwatch.pl
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: FUBAR after last update - Arch

Post by Nocifer »

Hey,

I can't help but ask, did you upgrade on your own or have you used the new PKGBUILD I've posted in the AUR page's comments?

If the former, then make sure that ZoneMinder itself is launched as user 'http' by systemd (or whatever means you use to launch it) and then verify that when ZoneMinder is running there is actually a file /dev/shm/zm.mmap.1 and that it has the correct permissions, i.e. http:http.

If the latter, and judging by the second error you posted (ERR 'zmc -m 1' exited abnormally, exit status 127 zmdc.pl) this seems to be the case, then this is simply a ZoneMinder bug. See here:

https://github.com/ZoneMinder/zoneminder/issues/2184

The fix (a workaround really) has already been upstreamed and will probably be included in the next ZoneMinder release (1.32.1). In the meantime you can apply the fix yourself by editing the file '/usr/bin/zmdc.pl' and changing line 485 from

'my $fd = 0;'

to

'my $fd = 3;'
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

Re: FUBAR after last update - Arch

Post by Onion »

I found the problem with /dev/shm I ran the zmc -m 1 as user http and found libidn was the issue.

I fixed that but now I see no image in the monitor page, but it intermittently says it is capturing but there is no streaming display , just lots of "ERR Unable to send packet at frame 1667: Resource temporarily unavailable, continuing zm_ffmpeg_camera.cpp"

2018-10-01 19:41:42 zmc_m1 2818 ERR Unable to send packet at frame *: Resource temporarily unavailable, continuing zm_ffmpeg_camera.cpp 240
2018-10-01 19:41:34 zmfilter_2 1329 INF Checking filter Update DiskSpace update disk space returned 0 events zmfilter.pl
2018-10-01 19:41:34 zmfilter_1 1306 INF Checking filter PurgeWhenFull delete returned 0 events zmfilter.pl
2018-10-01 19:41:30 zmc_m1 2818 INF Monitor-1: images:1600 - Capturing at 4.76 fps, capturing bandwidth 918991bytes/sec zm_monitor.cpp


I changed the file/usr/bin/zmdc.pl but no fix for streaming in ZM, I can make a movie using

ffmpeg -i "rtsp://un:pws@***.***.*.**:***/h264Preview_01_main" -vframes 1000 out.avi
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: FUBAR after last update - Arch

Post by Nocifer »

What was the problem with libidn and how did you end up fixing it? And this new error about packet frames, have you encountered it before? I'm asking because I was able to fix the /dev/shm/ issue by simply changing that line in /usr/bin/zmdc.pl, and now ZoneMinder works correctly. Perhaps messing around with libidn broke something else?
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

Re: FUBAR after last update - Arch

Post by Onion »

I think there was a problem from running update must have been interupted as after I reinstalled libidn the /dev/shm error went away and I could start zmc -m 1 as http.

Now I got rid of the "ERR Unable to send packet at frame *: Resource temporarily unavailable, continuing zm_ffmpeg_camera.cpp 240"

I changed the band width to medium and that made them go away.

I cannot get the monitor to display the stream and I have no errors!!!

I am guessing this is pointing towards the nginx config file?

This is in /etc/nginx/sites-enabled/zoneminder.conf
server {
listen 8095;
server_name localhost;

root /srv/zoneminder/www;

location /cache {
gzip off;

root /var/lib/zoneminder;
}

location /cgi-bin {
gzip off;

include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/fcgiwrap.sock;
}

location / {
gzip off;

index index.php;

location /api {
rewrite ^/api(.+)$ /api/index.php?p=$1 last;
}

location ~ \.php$ {
if (!-f $request_filename) { return 404; }

expires epoch;

include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
}

location ~ \.(txt|log)$ {
deny all;
}

location ~ \.(jpg|jpeg|gif|png|ico)$ {
access_log off;
expires 33d;
}

location ~ \.(m4a|mp4|mov)$ {
mp4;
mp4_buffer_size 5M;
mp4_max_buffer_size 10M;
}
}
}
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

Re: FUBAR after last update - Arch

Post by Onion »

Is there a command line I can run to see the stream from zmc?
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

Re: FUBAR after last update - Arch

Post by Onion »

I can view the stream from zms in vlc with

http://localhost:8095/cgi-bin/nph-zms?m ... uffer=1000


So thats good just need to work out why zoneminder is not displaying the stream?
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: FUBAR after last update - Arch

Post by Nocifer »

The AUR package has just been updated. Please upgrade to the latest version and see if your issues are resolved.
Onion
Posts: 11
Joined: Mon Oct 01, 2018 6:21 am

Re: FUBAR after last update - Arch

Post by Onion »

No didnt fix it, no image in monitor just lots of errors as before

2018-10-02 20:47:38 zmc_m1 14359 ERR Unable to send packet at frame 7006: Resource temporarily unavailable, continuing zm_ffmpeg_camera.cpp 240
2018-10-02 20:47:38 zmc_m1 14359 ERR Unable to send packet at frame 7006: Resource temporarily unavailable, continuing zm_ffmpeg_camera.cpp 240
2018-10-02 20:47:37 zmc_m1 14359 ERR Unable to send packet at frame 7006: Resource temporarily unavailable, continuing zm_ffmpeg_camera.cpp 240
2018-10-02 20:47:35 zmc_m1 14359 INF Monitor-1: images:7000 - Capturing at 4.55 fps, capturing bandwidth 636180bytes/sec
Post Reply