tiredofit / docker-backuppc

Docker web based enterprise backup software
MIT License
25 stars 4 forks source link

Fails to start on Truenas SCALE #14

Closed sigmoidal closed 1 year ago

sigmoidal commented 1 year ago

On Truenas SCALE the following occurs (even with v2.0.6):

2022-12-18 08:28:50.909910+00:00Image:  tiredofit/backuppc | Version  6.0.0 Type 'image_changelog' for details
2022-12-18 08:28:50.909930+00:00Repository/Issues/Support:  https://github.com/tiredofit/docker-backuppc/
2022-12-18 08:28:50.912481+00:00Sponsor me for development and upkeep: https://www.tiredofit.ca/sponsor
2022-12-18 08:28:50.912605+00:002022-12-18T08:28:50.912605878Z
2022-12-18 08:28:51.333534+00:002022-12-18.10:28:51 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern'
2022-12-18 08:28:51.515482+00:002022-12-18.10:28:51 [NOTICE] ** [scheduling] Container configured for scheduled tasks with 'cron'
2022-12-18 08:28:51.851491+00:002022-12-18.10:28:51 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay'
2022-12-18 08:28:53.718682+00:002022-12-18.10:28:53 [INFO] ** [backuppc] BackupPC 4.4.0 initialization complete, now starting web server on port 80
2022-12-18 08:28:54.011940+00:002022-12-18.10:28:54 [STARTING] ** [fcgiwrap] [1] Starting fcgiwrap
2022-12-18 08:28:54.012532+00:002022-12-18.10:28:54 [STARTING] ** [nginx] [1] Starting nginx 1.23.2
2022-12-18 08:28:54.022091+00:002022-12-18.10:28:54 [STARTING] ** [backuppc] [1] Starting BackupPC 4.4.0
2022-12-18 08:28:54.109819+00:002022-12-18.10:28:54 [STARTING] ** [monitoring] [1] Starting Zabbix Agent (modern) 6.2.4
2022-12-18 08:28:54.199495+00:002022-12-18.10:28:54 [STARTING] ** [scheduling] [1] Starting cron
2022-12-18 08:28:55.029357+00:002022-12-18.10:28:55 [STARTING] ** [backuppc] [2] Starting BackupPC 4.4.0
...
...
2022-12-18 08:29:41.121006+00:002022-12-18.10:29:41 [STARTING] ** [backuppc] [48] Starting BackupPC 4.4.0
2022-12-18 08:29:42.121011+00:002022-12-18.10:29:42 [STARTING] ** [backuppc] [49] Starting BackupPC 4.4.0
2022-12-18 08:29:43.122099+00:002022-12-18.10:29:43 [STARTING] ** [backuppc] [50] Starting BackupPC 4.4.0
2022-12-18 08:29:44.126831+00:002022-12-18.10:29:44 [ERROR] ** [backuppc] POTENTIAL RUNWAY DETECTECTED: Disabling 20-backuppc service because it has tried restarting '50' times
2022-12-18 08:40:25.765622+00:00s6-svwait: fatal: supervisor died
tiredofit commented 1 year ago

You can try adding SHOW_OUTPUT=TRUE as an environment variable from the upstream base image (tiredofit/alpine) and it should give you reasons as to whats happening with those binaries..

sigmoidal commented 1 year ago

I'm just using the Truenas app in Truecharts. Anyhow, here is the log:

2022-12-18 19:49:35.871038+00:00 ,---.
2022-12-18 19:49:35.871126+00:00 ,--------.,--.                 ,--.            ,---.    ,--. ,--------.|   |
2022-12-18 19:49:35.871144+00:00 '--.  .--'`--',--.--. ,---.  ,-|  |     ,---. /  .-'    |  | '--.  .--'|  .'
2022-12-18 19:49:35.871157+00:00 |  |   ,--.|  .--'| .-. :' .-. |    | .-. ||  `-,    |  |    |  |   |  |
2022-12-18 19:49:35.871178+00:00 |  |   |  ||  |   \   --.\ `-' |    ' '-' '|  .-'    |  |.--.|  |   `--'
2022-12-18 19:49:35.871191+00:00 `--'   `--'`--'    `----' `---'      `---' `--'      `--''--'`--'   .--.
2022-12-18 19:49:35.871204+00:00 '--'
2022-12-18 19:49:35.871230+00:00 Image:  tiredofit/backuppc | Version  6.0.0 Type 'image_changelog' for details
2022-12-18 19:49:35.871244+00:00 Repository/Issues/Support:  https://github.com/tiredofit/docker-backuppc/
2022-12-18 19:49:35.874101+00:00 Sponsor me for development and upkeep: https://www.tiredofit.ca/sponsor
2022-12-18 19:49:35.874296+00:00 2022-12-18T19:49:35.874296409Z
2022-12-18 19:49:36.327331+00:00 2022-12-18.21:49:36 [NOTICE] ** [monitoring] Container configured for monitoring with 'zabbix modern'
2022-12-18 19:49:36.504595+00:00 2022-12-18.21:49:36 [NOTICE] ** [scheduling] Container configured for scheduled tasks with 'cron'
2022-12-18 19:49:36.842220+00:00 2022-12-18.21:49:36 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfix-relay'
2022-12-18 19:49:38.516676+00:00 2022-12-18T19:49:38.516676699Z
2022-12-18 19:49:38.516738+00:00 Found /etc/backuppc//config.pl, so this is an upgrade of an
2022-12-18 19:49:38.516753+00:00 existing BackupPC installation.  We will verify some existing
2022-12-18 19:49:38.516765+00:00 information, but you will probably not need to make any
2022-12-18 19:49:38.516796+00:00 changes - just hit ENTER to each question.
2022-12-18 19:49:38.516809+00:00 2022-12-18T19:49:38.516809239Z
2022-12-18 19:49:38.516821+00:00 I found the following locations for these programs:
2022-12-18 19:49:38.516833+00:00 2022-12-18T19:49:38.516833243Z
2022-12-18 19:49:38.516845+00:00 bzip2        => /usr/bin/bzip2
2022-12-18 19:49:38.516858+00:00 cat          => /bin/cat
2022-12-18 19:49:38.516878+00:00 df           => /bin/df
2022-12-18 19:49:38.516891+00:00 gtar/tar     => /bin/tar
2022-12-18 19:49:38.516903+00:00 gzip         => /usr/bin/gzip
2022-12-18 19:49:38.516915+00:00 hostname     => /bin/hostname
2022-12-18 19:49:38.516935+00:00 nmblookup    => /usr/bin/nmblookup
2022-12-18 19:49:38.516947+00:00 par2         => /usr/local/bin/par2
2022-12-18 19:49:38.516959+00:00 perl         => /usr/bin/perl
2022-12-18 19:49:38.516970+00:00 ping         => /bin/echo
2022-12-18 19:49:38.516982+00:00 ping6        => /bin/echo
2022-12-18 19:49:38.517002+00:00 rrdtool      => /usr/bin/rrdtool
2022-12-18 19:49:38.517015+00:00 rsync        => /usr/bin/rsync
2022-12-18 19:49:38.517027+00:00 rsync_bpc    => /usr/local/bin/rsync_bpc
2022-12-18 19:49:38.517039+00:00 sendmail     => /usr/sbin/sendmail
2022-12-18 19:49:38.517051+00:00 smbclient    => /usr/bin/smbclient
2022-12-18 19:49:38.517070+00:00 split        => /usr/bin/split
2022-12-18 19:49:38.517082+00:00 ssh/ssh2     => /usr/bin/ssh
2022-12-18 19:49:38.517094+00:00 2022-12-18T19:49:38.517094756Z
2022-12-18 19:49:38.517106+00:00 --> Are these paths correct? [y]
2022-12-18 19:49:38.743212+00:00 Can't use string ("0") as a HASH ref while "strict refs" in use at configure.pl line 742.
2022-12-18 19:49:38.743627+00:00 2022-12-18T19:49:38.743627802Z
2022-12-18 19:49:38.743671+00:00 Please tell me the hostname of the machine that BackupPC will run on.
2022-12-18 19:49:38.743686+00:00 2022-12-18T19:49:38.743686616Z
2022-12-18 19:49:38.743698+00:00 --> BackupPC will run on host [localhost]
2022-12-18 19:49:38.743727+00:00 2022-12-18T19:49:38.743727627Z
2022-12-18 19:49:38.743740+00:00 BackupPC should run as a dedicated user with limited privileges.  You
2022-12-18 19:49:38.743752+00:00 need to create a user.  This user will need read/write permission on
2022-12-18 19:49:38.743764+00:00 the main data directory and read/execute permission on the install
2022-12-18 19:49:38.743788+00:00 directory (these directories will be setup shortly).
2022-12-18 19:49:38.743801+00:00 2022-12-18T19:49:38.743801026Z
2022-12-18 19:49:38.743812+00:00 The primary group for this user should also be chosen carefully.
2022-12-18 19:49:38.743824+00:00 The data directories and files will have group read permission,
2022-12-18 19:49:38.743836+00:00 so group members can access backup files.
2022-12-18 19:49:38.743857+00:00 2022-12-18T19:49:38.743857094Z
2022-12-18 19:49:38.743869+00:00 --> BackupPC should run as user [backuppc]
2022-12-18 19:49:38.743881+00:00 2022-12-18T19:49:38.743881192Z
2022-12-18 19:49:38.743892+00:00 Please specify an install directory for BackupPC.  This is where the
2022-12-18 19:49:38.743904+00:00 BackupPC scripts, library and documentation will be installed.
2022-12-18 19:49:38.743927+00:00 2022-12-18T19:49:38.743927695Z
2022-12-18 19:49:38.743940+00:00 --> Install directory (full path) [/usr/local/BackupPC]
2022-12-18 19:49:38.743953+00:00 2022-12-18T19:49:38.743953369Z
2022-12-18 19:49:38.743964+00:00 Please specify a data directory for BackupPC.  This is where all the
2022-12-18 19:49:38.743976+00:00 PC backup data is stored.  This file system needs to be big enough to
2022-12-18 19:49:38.743997+00:00 accommodate all the PCs you expect to backup (eg: at least several GB
2022-12-18 19:49:38.744010+00:00 per machine).
2022-12-18 19:49:38.744022+00:00 2022-12-18T19:49:38.744022449Z
2022-12-18 19:49:38.744033+00:00 --> Data directory (full path) [/var/lib/backuppc/]
2022-12-18 19:49:38.744056+00:00 2022-12-18T19:49:38.744056621Z
2022-12-18 19:49:38.744069+00:00 BackupPC has SCGI and CGI perl interfaces that run under Apache.  You need
2022-12-18 19:49:38.744081+00:00 to pick which one to run.
2022-12-18 19:49:38.744092+00:00 2022-12-18T19:49:38.744092917Z
2022-12-18 19:49:38.744104+00:00 For SCGI, Apache uses the scgi_mod module to communicate with BackupPC_Admin_SCGI,
2022-12-18 19:49:38.744127+00:00 which handles the requests.  This allows Apache to run as a different user as
2022-12-18 19:49:38.744140+00:00 backuppc.  To use SCGI you need to set SCGIServerPort to any spare
2022-12-18 19:49:38.744152+00:00 non-privileged TCP port number.  A negative value disables SCGI.
2022-12-18 19:49:38.744163+00:00 2022-12-18T19:49:38.744163963Z
2022-12-18 19:49:38.744185+00:00 ** Important security warning!!  The SCGIServerPort must not be accessible by
2022-12-18 19:49:38.744197+00:00 ** anyone untrusted.  That means you can't allow untrusted users access to the
2022-12-18 19:49:38.744209+00:00 ** BackupPC server, and you should block the SCGIServerPort TCP port from
2022-12-18 19:49:38.744222+00:00 ** network access.
2022-12-18 19:49:38.744241+00:00 2022-12-18T19:49:38.744241155Z
2022-12-18 19:49:38.744253+00:00 The traditional alternative is to use CGI.  In this case, an executable needs
2022-12-18 19:49:38.744265+00:00 to be installed Apache's cgi-bin directory.  This executable needs to run as
2022-12-18 19:49:38.744277+00:00 set-uid backuppc, or it can be run under mod_perl with Apache
2022-12-18 19:49:38.744300+00:00 running as user backuppc.
2022-12-18 19:49:38.744313+00:00 2022-12-18T19:49:38.744313412Z
2022-12-18 19:49:38.744324+00:00 --> SCGI port (-1 to disable) [-1]
2022-12-18 19:49:38.744338+00:00 --> CGI bin directory (full path, or empty for no CGI) [/www/cgi-bin/BackupPC]
2022-12-18 19:49:38.744351+00:00 2022-12-18T19:49:38.744351196Z
2022-12-18 19:49:38.744374+00:00 BackupPC's CGI and SCGI script need to display various PNG/GIF
2022-12-18 19:49:38.744387+00:00 images that should be stored where Apache can serve them.  They
2022-12-18 19:49:38.744399+00:00 should be placed somewhere under Apache's DocumentRoot.  BackupPC
2022-12-18 19:49:38.744411+00:00 also needs to know the URL to access these images.  Example:
2022-12-18 19:49:38.744430+00:00 2022-12-18T19:49:38.744430601Z
2022-12-18 19:49:38.744442+00:00 Apache image directory:  /var/www/htdocs/BackupPC
2022-12-18 19:49:38.744454+00:00 URL for image directory: /BackupPC
2022-12-18 19:49:38.744466+00:00 2022-12-18T19:49:38.744466312Z
2022-12-18 19:49:38.744478+00:00 The URL for the image directory should start with a slash.
2022-12-18 19:49:38.744497+00:00 2022-12-18T19:49:38.744497261Z
2022-12-18 19:49:38.744509+00:00 --> Apache image directory (full path, or empty for no S/CGI) [/www/html/BackupPC]
2022-12-18 19:49:38.744521+00:00 --> URL for image directory (omit http://host; starts with '/', or empty for no S/CGI) [/BackupPC]
2022-12-18 19:49:38.744533+00:00 2022-12-18T19:49:38.744533827Z
2022-12-18 19:49:38.744557+00:00 Ok, we're about to:
2022-12-18 19:49:38.744570+00:00 2022-12-18T19:49:38.744570103Z
2022-12-18 19:49:38.744581+00:00 - install the binaries, lib and docs in /usr/local/BackupPC
2022-12-18 19:49:38.744593+00:00 - create the data directory /var/lib/backuppc/
2022-12-18 19:49:38.744605+00:00 - optionally install the cgi-bin interface
2022-12-18 19:49:38.744629+00:00 - create/update the config.pl file /etc/backuppc//config.pl
2022-12-18 19:49:38.744641+00:00 2022-12-18T19:49:38.744641766Z
2022-12-18 19:49:38.744653+00:00 --> Do you want to continue? [y]
2022-12-18 19:49:38.744665+00:00 Created /usr/local/BackupPC/bin
2022-12-18 19:49:38.744676+00:00 Created /usr/local/BackupPC/share
2022-12-18 19:49:38.744696+00:00 Created /usr/local/BackupPC/share/doc
2022-12-18 19:49:38.744709+00:00 Created /usr/local/BackupPC/share/doc/BackupPC
2022-12-18 19:49:38.744721+00:00 Created /usr/local/BackupPC/lib
2022-12-18 19:49:38.744733+00:00 Created /usr/local/BackupPC/lib/BackupPC
2022-12-18 19:49:38.744744+00:00 Created /usr/local/BackupPC/lib/BackupPC/CGI
2022-12-18 19:49:38.744764+00:00 Created /usr/local/BackupPC/lib/BackupPC/Config
2022-12-18 19:49:38.744776+00:00 Created /usr/local/BackupPC/lib/BackupPC/Lang
2022-12-18 19:49:38.744788+00:00 Created /usr/local/BackupPC/lib/BackupPC/Storage
2022-12-18 19:49:38.744800+00:00 Created /usr/local/BackupPC/lib/BackupPC/Xfer
2022-12-18 19:49:38.744833+00:00 Created /usr/local/BackupPC/lib/BackupPC/Zip
2022-12-18 19:49:38.744846+00:00 Created /usr/local/BackupPC/lib/Net
2022-12-18 19:49:38.744858+00:00 Created /usr/local/BackupPC/lib/Net/FTP
2022-12-18 19:49:38.744869+00:00 Created /www/html/BackupPC
2022-12-18 19:49:38.744881+00:00 Created /var/lib/backuppc/
2022-12-18 19:49:38.744902+00:00 Created /var/lib/backuppc//pool
2022-12-18 19:49:38.744914+00:00 Created /var/lib/backuppc//cpool
2022-12-18 19:49:38.744926+00:00 Created /var/lib/backuppc//pc
2022-12-18 19:49:38.744938+00:00 Created /etc/backuppc/
2022-12-18 19:49:38.744950+00:00 Created /www/logs/backuppc
2022-12-18 19:49:38.744969+00:00 Created /var/run/BackupPC
2022-12-18 19:49:38.744982+00:00 Installing binaries in /usr/local/BackupPC/bin
2022-12-18 19:49:38.744994+00:00 Installing library in /usr/local/BackupPC/lib
2022-12-18 19:49:38.745006+00:00 Installing images in /www/html/BackupPC
2022-12-18 19:49:38.745017+00:00 Making systemd and init.d scripts
2022-12-18 19:49:38.745036+00:00 Making Apache configuration file for suid-perl
2022-12-18 19:49:38.745049+00:00 Installing docs in /usr/local/BackupPC/share/doc/BackupPC
2022-12-18 19:49:38.745061+00:00 Installing cgi script BackupPC_Admin in /www/cgi-bin/BackupPC
2022-12-18 19:49:38.745074+00:00 Installing config.pl and hosts in /etc/backuppc/
2022-12-18 19:49:38.765847+00:00 2022-12-18.21:49:38 [INFO] ** [backuppc] BackupPC 4.4.0 initialization complete, now starting web server on port 80
2022-12-18 19:49:39.094960+00:00 2022-12-18.21:49:39 [STARTING] ** [fcgiwrap] [1] Starting fcgiwrap
2022-12-18 19:49:39.102987+00:00 2022-12-18.21:49:39 [STARTING] ** [nginx] [1] Starting nginx 1.23.2
2022-12-18 19:49:39.111112+00:00 2022-12-18.21:49:39 [STARTING] ** [backuppc] [1] Starting BackupPC 4.4.0
2022-12-18 19:49:39.186257+00:00 2022-12-18.21:49:39 [STARTING] ** [monitoring] [1] Starting Zabbix Agent (modern) 6.2.4
2022-12-18 19:49:39.287572+00:00 2022-12-18.21:49:39 [STARTING] ** [scheduling] [1] Starting cron
2022-12-18 19:49:39.472966+00:00 Starting Zabbix Agent 2 (6.2.4)
2022-12-18 19:49:39.473029+00:00 Zabbix Agent2 hostname: [backuppc-78cb459ff8-wdt8s]
2022-12-18 19:49:39.473044+00:00 Press Ctrl+C to exit.
2022-12-18 19:49:40.116029+00:00 2022-12-18.21:49:40 [STARTING] ** [backuppc] [2] Starting BackupPC 4.4.0
2022-12-18 19:49:41.116658+00:00 2022-12-18.21:49:41 [STARTING] ** [backuppc] [3] Starting BackupPC 4.4.0
2022-12-18 19:49:42.119306+00:00 2022-12-18.21:49:42 [STARTING] ** [backuppc] [4] Starting BackupPC 4.4.0
2022-12-18 19:49:43.143707+00:00 2022-12-18.21:49:43 [STARTING] ** [backuppc] [5] Starting BackupPC 4.4.0
..
..
2022-12-18 19:50:27.225010+00:00 2022-12-18.21:50:27 [STARTING] ** [backuppc] [49] Starting BackupPC 4.4.0
2022-12-18 19:50:28.228627+00:00 2022-12-18.21:50:28 [STARTING] ** [backuppc] [50] Starting BackupPC 4.4.0
2022-12-18 19:50:29.233673+00:00 2022-12-18.21:50:29 [ERROR] ** [backuppc] POTENTIAL RUNWAY DETECTECTED: Disabling 20-backuppc service because it has tried restarting '50' times

Can zabbix be disabled?

sigmoidal commented 1 year ago

@tiredofit thanks for the hint.

Ok, I found the problem. It has to do with Perl pragma to restrict unsafe constructs being enabled, which rendered my config.pl problematic, because they did include unsafe constructs. This is because I copied the config.pl file from other systems where this is not enforced. (I've have been using these configs for 15 years, but upstream the defaults changed)

Effectively, for anyone experiencing this or similar, the config.pl has to be updated to include safer syntax. For example:

$Conf{CgiNavBarLinks} = ( .. );

will cause the docker container's backuppc daemon to hang, while updating it to:

$Conf{CgiNavBarLinks} = [ .. ];

will work. Check the upstream BackupPC config.pl to find out the right syntax of the defaults: https://github.com/backuppc/backuppc/blob/master/conf/config.pl

sidenote: for those looking, zabbix can be disabled by using the env variable: ENABLE_ZABBIX=FALSE

tiredofit commented 1 year ago

Great! Didn't realize that this is in a software catalog somewhere..

In the next versions of my base images the ENABLE_* variables are going to disappear - You may want to switch it off instead with the newer format CONTAINER_ENABLE_MONITORING=FALSE.

sigmoidal commented 1 year ago

Thanks, I switched the env variable, works nicely. If time allows, it may be useful to document on github some of these (and other) env variables that are set in the image.

tiredofit commented 1 year ago

There are quite alot. Check out the README, specifically the section where it talks about the various base images used in order to build this one..