Instal problem on OMV5 with dlandon/zoneminder image

Support for the docker image maintained by dlandon
Post Reply
FabriceC01
Posts: 2
Joined: Sun Nov 22, 2020 9:25 pm

Instal problem on OMV5 with dlandon/zoneminder image

Post by FabriceC01 »

Hello,
I've already installed ZM with this image on my OMV5 (on x86) in October but I had some crashes (not necessarily due to ZM).
After a total reinstall of OMV5 and docker I can't install ZM anymore.
My compose file (the same used in october) is :

Code: Select all

---
version: "2"
services:
 zoneminder:
   container_name: zoneminder
   image: dlandon/zoneminder:latest
   restart: unless-stopped
   ports:
     - 82:80/tcp
     - 9100:9000/tcp
   network_mode: "bridge"
   privileged: true
   environment:
     - TZ=Europe/Paris
     - PGID=100
     - PUID=1000
     - SHMEM=50%
     - INSTALL_HOOK=1
     - INSTALL_FACE=1
     - INSTALL_TINY_YOLOV3=0
     - INSTALL_YOLOV3=0
     - INSTALL_TINY_YOLOV4=0
     - INSTALL_YOLOV4=0
     - MULTI_PORT_START=0
     - MULTI_PORT_END=0
   volumes:
     - /srv/dev-disk-by-label-4ToNas/Appdata/zoneminder:/config:rw
     - /srv/dev-disk-by-label-4ToNas/Surveillance:/var/cache/zoneminder:rw
The container created is well running but when I go to the log I see some errors during the install script and it's killing all processes before restarting.

The container log is this :

Code: Select all

Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease,
  Temporary failure resolving 'security.ubuntu.com',
Err:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease,
  Temporary failure resolving 'archive.ubuntu.com',
Err:5 http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu bionic InRelease,
  Temporary failure resolving 'ppa.launchpad.net',
Err:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease,
  Temporary failure resolving 'archive.ubuntu.com',
Err:7 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease,
  Temporary failure resolving 'ppa.launchpad.net',
Reading package lists...,
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'archive.ubuntu.com',
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com',
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com',
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Temporary failure resolving 'security.ubuntu.com',
W: Failed to fetch http://ppa.launchpad.net/iconnor/zoneminder-1.34/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'ppa.launchpad.net',
W: Failed to fetch http://ppa.launchpad.net/jonathonf/ffmpeg-4/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'ppa.launchpad.net',
W: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/bionic/InRelease  Temporary failure resolving 'ppa.launchpad.net',
W: Some index files failed to download. They have been ignored, or old ones used instead.,
Warning: Unable to update!  Check Internet connection.,
*** Running /etc/my_init.d/30_gen_ssl_keys.sh...,
using existing keys in "/config/keys",
*** Running /etc/my_init.d/40_firstrun.sh...,
Using existing conf folder,
le zm.conf already moved,
Moving zmeventnotification.ini,
Moving secrets.ini,
Moving opencv.sh,
Moving debug_opencv.sh,
Moving the event notification server,
Moving the pushover api,
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,
usermod: no changes,
usermod: no changes,
usermod: no changes,
Using existing data directory for events,
Correcting /var/cache/zoneminder/events permissions...,
Using existing data directory for images,
Correcting /var/cache/zoneminder/images permissions...,
Using existing data directory for temp,
Correcting /var/cache/zoneminder/temp permissions...,
Using existing data directory for cache,
Correcting /var/cache/zoneminder/cache permissions...,
no crontab for root,
Setting shared memory to : 50% of 3898336 bytes,
Installing machine learning modules & hooks...,
Moving objectconfig.ini,
Moving config_upgrade.py,
Moving zm_event_start.sh,
Moving zm_event_end.sh,
Moving zm_detect.py,
Moving zm_train_faces.py,
/etc/my_init.d/40_firstrun.sh: line 536: pip3: command not found,
Hook installation completed,
Compiling opencv - this will take a while...,
Starting services...,
 * Starting MariaDB database server mysqld,
   ...done.,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[393]: Upgrading MySQL tables if necessary.,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[397]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[397]: Looking for 'mysql' as: /usr/bin/mysql,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[397]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[397]: This installation of MySQL is already upgraded to 10.1.47-MariaDB, use --force if you still need to run mysql_upgrade,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[404]: Checking for insecure root accounts.,
Nov  3 15:27:00 b967c25cc84d /etc/mysql/debian-start[408]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables,
,
Database already at version 1.34.22, update skipped.,
,
,
Freshening configuration in database,
Migratings passwords, if any...,
Loading config from DB 230 entries,
Saving config to DB 230 entries,
 * Starting Apache httpd web server apache2,
 * ,
Starting ZoneMinder:,
Nov  3 15:27:02 b967c25cc84d zmpkg[476]: INF [Sanity checking States table...],
Nov  3 15:27:02 b967c25cc84d zmpkg[476]: INF [Command: start],
DBI connect('database=zm;host=localhost','zmuser',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) at /usr/share/perl5/ZoneMinder/Database.pm line 110.,
DBI connect('database=zm;host=localhost','zmuser',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) at /usr/share/perl5/ZoneMinder/Database.pm line 110.,
DBI connect('database=zm;host=localhost','zmuser',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) at /usr/share/perl5/ZoneMinder/Database.pm line 110.,
Nov  3 15:27:02 b967c25cc84d zmdc[483]: ERR [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) error val:],
Nov  3 15:27:02 b967c25cc84d zmdc[483]: ERR [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) error val:],
Can't call method "prepare_cached" on an undefined value at /usr/share/perl5/ZoneMinder/Config.pm line 96.,
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/zmdc.pl line 67.,
BEGIN failed--compilation aborted at /usr/bin/zmdc.pl line 67.,
Nov  3 15:27:02 b967c25cc84d zmpkg[476]: ERR [Unable to run "sudo -u www-data /usr/bin/zmdc.pl check", output is "", status is 255],
neMinder failed to start,
,
*** /etc/my_init.d/40_firstrun.sh failed with status 1,
,
*** Killing all processes...,
Nov  3 15:27:02 b967c25cc84d syslog-ng[16]: syslog-ng shutting down; version='3.13.2', 
I'm not the only one who have these problems (on the OMV5 forum or on dlandon github issues).

I've identified 2 problems :
  • One with the name resolving on the beginning.
    One with the mysql connection at the end.
Thanks to the last change of Dan Landon which permit me to stop the container before the killing (NO_START_ZM mode), I could debug and with some Internet research I found that I have to do this command to solve the first problem :

Code: Select all

chmod 0644 /etc/resolv.conf
the apt install is OK after.
for the second one which is a permission problem again I need to do :

Code: Select all

chmod 0777 /var/run/mysqld/mysqld.sock
after that zoneminder start succesfully.

I would like to know the reason of these problems because Dan don't want to modify his image for now and I can't restart my container without redo all of this.

Is there someone who have an idea of this problem source ?

thanks in advance.

Fabrice
FabriceC01
Posts: 2
Joined: Sun Nov 22, 2020 9:25 pm

Re: Instal problem on OMV5 with dlandon/zoneminder image

Post by FabriceC01 »

Hello,
No idea about my problem ?
thank you
Fabrice
User avatar
Bluemax
Posts: 121
Joined: Wed Jun 12, 2019 5:15 pm

Re: Instal problem on OMV5 with dlandon/zoneminder image

Post by Bluemax »

Could be an umask issue for 'mysqld.sock'. Default process umask is '0022' that results in g-w (e.g. 640) socket that doesn't allow other group members to connect to the socket. This usually is handled by the spawning process (init system, systemd or openrc).
Post Reply