Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

First run fails: zm.config doesn't exist in engine #125

Closed
gfrancesco opened this issue Oct 19, 2020 · 20 comments
Closed

First run fails: zm.config doesn't exist in engine #125

gfrancesco opened this issue Oct 19, 2020 · 20 comments

Comments

@gfrancesco
Copy link

Hi,
I pulled the image and run the container with the same command in the readme, but it doesn't start.
I'm on Docker desktop for MacOS (19.03.13).

Here's the full commands and last part of the logs for reference:

docker pull dlandon/zoneminder

docker run -d --name="Zoneminder" \
--net="bridge" \
--privileged="true" \
-p 8443:443/tcp \
-p 9000:9000/tcp \
-e TZ="Europe/Rome" \
-e SHMEM="50%" \
-e PUID="99" \
-e PGID="100" \
-e INSTALL_HOOK="0" \
-e INSTALL_FACE="0" \
-e INSTALL_TINY_YOLOV3="0" \
-e INSTALL_YOLOV3="0" \
-e INSTALL_TINY_YOLOV4="0" \
-e INSTALL_YOLOV4="0" \
-e MULTI_PORT_START="0" \
-e MULTI_PORT_END="0" \
-v "/Users/fra/Documents/work/zm/docker_vol":"/config":rw \
-v "/Users/fra/Documents/work/zm/docker_vol/data":"/var/cache/zoneminder":rw \
dlandon/zoneminder
*** Running /etc/my_init.d/40_firstrun.sh...
Using existing conf folder
Moving zm.conf to config folder
Moving zmeventnotification.ini
Moving secrets.ini
Moving opencv.sh
Moving debug_opencv.sh
Moving the event notification server
Using existing ssmtp folder
Using existing mysql database folder
Copy /config/control/ scripts to /usr/share/perl5/ZoneMinder/Control/
Copy /config/conf/ scripts to /etc/zm/conf.d/
Creating symbolink links
Using existing data directory for events
Using existing data directory for images
Using existing data directory for temp
Using existing data directory for cache
no crontab for root
Setting shared memory to : 50% of 10208696 bytes
Starting services...
 * Starting MariaDB database server mysqld
   ...done.
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11613]: Upgrading MySQL tables if necessary.
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11617]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11617]: Looking for 'mysql' as: /usr/bin/mysql
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11617]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11617]: This installation of MySQL is already upgraded to 10.1.44-MariaDB, use --force if you still need to run mysql_upgrade
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11624]: Checking for insecure root accounts.
Oct 19 19:00:20 81f80a062806 /etc/mysql/debian-start[11628]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
 * Starting Apache httpd web server apache2
 * 
Starting ZoneMinder:
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
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.
ZoneMinder failed to start

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

*** Killing all processes...
Oct 19 19:00:22 81f80a062806 syslog-ng[35]: syslog-ng shutting down; version='3.13.2'

Thanks

@idank
Copy link

idank commented Oct 24, 2020

Same here

@matthewkrupnik
Copy link

I have same exact error. Brand new install on Windows 10 using Docker Desktop with WSL2. Same exact image was working fine a week ago on Ubuntu. Not sure it's related to docker specifically and host OS.

I also do get this failure when it's running updates on startup

Err:16 http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu bionic InRelease
  Could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out [IP: 91.189.95.83 80]
Err:17 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.83 80]
Fetched 9662 kB in 30s (317 kB/s)
Reading package lists...
W: Failed to fetch http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu/dists/bionic/InRelease  Could not connect to ppa.launchpad.net:80 (91.189.95.83), connection timed out [IP: 91.189.95.83 80]
W: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/bionic/InRelease  Unable to connect to ppa.launchpad.net:http: [IP: 91.189.95.83 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Warning: Unable to update!  Check Internet connection.

and then it is followed by same error as above

Starting services...
 * Starting MariaDB database server mysqld
   ...done.
Oct 27 09:41:46 50130e163b92 /etc/mysql/debian-start[760]: Upgrading MySQL tables if necessary.
Oct 27 09:41:46 50130e163b92 /etc/mysql/debian-start[764]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Oct 27 09:41:46 50130e163b92 /etc/mysql/debian-start[764]: Looking for 'mysql' as: /usr/bin/mysql
Oct 27 09:41:46 50130e163b92 /etc/mysql/debian-start[764]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Oct 27 09:41:46 50130e163b92 /etc/mysql/debian-start[764]: This installation of MySQL is already upgraded to 10.1.47-MariaDB, use --force if you still need to run mysql_upgrade
Oct 27 09:41:46 50130e163b92 /etc/mysql/debian-start[771]: Checking for insecure root accounts.
r all Aria tables
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.

@greggchappell
Copy link

Same here. Windows 10 using Docker Desktop and WSL2.

@dlandon
Copy link
Owner

dlandon commented Nov 9, 2020

This docker was developed for and is supported mainly on Unraid. It appears that this issue comes up when the docker is used on other platforms. I have absolutely no way to reproduce this issue so I can find a fix.

My suggestion is to use the Zoneminder forum to get help with troubleshooting the problem. Once a solution is found, I can then apply an appropriate fix.

@gfrancesco
Copy link
Author

Maybe the README can be updated to clarify that the docker instructions are supported/tested only on Unraid? There is no mention of it at the moment.
I will not follow up on this issue since I decided for other reasons to not use Zoneminder at the end.

@dlandon
Copy link
Owner

dlandon commented Nov 9, 2020

My point was that I have no way to duplicate this issue. Even if it were developed and tested on any other platform, it's the same issue. It's an overwhelming task to test all available platforms to verify correct operation for a 'free' docker software.

@paularmstrong
Copy link

I'm having the same issue with Docker on OS X. Anyone able to get things working? All I found in the ZM forums was something from 2009 mentioning that the DB was not set up correctly and that step was missed.

@paularmstrong
Copy link

I spun up the zoneminderhq/zoneminder docker image and everything works fine, so either that image is behind on releases or there's something wrong with this image.

@paularmstrong
Copy link

paularmstrong commented Nov 18, 2020

Update: I turned off gRPC-FUSE in the Docker for Desktop settings and now it seems to start up fine.

@dlandon
Copy link
Owner

dlandon commented Nov 18, 2020

I have added a new environment variable that will prevent MySql and Zoneminder from starting so the docker will stay running and you can go into the docker and troubleshoot. Look at the readme for details.

@PrplHaz4
Copy link
Contributor

Same here. Windows 10 using Docker Desktop and WSL2.

I'm pretty sure MariaDB has issues in Docker on Windows - check out this issue for info: docker-library/percona#42 (comment)

I believe the "solution" (if you can call it that) was to use docker volumes instead of a bind mount - I ran into this years ago so not sure what the current state is....

@kabadisha
Copy link

You might also want to try it with the latest release - privileged mode was just removed and that seems to have been causing issues with MariaDB for others in the past.
(Make sure you update your docker run command as per the updated readme).

@snimavat
Copy link

snimavat commented Jan 3, 2021

Same error - Docker version 20.10.0, build 7287ab3 on osx Big Sur (Followed latest readme

 * Starting Apache httpd web server apache2
 *
 * Starting MariaDB database server mysqld
   ...done.
Jan  3 08:24:38 544e49a5a986 /etc/mysql/debian-start[817]: Upgrading MySQL tables if necessary.
Jan  3 08:24:38 544e49a5a986 /etc/mysql/debian-start[821]: Looking for 'mysql' as: /usr/bin/mysql
Jan  3 08:24:38 544e49a5a986 /etc/mysql/debian-start[821]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jan  3 08:24:38 544e49a5a986 /etc/mysql/debian-start[821]: This installation of MySQL is already upgraded to 10.3.25-MariaDB, use --force if you still need to run mysql_upgrade
Jan  3 08:24:38 544e49a5a986 /etc/mysql/debian-start[828]: Checking for insecure root accounts.
Jan  3 08:24:38 544e49a5a986 /etc/mysql/debian-start[832]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
Compilation failed in require at /usr/bin/zmupdate.pl line 73.
BEGIN failed--compilation aborted at /usr/bin/zmupdate.pl line 73.
Starting ZoneMinder:
DBD::mysql::st execute failed: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 97.
Can't execute: Table 'zm.config' doesn't exist in engine at /usr/share/perl5/ZoneMinder/Config.pm line 147.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 147.
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.
ZoneMinder failed to start

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

When i do show tables, i can see it lists following tables

+-----------------+
| Tables_in_zm    |
+-----------------+
| Config          |
| ControlPresets  |
| Controls        |
| Devices         |
| Events          |
| Events_Archived |
| Events_Day      |
| Events_Hour     |
| Events_Month    |
| Events_Week     |
| Filters         |
| Frames          |
| Groups          |
| Groups_Monitors |
| Logs            |
| Manufacturers   |
| Maps            |
| Models          |
| MonitorPresets  |
| Monitor_Status  |
| Monitors        |
| MontageLayouts  |
| Servers         |
| States          |
| Stats           |
| Storage         |
| TriggersX10     |
| Users           |
| ZonePresets     |
| Zones           |
+-----------------+

@kabadisha
Copy link

First, check that the run command you are using has been updated as per the update readme. Specifically, look at how the shmem flags have changed and the privileged flag too. Quite a few people got caught out by not noticing that with the new release.

Other than that, how are you running docker on you OSX host? If you are using the Docker desktop app with a GUI, try using the command line flavour instead (installed via HomeBrew) - You may get different results (others have reported different behaviour).
I have been using the command line flavour on my OSX host without issues.

You can find a good primer on how to do that in the second answer on this stack overflow answer: https://stackoverflow.com/questions/21871479/docker-cant-connect-to-docker-daemon

Other than that, I don't have any other suggestions for you - I'm a bit of a n00b with ZoneMinder I'm afraid. I guess you can try a fresh install and see if you get different results.

@snimavat
Copy link

snimavat commented Jan 3, 2021

I think it has some thing to do with file system case sensitivity, when i ran the docker image without binding any local volumes so that all data/tables will be stored in image it self, it ran without above error

@kabadisha
Copy link

Could be a permissions issue. The permissions are a bit of a mess when mounting local volumes. You could try chmod-ing the mounted dir with 777 on the host and see if that helps.
This container doesn't currently isolate users in a namespace, so ids of users in the container are passed directly to the host when reading/writing to mounts. These ids rarely match up with users on the host with correct privs. As such, the only workaround currently is to set 777 permissions.

@rmarliere
Copy link

Update: I turned off gRPC-FUSE in the Docker for Desktop settings and now it seems to start up fine.

Thank you. This worked for me on macOS.

@dlandon dlandon closed this as completed Jan 7, 2021
@SirLouen
Copy link

SirLouen commented May 14, 2022

One year later, I'm finding this issue with a WSL2 / Docker installation. Which was the official solution ?

I'm literally running this command:

A) privileged false

  • privileged mode was just removed and that seems to have been causing issues with MariaDB for others in the past.

B) Latest release

docker run -d --name="Zoneminder" --net="bridge" --privileged="false" --shm-size="5G" -p 8443:443/tcp -p 9000:9000/tcp -e TZ="Europe/Madrid" -e PUID="99" -e PGID="100" -e INSTALL_HOOK="0" -e INSTALL_FACE="0" -e INSTALL_TINY_YOLOV3="0" -e INSTALL_YOLOV3="0" -e INSTALL_TINY_YOLOV4="0" -e INSTALL_YOLOV4="0" -e MULTI_PORT_START="0" -e MULTI_PORT_END="0" -v "D:\VMS\zoneminder\mnt\zoneminder:/config:rw" -v "D:\VMS\zoneminder\mnt\zoneminder\data:/var/cache/zoneminder:rw" dlandon/zoneminder

The folders have Full Access from the privilege perspective within Windows...

EDIT: Also tried with dlandon/zoneminder.machine.learning SAME ISSUE :(

@builder555
Copy link

same issue here

@builder555
Copy link

I think it has some thing to do with file system case sensitivity, when i ran the docker image without binding any local volumes so that all data/tables will be stored in image it self, it ran without above error

that sounds like a bug in the code: it's expecting a file with a name that doesn't, exist upper/lower case mixup?

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

No branches or pull requests