Closed drummerroma closed 7 years ago
I'm not familiar with docker compose. What options did you use? Is the local config folder set up properly?
I'm getting the same error with the recommended settings on OSX.
[elephanthunter:~] $ docker run --name="Zoneminder" --privileged=true -v ~/zoneminder-original.config:/config:rw -v /etc/localtime:/etc/localtime:ro -p 8217:80 aptalca/docker-zoneminder
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/firstrun.sh...
apache.conf already exists
zm.conf already exists
using existing mysql database
using existing data directory
using existing perl data directory
creating symbolink links
setting the correct local time
mv: cannot move ‘/etc/localtime.dpkg-new’ to ‘/etc/localtime’: Device or resource busy
increasing shared memory
starting services
* Starting MySQL database server mysqld
...done.
* Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
* Starting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
*
Starting ZoneMinder: DBD::mysql::st execute failed: Table 'zm.config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 94.
Can't execute: Table 'zm.config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 100.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 100.
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 37.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 37.
failure
*** /etc/my_init.d/firstrun.sh failed with status 255
*** Killing all processes...
@leebradley is this a new install or an existing one that worked at first but broke later?
According to google searches, that error happens when the mysql database is not set up properly (table does not exist). It seems you are using the zoneminder version 1.28, which creates its own mysql tables.
You can try installing the version 1.29 from here: https://hub.docker.com/r/aptalca/zoneminder-1.29/ In 1.29, zoneminder no longer creates its own database tables, so it is done by the docker container during initial setup and you shouldn't have that issue (not to mention it has a bunch of new features over the 1.28 version)
It should be a new install. I completely removed the container and re-created (this time using 1.29), but it throws the same error.
[elephanthunter:~] 1 $ rm -rf ~/zoneminder-1.29-config/
[elephanthunter:~] $ docker rm Zoneminder-1.29
Zoneminder-1.29
[elephanthunter:~] $ docker run --name="Zoneminder-1.29" --privileged=true -v ~/zoneminder-1.29-config:/config:rw -e TZ="America/Phoenix" -p 8085:80 aptalca/zoneminder-1.29
*** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/firstrun.sh...
copying php.ini
moving mysql to config folder
rm: cannot remove ‘/config/mysql’: No such file or directory
moving data folder to config folder
moving perl data folder to config folder
creating symbolink links
setting the correct local time
Current default time zone: 'America/Phoenix'
Local time is now: Sat Aug 20 15:20:38 MST 2016.
Universal Time is now: Sat Aug 20 22:20:38 UTC 2016.
increasing shared memory
starting services
* Starting MySQL database server mysqld
...done.
* Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
* Starting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
*
Starting ZoneMinder: DBD::mysql::st execute failed: Table 'zm.config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 99.
Can't execute: Table 'zm.config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 119.
BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 119.
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 48.
BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 48.
failure
*** /etc/my_init.d/firstrun.sh failed with status 255
*** Killing all processes...
I'm having a hard time pinpointing this issue. Similar error messages are reported on zoneminder forums and they seem to be caused by the mysql database not being set up properly. In this v1.29, the mysql database is set up and ready to go within the docker image that your system pulls. So I'm thinking it has to do with zm not being able to access the mysql database properly. This is not an issue on linux systems and may be osx specific. Unfortunately I do not have an osx device to test on.
Could you do 2 things for me? 1) Let me know whether mysql is running on the host machine (see this issue with docker on osx: https://github.com/docker/docker/issues/7512 ) 2) Post lines 99, 119, 33 and 48 of the config.pm file, it is stored in your config folder under perl5/Zoneminder/
Thanks
I am running this on docker 1.12.0 on OSx with docker-compose. But firstrun.sh fails with error-code.
zoneminder | Starting ZoneMinder: DBD::mysql::st execute failed: Table 'zm.config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 99. zoneminder | Can't execute: Table 'zm.config' doesn't exist at /usr/share/perl5/ZoneMinder/Config.pm line 119. zoneminder | BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder/Config.pm line 119. zoneminder | Compilation failed in require at /usr/share/perl5/ZoneMinder.pm line 33. zoneminder | BEGIN failed--compilation aborted at /usr/share/perl5/ZoneMinder.pm line 33. zoneminder | Compilation failed in require at /usr/bin/zmpkg.pl line 48. zoneminder | BEGIN failed--compilation aborted at /usr/bin/zmpkg.pl line 48. zoneminder | failure zoneminder | zoneminder | * /etc/my_init.d/firstrun.sh failed with status 255 zoneminder | zoneminder | * Killing all processes... zoneminder exited with code 1