Just upgraded to 1.32.3 from 1.30.4 and getting mmap errors

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Just upgraded to 1.32.3 from 1.30.4 and getting mmap errors

Post by SpikeyGG »

Everything seems to be in order but when I try to start ZM, the log instantly fills with errors like this:

Code: Select all

2019-04-21 12:44:37	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:37	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:37	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:36	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl	
2019-04-21 12:44:35	zmtrigger		28037	ERR	Memory map file '/dev/shm/zm.mmap.3' should have been 1160 but was instead 0	zmtrigger.pl
I see files in /dev/shm and /run/shm:

Code: Select all

> ls -la /run/shm/
total 316648
drwxrwxrwt  2 www-data www-data        80 Apr 21 12:39 .
drwxr-xr-x 22 root     root          4720 Apr 21 11:59 ..
-rw-------  1 www-data www-data 414727752 Apr 21 12:39 zm.mmap.3
-rw-------  1 www-data www-data         0 Apr 21 12:39 zm.mmap.5
>

Code: Select all

> ls -la /dev/shm/
total 810016
drwxrwxrwt  2 www-data www-data        80 Apr 21 12:37 .
drwxr-xr-x 22 root     root          4720 Apr 21 11:59 ..
-rw-------  1 www-data www-data 414727752 Apr 21 12:37 zm.mmap.3
-rw-------  1 www-data www-data 414727752 Apr 21 12:37 zm.mmap.5
The web page front end doesn't show that the service is running (though it is), none of the cameras are online and I suspect it's because the logs are dumping these error messages out. How do I fix the err memory map issue?

Thanks,
-Greg
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Just upgraded to 1.32.3 from 1.30.4 and getting mmap errors

Post by SpikeyGG »

More detail... I found out how to enable the log directory in the new version, so I set that up. I went through the instructions found here for configuring ZoneMinder to make sure my system is set up to those specifications... I don't know what I'm missing.

When I start the service, I see that those mmap files get created and the log files start stacking up with errors. If I kick off the service and let it run for a few seconds and then kill it this is what I see in the logs:

Code: Select all

> ls -la
total 36
drwxr-xr-x  2 www-data root     4096 Apr 21 17:26 .
drwxrwxr-x 25 root     syslog   4096 Apr 21 16:47 ..
-rw-r--r--  1 www-data www-data  131 Apr 21 17:26 zma_m3.log
-rw-r--r--  1 www-data www-data  131 Apr 21 17:26 zma_m5.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmaudit.log
-rw-r--r--  1 www-data www-data  266 Apr 21 17:26 zmc_m3.log
-rw-r--r--  1 www-data www-data  546 Apr 21 17:26 zmc_m5.log
-rw-r--r--  1 www-data www-data  210 Apr 21 17:26 zmdc.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmfilter_1.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmfilter_2.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmfilter_3.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmfilter_5.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmpkg.log
-rw-r--r--  1 www-data www-data 2832 Apr 21 17:27 zms_m3.log
-rw-r--r--  1 www-data www-data 2478 Apr 21 17:27 zms_m5.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmstats.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmtelemetry.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmtrigger.log
-rw-r--r--  1 www-data www-data    0 Apr 21 17:26 zmwatch.log
> cat zma_m3.log
04/21/19 17:26:20.954659 zma_m3[8296].ERR-zm_monitor.cpp/477 [Shared data not initialised by capture daemon for monitor Back Yard]
> cat zma_m5.log
04/21/19 17:26:21.304676 zma_m5[8305].ERR-zm_monitor.cpp/477 [Shared data not initialised by capture daemon for monitor West Yard]
> cat zmc_m3.log
04/21/19 17:26:23.328714 zmc_m3[8290].ERR-zm_ffmpeg_camera.cpp/511 [Can't find codec for video stream from rtsp://user:pw@192.168.0.71:554/h264Preview_01_main]
04/21/19 17:26:23.329209 zmc_m3[8290].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
> cat zmc_m5.log
04/21/19 17:26:23.041410 zmc_m5[8300].ERR-zm_ffmpeg_camera.cpp/511 [Can't find codec for video stream from rtsp://user:pw@192.168.0.72:554/h264Preview_01_main]
04/21/19 17:26:23.041998 zmc_m5[8300].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
04/21/19 17:26:33.053589 zmc_m5[8300].ERR-zm_ffmpeg_camera.cpp/357 [Unable to open input rtsp://user:pw@192.168.0.72:554/h264Preview_01_main due to: Interrupted system call]
04/21/19 17:26:33.054222 zmc_m5[8300].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
> cat zmdc.log
04/21/2019 17:26:20.956821 zmdc[8253].ERR [ZMServer:694] ['zma -m 3' exited abnormally, exit status 255]
04/21/2019 17:26:21.306834 zmdc[8253].ERR [ZMServer:694] ['zma -m 5' exited abnormally, exit status 255]
> head zms_m3.log
04/21/19 17:26:07.931851 zms_m3[8167].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
04/21/19 17:26:07.932194 zms_m3[8167].ERR-zm_stream.cpp/48 [Unable to connect to monitor id 3 for streaming]
04/21/19 17:26:07.932440 zms_m3[8167].ERR-zms.cpp/254 [Unable to connect to zmc process for monitor 3]
04/21/19 17:26:17.907755 zms_m3[8190].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
04/21/19 17:26:17.908026 zms_m3[8190].ERR-zm_stream.cpp/48 [Unable to connect to monitor id 3 for streaming]
04/21/19 17:26:17.908222 zms_m3[8190].ERR-zms.cpp/254 [Unable to connect to zmc process for monitor 3]
04/21/19 17:26:37.927711 zms_m3[8437].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
04/21/19 17:26:37.928121 zms_m3[8437].ERR-zm_stream.cpp/48 [Unable to connect to monitor id 3 for streaming]
04/21/19 17:26:37.928289 zms_m3[8437].ERR-zms.cpp/254 [Unable to connect to zmc process for monitor 3]
04/21/19 17:26:47.929852 zms_m3[8452].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
> head zms_m5.log
04/21/19 17:26:07.928730 zms_m5[8168].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
04/21/19 17:26:07.929105 zms_m5[8168].ERR-zm_stream.cpp/48 [Unable to connect to monitor id 5 for streaming]
04/21/19 17:26:07.929268 zms_m5[8168].ERR-zms.cpp/254 [Unable to connect to zmc process for monitor 5]
04/21/19 17:26:17.904561 zms_m5[8191].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
04/21/19 17:26:17.904919 zms_m5[8191].ERR-zm_stream.cpp/48 [Unable to connect to monitor id 5 for streaming]
04/21/19 17:26:17.905088 zms_m5[8191].ERR-zms.cpp/254 [Unable to connect to zmc process for monitor 5]
04/21/19 17:26:47.926965 zms_m5[8453].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
04/21/19 17:26:47.927345 zms_m5[8453].ERR-zm_stream.cpp/48 [Unable to connect to monitor id 5 for streaming]
04/21/19 17:26:47.927519 zms_m5[8453].ERR-zms.cpp/254 [Unable to connect to zmc process for monitor 5]
04/21/19 17:26:57.915888 zms_m5[8463].ERR-zm_monitor.cpp/538 [Got empty memory map file size 0, is the zmc process for this monitor running?]
>
Based on this information, it looks like my problem is that zma dies because it can't init the shared data. Is there a way to confirm that the shared data is working correctly? I see the /dev/shm files get created when starting the service and all the permissions appear to be correct. What else can I check?

Code: Select all

> grep shm /etc/sysctl.d/*
/etc/sysctl.d/20-shared-memory.conf:kernel.shmall = 16777216
/etc/sysctl.d/20-shared-memory.conf:kernel.shmmax = 8388608000
> cat /proc/sys/kernel/shmmax /proc/sys/kernel/shmall
8388608000
16777216
>
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Just upgraded to 1.32.3 from 1.30.4 and getting mmap errors

Post by SpikeyGG »

I also, just tried the urls for both cameras from within VLC from another machine and they both stream perfectly. So the url is correct:

Code: Select all

rtsp://user:pw@192.168.0.71:554/h264Preview_01_main
I just made it work using ffmpeg on the same machine that zoneminder is on, so I know ffmpeg is good to go:

Code: Select all

ffmpeg -rtsp_transport tcp -i rtsp://user:pw@192.168.0.71:554/h264Preview_01_main -f image2 -vf fps=fps=1 img%03d.png
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

Re: Just upgraded to 1.32.3 from 1.30.4 and getting mmap errors

Post by SpikeyGG »

After reading through some really old threads in the 1.32.x area of the forum, I came to realize that many other people had this same experience with upgrading to 1.32.x. I decided that it must be a bug in the software that (hopefully) was fixed on a newer version. So I made the jump to using 1.33.x pointing the master: https://launchpad.net/~iconnor/+archive ... der-master

In 1.33.6 all my Reolink rtsp cameras are working again! I hope this helps some of you guys who have also had this issue...
Post Reply