[Pkg-cacti-maint] Bug#1031116: Acknowledgement (autopkgtest for cacti/1.2.23+ds1-2 fails as dbconfig-common attempts to create database before any server is up)

Otto Kekäläinen otto at debian.org
Sun Feb 12 00:45:58 GMT 2023


Ignore everything in the initial bug report, I was accidentally
looking at s390x log which has a completely different root cause
(Linux kernel bug on s390x that affects MariaDB and prevents it from
running).

I found out the actual root cause by putting the last passing log
(https://ci.debian.net/data/autopkgtest/testing/amd64/c/cacti/31113621/log.gz)
and equivalent failing one
(https://ci.debian.net/data/autopkgtest/testing/amd64/c/cacti/31254901/log.gz)
for amd64 in meld to compare side-by-side.

The difference is in what order apt-get sets up the packages. See
attached screenshots.

First one shows MariaDB being set up early in the process before cacti:

Setting up apache2-bin (2.4.55-1) ...
Setting up libcairo2:amd64 (1.16.0-7) ...
Setting up mariadb-server (1:10.11.1-3) ...
Created symlink
/etc/systemd/system/multi-user.target.wants/mariadb.service →
/lib/systemd/system/mariadb.service.
Setting up libjs-jquery-ui-touch-punch (0.0~git20141218.2.4bc0091+dfsg1-4.1) ...
Setting up php-ldap (2:8.2+93) ...
Setting up php8.2-xml (8.2.2-1) ...
...
Setting up rrdtool (1.7.2-4+b8) ...
Setting up cacti (1.2.23+ds1-2) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
dbconfig-common: writing config to /etc/dbconfig-common/cacti.conf
Creating config file /etc/dbconfig-common/cacti.conf with new version
Creating config file /etc/cacti/debian.php with new version
checking privileges on database cacti for cacti at localhost: user creation needed.
granting access to database cacti for cacti at localhost: success.
verifying access for cacti at localhost: success.
creating database cacti: success.
verifying database cacti exists: success.
populating database via administrative sql...  done.
populating database via sql...  done.
dbconfig-common: flushing administrative password
Creating config file /etc/apache2/conf-available/cacti.conf with new version
Creating config file /etc/lighttpd/conf-available/20-cacti.conf with new version
Loading default cacti templates (may take some time)..............  done.
apache2_invoke: Enable configuration cacti
Setting up autopkgtest-satdep (0) ...

The latter one shows cacti trying to set up itself before
mariadb-server, and thus fails:

Setting up rrdtool (1.7.2-4+b8) ...
Setting up cacti (1.2.23+ds1-2) ...
dbconfig-common: writing config to /etc/dbconfig-common/cacti.conf
Creating config file /etc/dbconfig-common/cacti.conf with new version
Creating config file /etc/cacti/debian.php with new version
ERROR 2002 (HY000): Can't connect to local server through socket
'/run/mysqld/mysqld.sock' (2).
unable to connect to mysql server.
error encountered creating user:
ERROR 2002 (HY000): Can't connect to local server through socket
'/run/mysqld/mysqld.sock' (2)
dbconfig-common: cacti configure: noninteractive fail.
dbconfig-common: cacti configure: ignoring errors from here forwards
populating database via administrative sql...  done.
populating database via sql...  done.
dbconfig-common: flushing administrative password
Creating config file /etc/apache2/conf-available/cacti.conf with new version
Creating config file /etc/lighttpd/conf-available/20-cacti.conf with new version
apache2_invoke: Enable configuration cacti
Setting up mariadb-plugin-provider-bzip2 (1:10.11.1-4) ...
Setting up mariadb-plugin-provider-lzma (1:10.11.1-4) ...
Setting up mariadb-plugin-provider-lzo (1:10.11.1-4) ...
Setting up mariadb-plugin-provider-lz4 (1:10.11.1-4) ...
Setting up mariadb-plugin-provider-snappy (1:10.11.1-4) ...
Setting up mariadb-server (1:10.11.1-4) ...
Created symlink
/etc/systemd/system/multi-user.target.wants/mariadb.service →
/lib/systemd/system/mariadb.service.
Setting up autopkgtest-satdep (0) ...
Processing triggers for libc-bin (2.36-8) ...
Processing triggers for php8.2-cli (8.2.2-1) ...
Processing triggers for libapache2-mod-php8.2 (8.2.2-1) ...
(Reading database ... 21124 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...


This happened because of
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/5545bb341808cef8a4227b55b0c75e331cc48c96

However that is a valid fix, I would not rush to revert it.


Can we force cacti to wait until mariadb-server is fully setup before
it tries to connect to it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 538250 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-cacti-maint/attachments/20230211/1cf255ff/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 625237 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-cacti-maint/attachments/20230211/1cf255ff/attachment-0003.png>


More information about the Pkg-cacti-maint mailing list