File source not working anymore

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
rpdrewes
Posts: 11
Joined: Thu Jul 20, 2017 8:08 pm

File source not working anymore

Post by rpdrewes » Sun Mar 03, 2019 4:20 am

I am not able to get file source monitors to work anymore. They used to work. My http monitors still work. I am on Ubuntu 16.04.5. I was on Zoneminder 1.32.2-xenial from iconnor ppa. I updated to 1.32.3 to try to fix this problem and that did not help.

Here is what I see. I put a jpeg file in /tmp as a test. It looks like this (for example):

# file /tmp/sj1.jpg
/tmp/sj1.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=10, height=0, manufacturer=RaspberryPi, model=RP_ov5647, xresolution=156, yresolution=164, resolutionunit=2, datetime=2019:03:01 19:28:53, width=0], baseline, precision 8, 1280x720, frames 3

I can display the file outside of Zoneminder just fine using imagemagick 'display' or 'eog' or another viewer tool and it seems fine.

In Zoneminder, I create a monitor with Source Type File and Source Path /tmp/sj1.jpg, 24 bit colour, 1280 width and 720 height, reasonable FPS etc.

I set the Function to Monitor and Enabled. When I view the monitor in Zoneminder web interface (low bandwidth), no image displays (or just a little broken image icon).

It looks like the zmc process is continually being killed and restarted because it isn't delivering images. See logs below.

I have enabled the extra debugging logs and nothing in them seemed helpful.

Again, this problem only appears for file sources. Http sources seem to work fine.

I've attached a portion of normal logs with no other monitors active. I notice that there is a Memory map file error, which sounds promising. Running ipcs -m does not seem to show any Zoneminder related share memory segments, however as I said, http monitors do work fine. All shared memory parameters seem good but it does seem odd that there are no shared memory segments owned by www-data or other Zoneminder related user.

Any suggestions for debugging this are appreciated!

Thanks,
Rich

