Page 1 of 1

dlandon's docker runs into mysql problems on fresh install

Posted: Sat Jun 19, 2021 8:50 pm
by SpikeyGG
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.

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

Posted: Mon Jun 21, 2021 1:19 pm
by Juidyuy2
same issue for me!
Thanks for reporting it!

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

Posted: Wed Jun 30, 2021 9:24 am
by cybersteel8
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!

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

Posted: Wed Jun 30, 2021 10:50 am
by dlandon
I have applied a fix for this problem.

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

Posted: Mon Aug 30, 2021 12:47 pm
by kysdaddy
Hello,
I keep having this issue. I delete and recreate the entire system and a couple of weeks later the same error.

When you say "I have applied a fix for this problem." what does that mean, is there something in particular that I need to do to get past this ?

Chas

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

Posted: Thu Jan 05, 2023 4:00 am
by Prinler
I am trying to get this also to work and it crashes every single time. Ive asked many friends who all use UNRAID and they also cant get it to work. Ive tried to use the variable to stop it from booting and that never works.

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

Posted: Thu Jan 05, 2023 8:32 am
by Magic919
Post on the Unraid forum where DLandon hangs out.