[support] dlandon - Zoneminder 1.36


Recommended Posts

27 minutes ago, tucansam said:

Docker -> ZM Icon -> "WebGUI"

 

Also tried directly inputting the URL and port, both http and https

 

No change, does not work.  Same error.

Look at the docker container log and see if there are any errors.

 

Did you make any changes to the docker container template?

Link to comment

Got it working, not sure how.

 

But MAN, this is WAY more complicated than it was a decade ago when I ran an old version on an old linux.  I have no idea how to begin doing this.  I've managed to set up the source, an can see it.  The camera itself handles motion detection, and films in 30s clips, which is fine.  I literally just need the camera to write videos to my unraid server instead of the SD card in it.  Nothing more complicated than that.  

Link to comment
  • 1 month later...

If anyone is trying to get this Zoneminder docker working with the Nginx Proxy Manager docker instead of the SWAG docker below is the important config that needs to be added to the advanced tab when creating a new proxy host.

 

 location = / {
    rewrite ^ https://zm.mydomain.com/zm/ permanent;
}

 

That tidbit above makes Zoneminder pesky use of the trailing /zm in the URL work with Nginx Proxy Manager. Pay particular care to make sure the ending"/" in  https://zm.mydomain.com/zm/ is present because https://zm.mydomain.com/zm does not work for me.

Edited by turt1e
Link to comment

Anyone managed to get ZMNINJA event server working - Got it saying connected in App and I can see via console it can see and send an event when I manually start an alarm but nothing is showing on the APP/Phone. Any tips!?

 

I can see the Console is saying the following, Is this a setting im missing? 

 

I feel like im close @dlandon can you comment on the last bit here 

 

No rules found for Monitor, allowing:2. - is this something basic im missing???

 

BG-2:2023-02-05,22:04:47 PARENT: checkEvents() new events found=1
DBG-2:2023-02-05,22:04:47 PARENT: There are 1 new Events to process
DBG-2:2023-02-05,22:04:47 PARENT: ---------->Tick END (active forks:1, total forks:1, active hooks: 0)<--------------
DBG-1:2023-02-05,22:04:47 PARENT: Forked process:1281 to handle alarm eid:38
INF:2023-02-05,22:04:47 |----> FORK:Front Porch 1080 (2), eid:38 use hooks/start hook not being used, going to directly send out a notification if checks pass
02/05/23 22:04:47.266417 zmeventnotification[1281].INF [main:1044] [|----> FORK:Front Porch 1080 (2), eid:38 use hooks/start hook not being used, going to directly send out a notification if checks pass]
DBG-2:2023-02-05,22:04:49 |----> FORK:Front Porch 1080 (2), eid:38 rules: Checking rules for alarm caused by eid:38, monitor:2, at: Sun Feb  5 22:04:49 2023 with cause:Forced Web
DBG-1:2023-02-05,22:04:49 |----> FORK:Front Porch 1080 (2), eid:38 rules: No rules found for Monitor, allowing:2
DBG-1:2023-02-05,22:04:49 |----> FORK:Front Porch 1080 (2), eid:38 Matching alarm to connection rules...

Edited by Nano
Link to comment

My setup is a 250 GB disk dedicated to ZM.  I save events until the disk is 85% full and it purges the oldest.  Been doing this for years, moving it from an old bare metal server to unraid.  The disk holds roughly 300,000 events using 7 cameras.  Basically overkill as I rarely go back in time the 4 months of events that it holds.  But, my problem is I can't go back in time if I'm trying to query about 60,000 events from the console.  From the console, clicking on "events" with a camera with 40k events, they pop up just fine.  Other cameras with 60k events all I'm presented with is a message "Loading, please wait..." and nothing more happens; it's the same thing with all 3 cameras I have with greater than 60k events.  Clicking on the total events, with 300k, it's obviously the same thing.

 

My thinking it's some limitation with mysql, but there's nothing in error logs and I'm not sure what I can do to increase the number of events that can be queried.  My old server was able to do it just fine with what was essentially a stock ZM install, using the same 250GB hard disk and I don't recall modifying mysql outside of what ZM requires... Any thoughts?

zm.jpg

Link to comment
  • 3 weeks later...
On 2/9/2023 at 3:29 PM, grants169 said:

My setup is a 250 GB disk dedicated to ZM.  I save events until the disk is 85% full and it purges the oldest.  Been doing this for years, moving it from an old bare metal server to unraid.  The disk holds roughly 300,000 events using 7 cameras.  Basically overkill as I rarely go back in time the 4 months of events that it holds.  But, my problem is I can't go back in time if I'm trying to query about 60,000 events from the console.  From the console, clicking on "events" with a camera with 40k events, they pop up just fine.  Other cameras with 60k events all I'm presented with is a message "Loading, please wait..." and nothing more happens; it's the same thing with all 3 cameras I have with greater than 60k events.  Clicking on the total events, with 300k, it's obviously the same thing.

 

My thinking it's some limitation with mysql, but there's nothing in error logs and I'm not sure what I can do to increase the number of events that can be queried.  My old server was able to do it just fine with what was essentially a stock ZM install, using the same 250GB hard disk and I don't recall modifying mysql outside of what ZM requires... Any thoughts?

zm.jpg

 

Found the culprit.  In case anyone else has the "Loading, please wait.." message after attempting to load a large dataset (camera with a lot of events), the fix is to log on to console and increase memory limit from 'memory_limit = 128M' to something like 512M in /etc/php/7.4/apache2/php.ini. 

  • Like 1
Link to comment

Good Afternoon! I just updated my zoneminder docker and now I am getting permission denied errors, and I am not sure what changed within the docker to affect permissions. I am still on 6.9.2, and I know that 6.10 and up introduced docker permission issues. Im curious if that is the issue here. Does any of this make sense to anyone?

 

Quote
Mar 6 13:39:30 77963088ba6b zmu[1155]: ERR [zmu] [Can't open memory map file /dev/shm/zm.mmap.1: No such file or directory]
Mar 6 13:39:30 77963088ba6b zmu[1155]: ERR [zmu] [Can't connect to capture daemon: 1 Front Door]
Mar 6 13:39:30 77963088ba6b zmu[1155]: ERR [zmu] [Can't run query INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( 1678131570.099178, 'zmu', 0, 1155, -2, 'ERR', 'Can\'t open memory map file /dev/shm/zm.mmap.1: No such file or directory', 'zm_monitor.cpp', 927 ): Lost connection to MySQL server during query]
Mar 6 13:39:30 77963088ba6b zmu[1155]: ERR [zmu] [Can't run query INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( 1678131570.099343, 'zmu', 0, 1155, -2, 'ERR', 'Can\'t connect to capture daemon: 1 Front Door', 'zmu.cpp', 512 ): Lost connection to MySQL server during query]
Mar 6 13:39:30 77963088ba6b zms[1201]: ERR [zms] [fopen() for ./zms.log, error = Permission denied]

 

 

EDIT: So, since I was getting permission denied, I went ahead and let the docker run with privilege to see how it would respond, and now I am getting this

 

DBD::mysql::st execute failed: Lost connection to MySQL server during query at /usr/share/perl5/ZoneMinder/Logger.pm line 627.

DBD::mysql::st execute failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) at /usr/bin/zmpkg.pl line 325.

Mar 6 14:40:29 713ba0e3f727 zmpkg[1108]: ERR [Can't execute log entry 'INSERT INTO Logs ( TimeKey, Component, ServerId, Pid, Level, Code, Message, File, Line ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, NULL )': Lost connection to MySQL server during query]
Mar 6 14:40:29 713ba0e3f727 zmpkg[1108]: FAT [Can't execute: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)]
ZoneMinder failed to start


*** /etc/my_init.d/40_firstrun.sh failed with status 255

 

Edited by drx
Link to comment

Sorry, just got back from dinner and was able to do some more testing. I set the env variable "NO_START_ZM="1"", then started the MySQL server and it was fine. When I start zoneminder I get an error:

 

execute failed: Lost connection to MySQL server during query at /usr/share/perl5/ZoneMinder/Logger.pm line 627.

and

execute failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) at /usr/bin/zmpkg.pl line 325.

 

So, I went to those lines and this is what they say:

 

Logger.pm Line 610-634

 

 610       my $sql = 'INSERT INTO Logs ( TimeKey, Component, ServerId, Pid, Level, Code, Message, File, Line ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, NULL )';
    611       $this->{sth} = $ZoneMinder::Database::dbh->prepare_cached($sql) if ! $this->{sth};
    612       if ( !$this->{sth} ) {
    613         $this->{databaseLevel} = NOLOG;
    614         Error("Can't prepare log entry '$sql': ".$ZoneMinder::Database::dbh->errstr());
    615         return;
    616       }
    617
    618       my $res = $this->{sth}->execute(
    619         $seconds+($microseconds/1000000.0),
    620            $this->{id},
    621            ($ZoneMinder::Config::Config{ZM_SERVER_ID} ? $ZoneMinder::Config::Config{ZM_SERVER_ID} : undef),
    622            $$,
    623            $level,
    624            $codes{$level},
    625            $string,
    626            $this->{fileName},
    627           );
    628       if ( !$res ) {
    629         $this->{databaseLevel} = NOLOG;
    630         Error("Can't execute log entry '$sql': ".$ZoneMinder::Database::dbh->errstr());
    631       }
    632     } # end if doing db logging
    633   } # end if level < effectivelevel
    634 }

 

zmpkg.pl

 

  320 
    321 # PP - First, make sure default exists and there is only one
    322   my $sql = 'SELECT `Name` FROM `States` WHERE `Name`=?';
    323   my $sth = $dbh->prepare_cached($sql)
    324     or Fatal("Can't prepare '$sql': ".$dbh->errstr());
    325   my $res = $sth->execute('default')
    326     or Fatal("Can't execute: ".$sth->errstr());
    327 

 

 

I am not sure what these lines are telling me, this is above my head unfortunately

 

Link to comment
16 hours ago, drx said:

Good Afternoon! I just updated my zoneminder docker and now I am getting permission denied errors, and I am not sure what changed within the docker to affect permissions

Nothing in the update affected permissions.  You should restore your appdata from a backup.

Link to comment

For what its worth, I woke up and found my Zoneminder docker was stopped.  I tried to restart and watched the logs and it kept restarting, many database errors. I have restored to a backup but looks like theres an issue with the update. I would recommend people holding off until this is addressed. Unfortunately, I didnt capture the errors before restoring. 

Link to comment
4 hours ago, tvd1 said:

For what its worth, I woke up and found my Zoneminder docker was stopped.  I tried to restart and watched the logs and it kept restarting, many database errors. I have restored to a backup but looks like theres an issue with the update. I would recommend people holding off until this is addressed. Unfortunately, I didnt capture the errors before restoring. 

Force an update to the docker.

Link to comment
  • 1 month later...
  • 2 weeks later...
Posted (edited)

Just noticed and installed the latest upgrade and now get the same error when trying to manually start zoneminder.

 

[email protected]:/# service zoneminder start
Starting ZoneMinder:
05/08/23 12:05:00.692778 zmpkg[1515].INF [main:318] [Sanity checking States table...]
DBD::mysql::st execute failed: Lost connection to MySQL server during query at /usr/share/perl5/ZoneMinder/Logger.pm line 627.
05/08/23 12:05:00.757360 zmpkg[1515].ERR [ZoneMinder::Logger:630] [Can't execute log entry 'INSERT INTO Logs ( TimeKey, Component, ServerId, Pid, Level, Code, Message, File, Line ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, NULL )': Lost connection to MySQL server during query]
DBD::mysql::st execute failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) at /usr/bin/zmpkg.pl line 325.
05/08/23 12:05:00.757747 zmpkg[1515].FAT [main:325] [Can't execute: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)]
ZoneMinder failed to start

[email protected]:/# 

 

DB starts fine and I can connect successfully from the CLI using the credentials in /etc/zm/zm.conf

I'll try take a better look later this evening, but FYI the latest update seems to do something funky :)

 

Edited by mcraidy
Link to comment

There were no changes in the latest Zoneminder container.  It was to catch up the Ubuntu updates and refresh the docker container.

 

That problem normally happens with database issues.  I've kept up with all the updates on my own Zoneminder and never had an issue with the DB.  Restore the database from a backup and see if it doesn't fix it.

  • Thanks 1
Link to comment

Thanks - interestingly just tried a mysqldump and got

mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `Logs` at row: 130429

 

There seemed to be something weird in the Logs table so I truncated the table.... service starts again.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.