dlandon's docker runs into mysql problems on fresh install

Support for the docker image maintained by dlandon
Post Reply
SpikeyGG
Posts: 60
Joined: Mon Oct 15, 2012 12:02 am

dlandon's docker runs into mysql problems on fresh install

Post by SpikeyGG » Sat Jun 19, 2021 8:50 pm

I've been trying to get switched over to dlandon's new docker hub repo (https://hub.docker.com/r/dlandon/zonemi ... e.learning) but I'm having a hell of a time. When I try to start from ground zero (I'm trying to build a fresh install) it fails with this:

Code: Select all

Creating hook/known_faces folder in config folder
Creating hook/unknown_faces folder in config folder
Starting services...
 * Starting Apache httpd web server apache2
 * 
 * Starting MariaDB database server mysqld
   ...done.
Jun 19 14:16:47 zoneminder zmupdate[16302]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
Jun 19 14:16:47 zoneminder zmupdate[16302]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
Jun 19 14:16:47 zoneminder zmupdate[16303]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
Jun 19 14:16:47 zoneminder zmupdate[16303]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
Starting ZoneMinder:
Jun 19 14:16:47 zoneminder zmpkg[16313]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
Jun 19 14:16:47 zoneminder zmpkg[16313]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]
ZoneMinder failed to start

Jun 19 14:16:47 zoneminder syslog-ng[38]: syslog-ng shutting down; version='3.25.1'
Shouldn't the database creation happen automatically when the container is stood up? My command looks like this:

Code: Select all

docker run -d --name="zoneminder" --hostname="zoneminder" --net="bridge" --privileged="false" --shm-size="50G" -p 8080:80/tcp -p 9001:9000/tcp -e TZ="America/Boise" -e MULTI_PORT_START="0" -e MULTI_PORT_END="0" -v "/all_media/zm_data/config":"/config":rw -v "/all_media/zm_data/data":"/var/cache/zoneminder":rw dlandon/zoneminder.machine.learning
I did a NO_START_ZM="1" per the instructions to troubleshoot and it appears that the zm database doesn't exist in the mysql instance. I tried to create the database manually but got this error:

Code: Select all

MariaDB [(none)]> create database zm;
ERROR 1006 (HY000): Can't create database 'zm' (errno: 2 "No such file or directory")
MariaDB [(none)]>
Then I found this webpage that suggested clearing out `/var/lib/mysql` and restarting the service fixed it. I saw that inside the docker the `/var/lib/mysql` is a softlink that points to `/config/mysql` so I looked in there and there was a bunch of stuff including the 'zm' folder purportedly for the zm database and I thought maybe I'll just restart the mysql service and see what happens.

When I did that, I opened mysql again and looked at the list of DBs and zm was in there!! WTH? After that I did a `service zoneminder start` and everything is peachy! Maybe there just needs to be a `service mysql restart` as part of the dlandon docker to keep this from happening? I'm not sure how it gets into this funk but it's completely repeatable on my system.

Juidyuy2
Posts: 1
Joined: Mon Jun 21, 2021 1:19 pm

Re: dlandon's docker runs into mysql problems on fresh install

Post by Juidyuy2 » Mon Jun 21, 2021 1:19 pm

same issue for me!
Thanks for reporting it!

cybersteel8
Posts: 7
Joined: Tue Nov 28, 2017 2:12 am

Re: dlandon's docker runs into mysql problems on fresh install

Post by cybersteel8 » Wed Jun 30, 2021 9:24 am

I believe I got the same issue with the zoneminder.unraid docker image! I got this massive set of logs from the log output available through Unraid

Code: Select all

Starting services...
* Starting Apache httpd web server apache2
*
* Starting MariaDB database server mysqld
...done.
DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16762]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.

Compilation failed in require at /usr/bin/zmupdate.pl line 74.

BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 74.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16762]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16763]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.

Compilation failed in require at /usr/bin/zmupdate.pl line 74.

BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 74.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16763]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

Starting ZoneMinder:
DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Jun 30 19:04:14 d1fcb8080590 zmpkg[16773]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.

Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.

BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.

Compilation failed in require at /usr/bin/zmpkg.pl line 34.

BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 34.

Jun 30 19:04:14 d1fcb8080590 zmpkg[16773]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

ZoneMinder failed to start


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


*** Killing all processes...
Jun 30 19:04:14 d1fcb8080590 syslog-ng[39]: syslog-ng shutting down; version='3.25.1'

*
* Starting MariaDB database server mysqld
...done.
DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16762]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.

Compilation failed in require at /usr/bin/zmupdate.pl line 74.

BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 74.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16762]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16763]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.

Compilation failed in require at /usr/bin/zmupdate.pl line 74.

BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 74.

Jun 30 19:04:14 d1fcb8080590 zmupdate[16763]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

Starting ZoneMinder:
DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Jun 30 19:04:14 d1fcb8080590 zmpkg[16773]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

DBI connect('database=zm;host=localhost','zmuser',...) failed: Unknown database 'zm' at /usr/share/perl5/ZoneMinder/Database.pm line 110.

Unable to connect to DB. ZM Cannot continue.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 150.

Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33.

BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33.

Compilation failed in require at /usr/bin/zmpkg.pl line 34.

BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 34.

Jun 30 19:04:14 d1fcb8080590 zmpkg[16773]: ERR [Error reconnecting to db: errstr:Unknown database 'zm' error val:]

ZoneMinder failed to start


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


*** Killing all processes...
Jun 30 19:04:14 d1fcb8080590 syslog-ng[39]: syslog-ng shutting down; version='3.25.1'
Doing the same steps as you worked! Specifically, I shut-down the container and added the NO_START_ZM variable and restarted the container. Then I loaded up the console for the container (I am using Unraid, there's a button to do it) and performed service mysql restart after checking that there was a zm folder in that /var/lib/mysql directory and then loaded zoneminder with service zoneminder start and Zoneminder logged that it loaded successfully.

Thank you very much for this mate, it helped a lot!

dlandon
Posts: 15
Joined: Fri Oct 12, 2018 12:49 am

Re: dlandon's docker runs into mysql problems on fresh install

Post by dlandon » Wed Jun 30, 2021 10:50 am

I have applied a fix for this problem.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests