Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared data not initialised by capture daemon #507

Closed
ghost opened this issue Aug 21, 2014 · 5 comments
Closed

Shared data not initialised by capture daemon #507

ghost opened this issue Aug 21, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 21, 2014

I get this a lot when using the web gui, not otherwise. If I'm active in the gui, motion detect recording does not work. If I leave the gui, there are no more of these errors and the system functions just fine. I'm 99% certain it works this way.

Aug 20 15:50:43 stik zms[22402]: INF [Authenticated user 'admin']
Aug 20 15:50:43 stik zms[22402]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Aug 20 15:50:47 stik zms[22402]: INF [Got signal 15 (Terminated), exiting]
Aug 20 15:50:50 stik zms[22006]: INF [Got signal 15 (Terminated), exiting]
Aug 20 15:50:50 stik zms[22006]: ERR [Unable to send stream frame: Broken pipe]

$ ipcs -l

------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 1041866
max total shared memory (kbytes) = 4267483648
min seg size (bytes) = 1

------ Semaphore Limits --------
max number of arrays = 128
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

------ Messages Limits --------
max queues system wide = 1652
max size of message (bytes) = 8192
default max size of queue (bytes) = 16384

$ ls -la /dev/shm/zm.mmap.1
-rw------- 1 www-data www-data 59444560 aug 21 11:38 /dev/shm/zm.mmap.1

$ apt-cache policy zoneminder
zoneminder:
Installed: 1.27.99+1-trusty-SNAPSHOT2014080402

@connortechnology
Copy link
Member

This is actually a warning. It is just telling you that the camera is not recording. It means that the zmc process is not running. You need to look into why zmc is not running. So check in the zmc logs. /var/log/zm/zmc*

@ghost
Copy link
Author

ghost commented Sep 12, 2014

I enabled logging to files (LOG_LEVEL_FILE=info) (already had info on syslog & database) but the only file that has been written since restart of zm is zmaudit.log. A few hours after restart, I first triggered an event then I wanted to watch it. Got a lot of errors in the log when doing that. This is from syslog:

Sep 12 19:52:49 mistik zma_m1[30177]: INF [Monitor-1: 280000 - Processing at 12.35 fps]
Sep 12 19:53:33 mistik zma_m1[30177]: INF [Monitor-1: 280548 - Gone into alarm state]
Sep 12 19:53:33 mistik zma_m1[30177]: INF [Monitor-1: 280548 - Opening new event 37958, alarm start]
Sep 12 19:53:41 mistik zma_m1[30177]: INF [Monitor-1: 280631 - Gone into alert state]
Sep 12 19:53:43 mistik zma_m1[30177]: INF [Monitor-1: 280656 - Left alarm state (37958) - 133(83) images]
Sep 12 19:53:43 mistik zma_m1[30177]: INF [Monitor-1: 280656 - Closing event 37958, alarm end]
Sep 12 19:53:44 mistik zma_m1[30177]: INF [Monitor-1: 280660 - Gone into alarm state]
Sep 12 19:53:44 mistik zma_m1[30177]: INF [Monitor-1: 280660 - Opening new event 37959, alarm start]
Sep 12 19:53:48 mistik zma_m1[30177]: INF [Monitor-1: 280715 - Gone into alert state]
Sep 12 19:53:50 mistik zma_m1[30177]: INF [Monitor-1: 280740 - Left alarm state (37959) - 105(55) images]
Sep 12 19:53:50 mistik zma_m1[30177]: INF [Monitor-1: 280740 - Closing event 37959, alarm end]
Sep 12 19:54:06 mistik zmc_m1[30174]: INF [Monitor-1: 281000 - Capturing at 12.35 fps]
Sep 12 19:54:11 mistik zma_m1[30177]: INF [Monitor-1: 281000 - Processing at 12.20 fps]
Sep 12 19:55:27 mistik zmc_m1[30174]: INF [Monitor-1: 282000 - Capturing at 12.35 fps]
Sep 12 19:55:32 mistik zma_m1[30177]: INF [Monitor-1: 282000 - Processing at 12.35 fps]
Sep 12 19:56:50 mistik zmc_m1[30174]: INF [Monitor-1: 283000 - Capturing at 12.05 fps]
Sep 12 19:56:56 mistik zma_m1[30177]: INF [Monitor-1: 283000 - Processing at 11.90 fps]
Sep 12 19:58:16 mistik zmc_m1[30174]: INF [Monitor-1: 284000 - Capturing at 11.63 fps]
Sep 12 19:58:21 mistik zma_m1[30177]: INF [Monitor-1: 284000 - Processing at 11.76 fps]
Sep 12 19:59:43 mistik zmc_m1[30174]: INF [Monitor-1: 285000 - Capturing at 11.49 fps]
Sep 12 19:59:49 mistik zma_m1[30177]: INF [Monitor-1: 285000 - Processing at 11.36 fps]
Sep 12 20:01:12 mistik zmc_m1[30174]: INF [Monitor-1: 286000 - Capturing at 11.24 fps]
Sep 12 20:01:17 mistik zma_m1[30177]: INF [Monitor-1: 286000 - Processing at 11.36 fps]
Sep 12 20:02:41 mistik zmc_m1[30174]: INF [Monitor-1: 287000 - Capturing at 11.24 fps]
Sep 12 20:02:46 mistik zma_m1[30177]: INF [Monitor-1: 287000 - Processing at 11.24 fps]
Sep 12 20:04:11 mistik zmc_m1[30174]: INF [Monitor-1: 288000 - Capturing at 11.11 fps]
Sep 12 20:04:16 mistik zma_m1[30177]: INF [Monitor-1: 288000 - Processing at 11.11 fps]
Sep 12 20:04:37 mistik zms[12786]: INF [Authenticated user 'admin']
Sep 12 20:04:37 mistik zms[12786]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:04:40 mistik zms[12786]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:04:44 mistik zms[12789]: INF [Authenticated user 'admin']
Sep 12 20:04:44 mistik zms[12789]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:04:50 mistik zms[12789]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:04:51 mistik zms[12792]: INF [Authenticated user 'admin']
Sep 12 20:04:51 mistik zms[12792]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:04:58 mistik zms[12792]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:04:58 mistik zms[12792]: ERR [Unable to send raw frame 39: Broken pipe]
Sep 12 20:05:00 mistik zms[12794]: INF [Authenticated user 'admin']
Sep 12 20:05:00 mistik zms[12794]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:05:05 mistik zms[12794]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:05:05 mistik zms[12794]: ERR [Unable to send raw frame 33: Broken pipe]
Sep 12 20:05:06 mistik zms[12908]: INF [Authenticated user 'admin']
Sep 12 20:05:06 mistik zms[12908]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:05:11 mistik zms[12908]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:05:12 mistik zms[12910]: INF [Authenticated user 'admin']
Sep 12 20:05:12 mistik zms[12910]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:05:41 mistik zms[12910]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:05:41 mistik zms[12910]: ERR [Unable to send raw frame 73: Broken pipe]
Sep 12 20:05:41 mistik zmc_m1[30174]: INF [Monitor-1: 289000 - Capturing at 11.11 fps]
Sep 12 20:05:44 mistik zms[12933]: INF [Authenticated user 'admin']
Sep 12 20:05:44 mistik zms[12933]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:05:47 mistik zma_m1[30177]: INF [Monitor-1: 289000 - Processing at 10.99 fps]
Sep 12 20:05:49 mistik zms[12933]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:05:49 mistik zms[12933]: ERR [Unable to send raw frame 40: Broken pipe]
Sep 12 20:05:52 mistik zms[13063]: INF [Authenticated user 'admin']
Sep 12 20:05:52 mistik zms[13063]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:06:19 mistik zms[13063]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:06:19 mistik zms[13063]: ERR [Unable to send raw frame 179: Broken pipe]
Sep 12 20:06:28 mistik zms[13155]: INF [Authenticated user 'admin']
Sep 12 20:06:28 mistik zms[13155]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:06:42 mistik zms[13159]: INF [Authenticated user 'admin']
Sep 12 20:06:42 mistik zms[13159]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:07:13 mistik zmc_m1[30174]: INF [Monitor-1: 290000 - Capturing at 10.99 fps]
Sep 12 20:07:18 mistik zma_m1[30177]: INF [Monitor-1: 290000 - Processing at 10.99 fps]
Sep 12 20:07:19 mistik zms[13155]: ERR [Frame send time 740 msec too slow, throttling maxfps to 10.00]
Sep 12 20:07:23 mistik zms[13159]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:07:23 mistik zms[13159]: ERR [Unable to send raw frame 132: Broken pipe]
Sep 12 20:07:25 mistik zms[13155]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:07:32 mistik zms[13243]: INF [Authenticated user 'admin']
Sep 12 20:07:32 mistik zms[13243]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:07:41 mistik zms[13243]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:07:41 mistik zms[13243]: ERR [Unable to send raw frame 56: Broken pipe]
Sep 12 20:08:02 mistik zms[13311]: INF [Authenticated user 'admin']
Sep 12 20:08:02 mistik zms[13311]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:08:33 mistik zms[13335]: INF [Authenticated user 'admin']
Sep 12 20:08:33 mistik zms[13335]: WAR [Shared data not initialised by capture daemon, some query functions may not be available or produce invalid results]
Sep 12 20:08:36 mistik zms[13311]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:08:36 mistik zms[13311]: ERR [Unable to send raw frame 133: Broken pipe]
Sep 12 20:08:44 mistik zmc_m1[30174]: INF [Monitor-1: 291000 - Capturing at 10.87 fps]
Sep 12 20:08:50 mistik zma_m1[30177]: INF [Monitor-1: 291000 - Processing at 10.87 fps]
Sep 12 20:08:57 mistik zms[13335]: INF [Got signal 15 (Terminated), exiting]
Sep 12 20:08:57 mistik zms[13335]: ERR [Unable to send raw frame 105: Broken pipe]

Do I need to enable debug to get something to get further with this issue?

@Linwood-F
Copy link
Contributor

I did some research on this, specifically on the warning that ends "some query functions may not be available", and I think the reason quoted (zmc is not running) may not be correct in this case.

In zm_monitor (where this is issued), around line 374, mem_ptr is initialized to NULL. Immediately following there are sections of code for CAPTURE and ANALYSIS, but nothing for QUERY. Immediately following the (skipped for QUERY) ANALYSIS section is the test which generates this error, with a flavor for non-QUERY, and one for QUERY.

The one for QUERY is the one that says "some query functions may not be available". It appears to be simply impossible to get to this point with anything but a null mem_ptr, which then generates the error.

I think this message is bogus at this point. After the warning it falls through and continues to run fine, at least when called from ZMS which is where I am mostly getting this specific error.

I did not research the other flavor (non-QUERY) version which ends at the monitor name, no "some query functions".

I did not research every possible path that might call this to see if some other level of initialization perhaps should (sometimes) occur for a QUERY purpose here, but as written I see no path for purpose=QUERY that can avoid giving this error. And it appears to work properly (otherwise a SINGLE frame from ZMS would not work.

I did ensure that ZMC was running in all cases that gave this message. Perhaps that ZMC not running issue relates to the non-purpose=QUERY function.

Perhaps I am missing something but I am going to throw a pull request out to make this just go away, and at least perhaps spur discussion.

@Linwood-F
Copy link
Contributor

This partial fix was merged in #984, primarily to remove some of the noise that is confusing people, but I think there are still issues here, so am not closing this once my change above was merged.

@knight-of-ni
Copy link
Member

#984 fixes the particular Shared Memory error described in this thread. Thank you @Linwood-F
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants