Same event stored twice

Discussions related to the 1.36.x series of ZoneMinder
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Same event stored twice

Post by eracc »

I am not sure what I have done to get this result, but each of my modect events are storing twice under my new storage location. Where do I need to look to fix this?
Screenshot at 2024-11-01 16-33-03.png
Screenshot at 2024-11-01 16-33-03.png (155.53 KiB) Viewed 782 times
Quantum
Posts: 121
Joined: Fri Mar 25, 2011 3:34 pm

Re: Same event stored twice

Post by Quantum »

Let's see your monitors. (Console)
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

Here is the console.
Screenshot at 2024-11-03 09-03-15.png
Screenshot at 2024-11-03 09-03-15.png (76.77 KiB) Viewed 660 times
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

Before you ask, here are the zones. ;)
Screenshot at 2024-11-03 09-07-10.png
Screenshot at 2024-11-03 09-07-10.png (773.71 KiB) Viewed 659 times
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Same event stored twice

Post by iconnor »

I think what is happening is that your camera has a large keyframe interval. We always have to start a recording with a keyframe, so we have to rewind in the queue till we find one. I think we are going back to the same start keyframe as event 1.

Maybe increase the minimum event length, or decrease you keyframe interval in the camera.
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

Thanks for the reply! I decreased the key frame interval on the camera to match the frame rate. It was larger than the maximum frame rate, which may mean you have a good point here. :) I will report back.
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

Unfortunately nothing I did would fix the doubling of events. So I deleted Monitor-1 to recreate the camera setup again with a new Monitor, but now my log is filling up with an error about monitor 1, which of course no longer exists:

Code: Select all

"2024/11/10 - 11:04:36 AKST",zmdc,,59498,ERR,"'zmc -m 1' exited abnormally, exit status 255",zmdc.pl,'-
"2024/11/10 - 11:04:36 AKST",zmc_m1,,101349,ERR,"No monitors found",zmc.cpp,214
"2024/11/10 - 11:04:36 AKST",zmc_m1,,101349,ERR,"Can't use query result:",zm_monitor.cpp,903
"2024/11/10 - 11:04:36 AKST",zmc_m1,,101349,ERR,"Bogus number of lines return from query, 0 returned for query SELECT `Id`, `Name`, `ServerId`, `StorageId`, `Type`, `Function`+0, `Enabled`, `DecodingEnabled`, `LinkedMonitors`, `AnalysisFPSLimit`, `AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`,`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, `Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, `SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, `Deinterlacing`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, `SaveJPEGs`, `VideoWriter`, `EncoderParameters`, `OutputCodec`, `Encoder`, `OutputContainer`, `RecordAudio`, `Brightness`, `Contrast`, `Hue`, `Colour`, `EventPrefix`, `LabelFormat`, `LabelX`, `LabelY`, `LabelSize`,`ImageBufferCount`, `MaxImageBufferCount`, `WarmupCount`, `PreEventCount`, `PostEventCount`, `StreamReplayBuffer`, `AlarmFrameCount`, `SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, `FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,`RTSPServer`, `RTSPStreamName`,`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors` WHERE Id=1.",zm_db.cpp,154
What do I do to clean that up?

What I have tried:
  • Searching the Wiki for deleting a monitor - no joy (maybe I just missed it)
  • Restarting ZM - no joy
  • Running zmaudit.pl - no joy
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Same event stored twice

Post by iconnor »

I don't know why it didn't auto-stop the dead monitor, but just restart zoneminder
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

As I noted above, I did restart ZM. I just now did a full stop then start and am still getting this error:

Code: Select all

"2024/11/11 - 06:32:06 AKST",zmdc,,59498,ERR,"'zmc -m 1' exited abnormally, exit status 255",zmdc.pl,'-
"2024/11/11 - 06:32:06 AKST",zmc_m1,,104839,ERR,"No monitors found",zmc.cpp,214
"2024/11/11 - 06:32:06 AKST",zmc_m1,,104839,ERR,"Can't use query result:",zm_monitor.cpp,903
"2024/11/11 - 06:32:06 AKST",zmc_m1,,104839,ERR,"Bogus number of lines return from query, 0 returned for query SELECT `Id`, `Name`, `ServerId`, `StorageId`, `Type`, `Function`+0, `Enabled`, `DecodingEnabled`, `LinkedMonitors`, `AnalysisFPSLimit`, `AnalysisUpdateDelay`, `MaxFPS`, `AlarmMaxFPS`,`Device`, `Channel`, `Format`, `V4LMultiBuffer`, `V4LCapturesPerFrame`, `Protocol`, `Method`, `Options`, `User`, `Pass`, `Host`, `Port`, `Path`, `SecondPath`, `Width`, `Height`, `Colours`, `Palette`, `Orientation`+0, `Deinterlacing`, `DecoderHWAccelName`, `DecoderHWAccelDevice`, `RTSPDescribe`, `SaveJPEGs`, `VideoWriter`, `EncoderParameters`, `OutputCodec`, `Encoder`, `OutputContainer`, `RecordAudio`, `Brightness`, `Contrast`, `Hue`, `Colour`, `EventPrefix`, `LabelFormat`, `LabelX`, `LabelY`, `LabelSize`,`ImageBufferCount`, `MaxImageBufferCount`, `WarmupCount`, `PreEventCount`, `PostEventCount`, `StreamReplayBuffer`, `AlarmFrameCount`, `SectionLength`, `MinSectionLength`, `FrameSkip`, `MotionFrameSkip`, `FPSReportInterval`, `RefBlendPerc`, `AlarmRefBlendPerc`, `TrackMotion`, `Exif`,`RTSPServer`, `RTSPStreamName`,`SignalCheckPoints`, `SignalCheckColour`, `Importance`-1 FROM `Monitors` WHERE Id=1.",zm_db.cpp,154
Next suggestion, please. :)
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Same event stored twice

Post by iconnor »

The only thing I can think of would be if there was a rogue process left behind. CHeck for two zmdc.pl or two zmwatch.pl in ps | grep zm

sudo zmdc.pl status

Will tell us if the currently talking zmdc thinks it should be running zmc -m 1. To stop it we can do sudo zmdc.pl stop zmc -m 1. But something else like zmwatch.pl might restart it.
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

Thanks for the hints. I should have thought to check the process list myself. Doh!

For clarity this is a FreeBSD 13.4-RELEASE system. I ran top and watched the www user processes, which is nginx and ZoneMinder, then stopped ZoneMinder and nginx. Imagine my surprise to find several ZoneMinder zombie processes still running, including six zmc processes for two cameras :D, and showing up in top after both services were stopped. Now I know why the CPU load seemed higher than it should be. ;)

To "fix" it, at the CLI where I logged in as root, I used:

Code: Select all

pkill -U www
That got rid of all the remaining processes except for php-fpm, whcih respawned new processes on new PIDs. I am guessing that is normal at this point and just left those. Then I restarted ZoneMinder and nginx to see what popped up. Looks "normal" in top now and only showing two zmc processes for two cameras, which is what I expect.

It appears the service zoneminder stop and service zoneminder restart on the FreeBSD port are not completing a stop of the previous processes for ZoneMinder. Now that I know that, I can make sure I use stop and verify the processes are gone before I start the service again.
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

For future me, and anyone else needing this info, make sure these services are up and running on the FreeBSD port:
  • mysql-server
  • fcgiwrap
  • php_fpm
  • nginx
  • zoneminder
There should be one zmc process per enabled camera.
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Same event stored twice

Post by iconnor »

Hmm... I may try to find some time to look into this. All processes are managed by zmdc and should kill them all. Perhaps something is different on freebsd.
User avatar
eracc
Posts: 107
Joined: Wed Mar 08, 2006 3:26 pm
Location: USA

Re: Same event stored twice

Post by eracc »

Well, since FreeBSD is not Linux, it is definitely different from Linux. All of the base tools installed with the base OS are not GNU. Only add-in packages from ports may be GNU. For example the pkill in FreeBSD base is BSD licensed and has different switches than the pkill used in many Linux distributions. So that is one difference.
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Same event stored twice

Post by iconnor »

I took a quick look and the init script just wraps zmpkg.pl which should be fine. I did some start/stops and all the processes started/died appropriately... so not simple to replicate.
Post Reply