----
Date/Time Component Server PID Level Message File Line
2019-03-02 19:48:26 zmdc 3449 INF Starting pending process, zmc -m 11 zmdc.pl
2019-03-02 19:48:26 zmdc 6733 INF 'zmc -m 11' started at 19/03/02 19:48:26 zmdc.pl
2019-03-02 19:48:26 zmdc 3449 INF 'zmc -m 11' starting at 19/03/02 19:48:26, pid = 6733 zmdc.pl
2019-03-02 19:48:26 zmc_m11 6733 INF Starting Capture version 1.32.3 zmc.cpp 223
2019-03-02 19:48:25 zmdc 3449 INF 'zmc -m 11' exited normally zmdc.pl
2019-03-02 19:48:25 zmc_m11 6557 INF Got signal 15 (Terminated), exiting zm_signal.cpp 40
2019-03-02 19:48:25 zmdc 3449 INF 'zmc -m 11' sending stop to pid 6557 at 19/03/02 19:48:25 zmdc.pl
2019-03-02 19:48:25 zmwatch 3503 INF Restarting capture daemon for Monitor-11, no image since startup. Startup time was 1551584895 - now 1551584905 > 5 zmwatch.pl
2019-03-02 19:48:23 web_js 2152 ERR Uncaught TypeError: Cannot read property 'split' of undefined blob:d5826278-83a0-48e7-b38b-bb54c2f7fa12 15
2019-03-02 19:48:23 web_js 2152 ERR undefined - getScriptLocation()
2019-03-02 19:48:15 zmwatch 3503 ERR Memory map file '/dev/shm/zm.mmap.11' does not exist. zmc might not be running. zmwatch.pl
2019-03-02 19:48:15 zmwatch 3503 INF Restarting capture daemon for Monitor-11, shared data not valid zmwatch.pl
2019-03-02 19:48:15 zmdc 3449 WAR Can't find process with command of 'zmc -m 11' zmdc.pl
2019-03-02 19:48:15 zmdc 3449 INF 'zmc -m 11' starting at 19/03/02 19:48:15, pid = 6557 zmdc.pl
2019-03-02 19:48:15 zmdc 6557 INF 'zmc -m 11' started at 19/03/02 19:48:15 zmdc.pl
2019-03-02 19:48:15 zmc_m11 6557 INF Starting Capture version 1.32.3 zmc.cpp 223
2019-03-02 19:48:05 zmdc 3449 INF Command 'zmc -m 11' removed from pending list at 19/03/02 19:48:05 zmdc.pl
2019-03-02 19:48:05 zmwatch 3503 INF Restarting capture daemon for Monitor-11, shared data not valid zmwatch.pl
2019-03-02 19:48:05 zmwatch 3503 ERR Memory map file '/dev/shm/zm.mmap.11' does not exist. zmc might not be running. zmwatch.pl
2019-03-02 19:47:55 zmwatch 3503 ERR Memory map file '/dev/shm/zm.mmap.11' does not exist. zmc might not be running. zmwatch.pl
2019-03-02 19:47:55 zmwatch 3503 INF Restarting capture daemon for Monitor-11, shared data not valid zmwatch.pl
2019-03-02 19:47:55 zmdc 3449 INF Starting pending process, zmc -m 11 zmdc.pl
2019-03-02 19:47:55 zmdc 3449 INF 'zmc -m 11' starting at 19/03/02 19:47:55, pid = 6512 zmdc.pl
2019-03-02 19:47:55 zmdc 6512 INF 'zmc -m 11' started at 19/03/02 19:47:55 zmdc.pl
2019-03-02 19:47:55 zmc_m11 6512 INF Starting Capture version 1.32.3 zmc.cpp 223
2019-03-02 19:47:55 zmdc 3449 INF 'zmc -m 11' sending stop to pid 6512 at 19/03/02 19:47:55 zmdc.pl
2019-03-02 19:47:55 zmc_m11 6512 INF Got signal 15 (Terminated), exiting zm_signal.cpp 40
2019-03-02 19:47:55 zmdc 3449 INF 'zmc -m 11' exited normally zmdc.pl
2019-03-02 19:47:51 web_js 2151 ERR Export request failed: 500 / Internal Server Error - exportFail() ?view=log
2019-03-02 19:47:48 zmfilter_2 3490 INF Checking filter Update DiskSpace update disk space returned 0 events zmfilter.pl
2019-03-02 19:47:47 zmfilter_1 3481 INF Checking filter PurgeWhenFull delete returned 0 events zmfilter.pl
2019-03-02 19:47:45 zmdc 3449 INF 'zmc -m 11' exited normally zmdc.pl
2019-03-02 19:47:45 zmc_m11 6305 INF Got signal 15 (Terminated), exiting zm_signal.cpp 40
2019-03-02 19:47:45 zmdc 3449 INF 'zmc -m 11' sending stop to pid 6305 at 19/03/02 19:47:45 zmdc.pl
2019-03-02 19:47:45 zmwatch 3503 INF Restarting capture daemon for Monitor-11, no image since startup. Startup time was 1551584850 - now 1551584865 > 5 zmwatch.pl
2019-03-02 19:47:30 zmc_m11 6305 INF Starting Capture version 1.32.3 zmc.cpp 223
2019-03-02 19:47:30 zmdc 6305 INF 'zmc -m 11' started at 19/03/02 19:47:30 zmdc.pl
2019-03-02 19:47:30 zmdc 3449 INF 'zmc -m 11' starting at 19/03/02 19:47:30, pid = 6305 zmdc.pl
2019-03-02 19:47:30 zmdc 3449 INF Starting pending process, zmc -m 11 zmdc.pl
2019-03-02 19:47:25 zmdc 3449 INF 'zmc -m 11' exited normally zmdc.pl
2019-03-02 19:47:25 zmc_m11 6276 INF Got signal 15 (Terminated), exiting zm_signal.cpp 40
2019-03-02 19:47:25 zmdc 3449 INF 'zmc -m 11' sending stop to pid 6276 at 19/03/02 19:47:25 zmdc.pl
2019-03-02 19:47:25 zmwatch 3503 INF Restarting capture daemon for Monitor-11, no image since startup. Startup time was 1551584836 - now 1551584845 > 5 zmwatch.pl
2019-03-02 19:47:16 zmc_m11 6276 INF Starting Capture version 1.32.3 zmc.cpp 223

rpdrewes
Posts: 11
Joined: Thu Jul 20, 2017 8:08 pm

Re: File source not working anymore

Post by rpdrewes » Sun Mar 03, 2019 3:03 pm

A little more information:

Though I don't see any Zoneminder shared memory segments with ipcs -m, there are some files in /dev/shm. I'm guessing the implementation changed to a different shared memory mechanism but the FAQ that suggested using ipcs to look at shared memory still references the old mechanism?

Also, if I do an strace on the running zmc process for the file source monitor, I get a trace like the one at the end of this message. It looks like the zmc process successfully reads the file from /tmp/sj1.jpg several times, receives a SIGTERM (presumably from the zmwatch process, which thinks zmc is not working), and then zmc does some database work via a socket and then gets rid of the shared memory in /dev/shm.

It looks like things are working, but somehow the image data is not getting out and zmc is getting killed and restarted after a while.

Thanks,
Rich
----
nanosleep({0, 997000000}, NULL) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP USR1 USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2], NULL, 8) = 0
stat("/tmp/sj1.jpg", {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
open("/tmp/sj1.jpg", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
read(5, "\377\330\377\341c\366Exif\0\0MM\0*\0\0\0\10\0\n\1\0\0\4\0\0\0\1\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\377\0\303\377\0\327IK\333\361\377\0?\327\374\342\222\200\27\247C\371f\222\227\34g\266q\376\177_"..., 4096) = 4096
read(5, "\24~zu\364\363\337\277\253\332\300\24QE\35\377\0\257\236\373\371k\327\260\5\24QG\365\375k\277"..., 4096) = 4096
read(5, "\5\24\177\234\321@\5\24Q@\5\24Q@\5\24Q@\5\24Q@\5\24\275\276\237\347\372\376\264\224"..., 4096) = 4096
read(5, "R\322R\0\245\364\357\355IE?\363\0\2471\4\344.\321\307\0\344\3\216q\236q\236\200\344\216\344"..., 4096) = 4096
read(5, "E\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24Q"..., 4096) = 4096
read(5, "\2\212(\247\337\177\351\365\376\267\1F0z\347\214\177S\237lc\36\371\317\34\245\24Q\376\177\347\320"..., 4096) = 4096
read(5, "\363\376\177\317\346\224\0\247\365\3569\376\277\375n\277\222R\375?\317\371\372\322P\2\366\366\377\0\17\377"..., 4096) = 3058
read(5, "", 4096) = 0
close(5) = 0
nanosleep({0, 997000000}, NULL) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP USR1 USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2], NULL, 8) = 0
stat("/tmp/sj1.jpg", {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
open("/tmp/sj1.jpg", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
read(5, "\377\330\377\341c\366Exif\0\0MM\0*\0\0\0\10\0\n\1\0\0\4\0\0\0\1\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\377\0\303\377\0\327IK\333\361\377\0?\327\374\342\222\200\27\247C\371f\222\227\34g\266q\376\177_"..., 4096) = 4096
read(5, "\24~zu\364\363\337\277\253\332\300\24QE\35\377\0\257\236\373\371k\327\260\5\24QG\365\375k\277"..., 4096) = 4096
read(5, "\5\24\177\234\321@\5\24Q@\5\24Q@\5\24Q@\5\24Q@\5\24\275\276\237\347\372\376\264\224"..., 4096) = 4096
read(5, "R\322R\0\245\364\357\355IE?\363\0\2471\4\344.\321\307\0\344\3\216q\236q\236\200\344\216\344"..., 4096) = 4096
read(5, "E\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24Q"..., 4096) = 4096
read(5, "\2\212(\247\337\177\351\365\376\267\1F0z\347\214\177S\237lc\36\371\317\34\245\24Q\376\177\347\320"..., 4096) = 4096
read(5, "\363\376\177\317\346\224\0\247\365\3569\376\277\375n\277\222R\375?\317\371\372\322P\2\366\366\377\0\17\377"..., 4096) = 3058
read(5, "", 4096) = 0
close(5) = 0
nanosleep({0, 997000000}, NULL) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP USR1 USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2], NULL, 8) = 0
stat("/tmp/sj1.jpg", {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
open("/tmp/sj1.jpg", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
read(5, "\377\330\377\341c\366Exif\0\0MM\0*\0\0\0\10\0\n\1\0\0\4\0\0\0\1\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\377\0\303\377\0\327IK\333\361\377\0?\327\374\342\222\200\27\247C\371f\222\227\34g\266q\376\177_"..., 4096) = 4096
read(5, "\24~zu\364\363\337\277\253\332\300\24QE\35\377\0\257\236\373\371k\327\260\5\24QG\365\375k\277"..., 4096) = 4096
read(5, "\5\24\177\234\321@\5\24Q@\5\24Q@\5\24Q@\5\24Q@\5\24\275\276\237\347\372\376\264\224"..., 4096) = 4096
read(5, "R\322R\0\245\364\357\355IE?\363\0\2471\4\344.\321\307\0\344\3\216q\236q\236\200\344\216\344"..., 4096) = 4096
read(5, "E\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24Q"..., 4096) = 4096
read(5, "\2\212(\247\337\177\351\365\376\267\1F0z\347\214\177S\237lc\36\371\317\34\245\24Q\376\177\347\320"..., 4096) = 4096
read(5, "\363\376\177\317\346\224\0\247\365\3569\376\277\375n\277\222R\375?\317\371\372\322P\2\366\366\377\0\17\377"..., 4096) = 3058
read(5, "", 4096) = 0
close(5) = 0
nanosleep({0, 997000000}, NULL) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP USR1 USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2], NULL, 8) = 0
stat("/tmp/sj1.jpg", {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
open("/tmp/sj1.jpg", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
read(5, "\377\330\377\341c\366Exif\0\0MM\0*\0\0\0\10\0\n\1\0\0\4\0\0\0\1\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\377\0\303\377\0\327IK\333\361\377\0?\327\374\342\222\200\27\247C\371f\222\227\34g\266q\376\177_"..., 4096) = 4096
read(5, "\24~zu\364\363\337\277\253\332\300\24QE\35\377\0\257\236\373\371k\327\260\5\24QG\365\375k\277"..., 4096) = 4096
read(5, "\5\24\177\234\321@\5\24Q@\5\24Q@\5\24Q@\5\24Q@\5\24\275\276\237\347\372\376\264\224"..., 4096) = 4096
read(5, "R\322R\0\245\364\357\355IE?\363\0\2471\4\344.\321\307\0\344\3\216q\236q\236\200\344\216\344"..., 4096) = 4096
read(5, "E\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24Q"..., 4096) = 4096
read(5, "\2\212(\247\337\177\351\365\376\267\1F0z\347\214\177S\237lc\36\371\317\34\245\24Q\376\177\347\320"..., 4096) = 4096
read(5, "\363\376\177\317\346\224\0\247\365\3569\376\277\375n\277\222R\375?\317\371\372\322P\2\366\366\377\0\17\377"..., 4096) = 3058
read(5, "", 4096) = 0
close(5) = 0
nanosleep({0, 997000000}, NULL) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP USR1 USR2], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP USR1 USR2], NULL, 8) = 0
stat("/tmp/sj1.jpg", {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
open("/tmp/sj1.jpg", O_RDONLY) = 5
fstat(5, {st_mode=S_IFREG|0644, st_size=56306, ...}) = 0
read(5, "\377\330\377\341c\366Exif\0\0MM\0*\0\0\0\10\0\n\1\0\0\4\0\0\0\1\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = 4096
read(5, "\377\0\303\377\0\327IK\333\361\377\0?\327\374\342\222\200\27\247C\371f\222\227\34g\266q\376\177_"..., 4096) = 4096
read(5, "\24~zu\364\363\337\277\253\332\300\24QE\35\377\0\257\236\373\371k\327\260\5\24QG\365\375k\277"..., 4096) = 4096
read(5, "\5\24\177\234\321@\5\24Q@\5\24Q@\5\24Q@\5\24Q@\5\24\275\276\237\347\372\376\264\224"..., 4096) = 4096
read(5, "R\322R\0\245\364\357\355IE?\363\0\2471\4\344.\321\307\0\344\3\216q\236q\236\200\344\216\344"..., 4096) = 4096
read(5, "E\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24QE\0\24Q"..., 4096) = 4096
read(5, "\2\212(\247\337\177\351\365\376\267\1F0z\347\214\177S\237lc\36\371\317\34\245\24Q\376\177\347\320"..., 4096) = 4096
read(5, "\363\376\177\317\346\224\0\247\365\3569\376\277\375n\277\222R\375?\317\371\372\322P\2\366\366\377\0\17\377"..., 4096) = 3058
read(5, "", 4096) = 0
close(5) = 0
nanosleep({0, 995000000}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
--- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=3449, si_uid=33} ---
futex(0x7f633032b880, FUTEX_WAKE_PRIVATE, 2147483647) = 0
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2845, ...}) = 0
gettid() = 8079
poll([{fd=1, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
sendto(1, "\320\0\0\0\3INSERT INTO Logs ( TimeKey,"..., 212, 0, NULL, 0) = 212
recvfrom(1, "\7\0\0\1\0\1\0\2\0\0\0", 16384, 0, NULL, NULL) = 11
sendto(3, "<142>Mar 3 06:52:10 zmc_m11[807"..., 87, MSG_NOSIGNAL, NULL, 0) = 87
rt_sigreturn({mask=[HUP USR1 USR2 CHLD]}) = -1 EINTR (Interrupted system call)
rt_sigprocmask(SIG_UNBLOCK, [HUP USR1 USR2], NULL, 8) = 0
poll([{fd=1, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
sendto(1, "K\0\0\0\3REPLACE INTO Monitor_Status"..., 79, 0, NULL, 0) = 79
recvfrom(1, "\7\0\0\1\0\2\0\2\0\0\0", 16384, 0, NULL, NULL) = 11
munmap(0x7f631f269000, 925696) = 0
msync(0x7f631f34b000, 55301672, MS_SYNC) = 0
munmap(0x7f631f34b000, 55301672) = 0
close(4) = 0
unlink("/dev/shm/zm.mmap.11") = 0
munmap(0x7f6322809000, 2768896) = 0
munmap(0x7f6334cc9000, 925696) = 0
close(3) = 0
sendto(1, "\1\0\0\0\1", 5, 0, NULL, 0) = 5
shutdown(1, SHUT_RDWR) = 0
close(1) = 0
close(0) = 0
exit_group(0) = ?

User avatar
knight-of-ni
Posts: 2226
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: File source not working anymore

Post by knight-of-ni » Sun Mar 03, 2019 3:21 pm

/tmp folder resides on private tmpfs for Debian based distros, which means only you can see the files in your tmp folder. The web user account has its own, different /tmp folder. Try putting the file somewhere else on your filesystem, like /dev/shm.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

rpdrewes
Posts: 11
Joined: Thu Jul 20, 2017 8:08 pm

Re: File source not working anymore

Post by rpdrewes » Sun Mar 03, 2019 3:56 pm

Your idea initially sounded promising, knight-of-ni though from the strace it did appear that zmc was able to read the file data.

I changed the path for the file Source to /dev/shm/sj1.jpg (and later also /var/www/sj1.jpg) and of course put the image file in those locations, and the behavior didn't change. Still no image. I restarted the monitor for each test. I tried 24 and 32 bit color just as a test.

For another test, I changed the Source to http and accessed the file in /var/www via the local web server to Zoneminder, and that did display the image. I would just use this approach but it has some other drawbacks.

It seems only the file Source isn't working for me, no matter what I do.

Any more ideas?

Thanks,
Rich

rpdrewes
Posts: 11
Joined: Thu Jul 20, 2017 8:08 pm

Re: File source not working anymore

Post by rpdrewes » Sun Mar 03, 2019 4:13 pm

BTW, when I log into the machine as two different users, they can see the same files in /tmp. I think the per-user temporary directory is in /run/user and /tmp is still shared as it always was.

In any case, I tried other directories and that did not work.

Rich

rpdrewes
Posts: 11
Joined: Thu Jul 20, 2017 8:08 pm

Re: File source not working anymore

Post by rpdrewes » Mon Mar 04, 2019 8:02 pm

I am still trying to figure out why file Source is not working. (BTW, does file Source work for anyone else on this version of Zoneminder?)

Here is my latest attempt to figure this out:

When I try to view a monitor (#7) that has a file Source, a nph-zms process starts as it should. With strace, I can see that the process successfully opens /dev/shm/zm.mmap.7, it opens a lock file, a local socket, and then starts to set up what I think is a queue directory /tmp/zm/zmswap-m7/zmswap-qxxxxxxxx. It appears to talk to zmc successfully via a socket. It then appears to look in /tmp/zm/zmswap-m7/zmswap-qxxxxxxxx for new files, which never appear. After a while, it gives up and exits.

The zmc process should, I believe, be feeding images to zms. Here is where I am confused: Should the images be sent in the /tmp/zm/zmswap queue directory, or by /dev/shm/zm.mmap.7?

When I look at an strace of zmc, it successfully opens and mmaps /dev/shm/zm.mmap.7, HOWEVER, zmc does not seem to do anything at all with the queue (?) directory tmp/zm/zmswap-m7/zmswap-qxxxxxxxx. The zmc process successfully opens and reads the .jpg image file that it is supposed to (and probably the data is put into /dev/shm/zm.mmap.7, but strace does not reveal where it goes obviously since that is just memory access). But zmc never does anything with /tmp/zm/zmswap-m7/zmswap-qxxxxxxx. Nor does zmc seem to send any sort of notification to nph-zms that an image is available. The zmc process just reads the .jpg file a few times and then is killed by zmwatch, presumably.

Why aren't the images making it from zmc to nph-zms? What can I do to debug this other than fully understanding the source code, which I really cannot afford to do for every application that I want to simply use?!?

What additional tests can I perform? I have tried multiple alternative images on the theory that zmc doesn't like the format and is not sending them for that reason, but no luck.

rpdrewes
Posts: 11
Joined: Thu Jul 20, 2017 8:08 pm

Re: File source not working anymore

Post by rpdrewes » Tue Mar 05, 2019 7:05 am

After way too much effort, I believe I found a bug with the file source (and also the curl source) that has made these two sources completely nonfunctional for a long time.

I tested fix and submitted a pull request on github.

Rich

User avatar
msawicki
Posts: 1
Joined: Fri May 03, 2019 9:37 pm

Re: File source not working anymore

Post by msawicki » Fri May 03, 2019 9:58 pm

Hi,
Unfortunately, It isn't still working. I have the same problem I think.
ZoneMinder ver. 1.32.3, installed on Ubuntu Server 18 using script from https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way, installed today.
I added monitor with file source /dev/shm/camera.jpg. I copied image file camera.jpg to dir /dev/shm. And zm cannot display this file in browser. If I use remote and http link to localhost and copy file to /var/www/html then it works.
Regards,
Michał Sawicki

irohaturo
Posts: 1
Joined: Sun May 05, 2019 5:17 pm

Re: File source not working anymore

Post by irohaturo » Sun May 05, 2019 5:27 pm

Yup. Not working. A phresh install acc. Wiki on a phresh Deb9. Cams showed up shortly (which obviously means the sources were correct) and then disappear. Restarting zm, rebooting the box won't bring them back and if, only for minutes. It actually seems zm kills the cams, maybe by bombarding them w. request? Had to hard-reboot them.
Log? Yeah, massive, fills up faster then one can read the err. msgs.
"A full-featured, open source, state-of-the-art video surveillance software system."? Rather "A totally patchy, non-working hobby and a time-sink for geeks."
Unusable. Back to my dull desktop app. Thank you for wasting a Sunday afternoon w. BIG promises :(

rockedge
Posts: 1096
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA
Contact:

Re: File source not working anymore

Post by rockedge » Sun May 05, 2019 7:02 pm

big words from somebody I never heard of. I guess I could rip into your inability to get this going when most others can...but that would be petty wouldn't it. You must be a millennial maybe writing this from mom's basement.

If you EVER looked into it.... ZM runs like shit on Debian 9 (which I abandoned a looonnnnngggg time ago)... I have done many installs on Debian 9 and every one of them had a problem and those always were these nagging small hard to explain type. Why not use an OS that has proven to work?

You do know there are like 2-3 guys who work on this in their spare time...and if you had a job..would know time can be limited... so why not leave your uninteresting comments someplace else...stop being a quitter...and get with the program...kiddo.

There are companies using ZoneMinder that have over a thousand cameras

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

Re: File source not working anymore

Post by iconnor » Mon May 06, 2019 2:23 am

This appears to be a pretty niche application of ZM. The file input is pretty limited... because nobody uses it.

We will be happy to try to make it work, so long as everyone understands that it may take some time.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests