[Pkg-giraffe-discuss] Getting autopkgtest for kopanocore working (finally)

Carsten Schoenert c.schoenert at t-online.de
Sat Dec 15 16:17:51 GMT 2018


Hi,

today I've jumped again into the wonderful world of autotesting the
kopanocore package and I think I've understand now what's happen (or
what not did happen). ;)

Mark pointed me to the PDF version of the dbconfig-common manual [1]
which I now have bookmarked. :P

O.k. what to do if something isn't working as expected? Right, try to do
some debugging. The dbconfig manual says here you need to set the
variable dbc_debug to something non empty, so I added a line

 dbc_debug=1

to kopano-server.postinst.

This has shown several times while the autotest the following output
every time dbconfig-common is triggered.

> (postinst) dbc_go() kopano-server configure.
> dbc_config() kopano-server configure.
> dbc_set_dbtype_defaults() .
> dbc_read_package_debconf() .
> dbc_set_dbtype_defaults() mysql.
> settings determined from dbc_read_package_debconf:.
> 	dbc_install=true.
> 	dbc_upgrade=true.
> 	dbc_remove=true.
> 	dbc_dbtype=mysql.
> 	dbc_dbuser=kopano-server.
> 	dbc_dbpass=XvgVAXeJBLu0.
> 	dbc_dballow=localhost.
> 	dbc_dbadmin=root.
> 	dbc_dbadmpass=.
> 	dbc_dbserver=localhost.
> 	dbc_dbport=3306.
> 	dbc_dbname=kopanoserver.
> 	dbc_authmethod_admin=.
> 	dbc_authmethod_user=.
> 	dbc_ssl=.
> dbc_write_package_config() .
> dbconfig-common: writing config to /etc/dbconfig-common/kopano-server.conf
> 
> Creating config file /etc/dbconfig-common/kopano-server.conf with new version
> 
> Creating config file /etc/kopano/debian-db.cfg with new version
> dbc_read_package_config() .
> dbc_detect_installed_dbtype() mysql.
> _dbc_detect_installed_dbtype() mysql.
> dbc_get_admin_pass() .
> _dbc_detect_installed_dbtype() mysql.
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory").
> unable to connect to mysql server.
> error encountered creating user:
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
> dbconfig-common: kopano-server configure: noninteractive fail.
> dbconfig-common: kopano-server configure: ignoring errors from here forwards
> dbc_postinst_cleanup() .
> dbc_forget_dbadmin_password() .
> dbconfig-common: flushing administrative password
> dbc_forget_app_password() .

So there is no running MariaDB server which could be connected to. Means
we would need a running mariadb-server package while kopano-server is
getting installed to get the needed configuration into the sql server.
But the installation of mariadb-server is happen later within the smoke
test! But here the kopano-core package isn't touched again from
dbconfig-common while mariadb-server is installed.

> #######################################################################
> # Installing MariaDB server package...                                #
> Reading package lists...
> Building dependency tree...
> Reading state information...
> The following additional packages will be installed:
>   galera-3 libcgi-fast-perl libcgi-pm-perl libdbi-perl libencode-locale-perl
>   libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
>   libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1
>   liblwp-mediatypes-perl libtimedate-perl liburi-perl mariadb-server-10.1
>   mariadb-server-core-10.1 rsync socat
> Suggested packages:
>   libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl
>   libipc-sharedcache-perl libwww-perl mailx mariadb-test netcat-openbsd tinyca
> The following NEW packages will be installed:
>   galera-3 libcgi-fast-perl libcgi-pm-perl libdbi-perl libencode-locale-perl
>   libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl
>   libhttp-date-perl libhttp-message-perl libio-html-perl libjemalloc1
>   liblwp-mediatypes-perl libtimedate-perl liburi-perl mariadb-server
>   mariadb-server-10.1 mariadb-server-core-10.1 rsync socat
> 0 upgraded, 21 newly installed, 0 to remove and 0 not upgraded.
> Need to get 13.3 MB of archives.
> After this operation, 110 MB of additional disk space will be used.
> Get:1 http://ftp.de.debian.org/debian unstable/main amd64 galera-3 amd64 25.3.24-1 [915 kB]
> Get:2 http://ftp.de.debian.org/debian unstable/main amd64 libdbi-perl amd64 1.642-1+b1 [775 kB]
> Get:3 http://ftp.de.debian.org/debian unstable/main amd64 libjemalloc1 amd64 3.6.0-11 [92.4 kB]
> Get:4 http://ftp.de.debian.org/debian unstable/main amd64 mariadb-server-core-10.1 amd64 1:10.1.37-3 [4952 kB]
> Get:5 http://ftp.de.debian.org/debian unstable/main amd64 rsync amd64 3.1.2-2.2 [395 kB]
> Get:6 http://ftp.de.debian.org/debian unstable/main amd64 socat amd64 1.7.3.2-2 [358 kB]
> Get:7 http://ftp.de.debian.org/debian unstable/main amd64 mariadb-server-10.1 amd64 1:10.1.37-3 [5039 kB]
> Get:8 http://ftp.de.debian.org/debian unstable/main amd64 libhtml-tagset-perl all 3.20-3 [12.7 kB]
> Get:9 http://ftp.de.debian.org/debian unstable/main amd64 liburi-perl all 1.74-1 [89.4 kB]
> Get:10 http://ftp.de.debian.org/debian unstable/main amd64 libhtml-parser-perl amd64 3.72-3+b3 [105 kB]
> Get:11 http://ftp.de.debian.org/debian unstable/main amd64 libcgi-pm-perl all 4.40-1 [222 kB]
> Get:12 http://ftp.de.debian.org/debian unstable/main amd64 libfcgi-perl amd64 0.78-2+b3 [39.0 kB]
> Get:13 http://ftp.de.debian.org/debian unstable/main amd64 libcgi-fast-perl all 1:2.13-1 [11.4 kB]
> Get:14 http://ftp.de.debian.org/debian unstable/main amd64 libencode-locale-perl all 1.05-1 [13.7 kB]
> Get:15 http://ftp.de.debian.org/debian unstable/main amd64 libhtml-template-perl all 2.97-1 [66.0 kB]
> Get:16 http://ftp.de.debian.org/debian unstable/main amd64 libtimedate-perl all 2.3000-2 [42.2 kB]
> Get:17 http://ftp.de.debian.org/debian unstable/main amd64 libhttp-date-perl all 6.02-1 [10.7 kB]
> Get:18 http://ftp.de.debian.org/debian unstable/main amd64 libio-html-perl all 1.001-1 [17.6 kB]
> Get:19 http://ftp.de.debian.org/debian unstable/main amd64 liblwp-mediatypes-perl all 6.02-1 [22.1 kB]
> Get:20 http://ftp.de.debian.org/debian unstable/main amd64 libhttp-message-perl all 6.18-1 [77.8 kB]
> Get:21 http://ftp.de.debian.org/debian unstable/main amd64 mariadb-server all 1:10.1.37-3 [28.3 kB]
> Preconfiguring packages ...
> Fetched 13.3 MB in 1s (13.8 MB/s)
> Selecting previously unselected package galera-3.
> (Reading database ... 41669 files and directories currently installed.)
> Preparing to unpack .../00-galera-3_25.3.24-1_amd64.deb ...
> Unpacking galera-3 (25.3.24-1) ...
> Selecting previously unselected package libdbi-perl:amd64.
> Preparing to unpack .../01-libdbi-perl_1.642-1+b1_amd64.deb ...
> Unpacking libdbi-perl:amd64 (1.642-1+b1) ...
> Selecting previously unselected package libjemalloc1.
> Preparing to unpack .../02-libjemalloc1_3.6.0-11_amd64.deb ...
> Unpacking libjemalloc1 (3.6.0-11) ...
> Selecting previously unselected package mariadb-server-core-10.1.
> Preparing to unpack .../03-mariadb-server-core-10.1_1%3a10.1.37-3_amd64.deb ...
> Unpacking mariadb-server-core-10.1 (1:10.1.37-3) ...
> Selecting previously unselected package rsync.
> Preparing to unpack .../04-rsync_3.1.2-2.2_amd64.deb ...
> Unpacking rsync (3.1.2-2.2) ...
> Selecting previously unselected package socat.
> Preparing to unpack .../05-socat_1.7.3.2-2_amd64.deb ...
> Unpacking socat (1.7.3.2-2) ...
> Selecting previously unselected package mariadb-server-10.1.
> Preparing to unpack .../06-mariadb-server-10.1_1%3a10.1.37-3_amd64.deb ...
> Unpacking mariadb-server-10.1 (1:10.1.37-3) ...
> Selecting previously unselected package libhtml-tagset-perl.
> Preparing to unpack .../07-libhtml-tagset-perl_3.20-3_all.deb ...
> Unpacking libhtml-tagset-perl (3.20-3) ...
> Selecting previously unselected package liburi-perl.
> Preparing to unpack .../08-liburi-perl_1.74-1_all.deb ...
> Unpacking liburi-perl (1.74-1) ...
> Selecting previously unselected package libhtml-parser-perl.
> Preparing to unpack .../09-libhtml-parser-perl_3.72-3+b3_amd64.deb ...
> Unpacking libhtml-parser-perl (3.72-3+b3) ...
> Selecting previously unselected package libcgi-pm-perl.
> Preparing to unpack .../10-libcgi-pm-perl_4.40-1_all.deb ...
> Unpacking libcgi-pm-perl (4.40-1) ...
> Selecting previously unselected package libfcgi-perl.
> Preparing to unpack .../11-libfcgi-perl_0.78-2+b3_amd64.deb ...
> Unpacking libfcgi-perl (0.78-2+b3) ...
> Selecting previously unselected package libcgi-fast-perl.
> Preparing to unpack .../12-libcgi-fast-perl_1%3a2.13-1_all.deb ...
> Unpacking libcgi-fast-perl (1:2.13-1) ...
> Selecting previously unselected package libencode-locale-perl.
> Preparing to unpack .../13-libencode-locale-perl_1.05-1_all.deb ...
> Unpacking libencode-locale-perl (1.05-1) ...
> Selecting previously unselected package libhtml-template-perl.
> Preparing to unpack .../14-libhtml-template-perl_2.97-1_all.deb ...
> Unpacking libhtml-template-perl (2.97-1) ...
> Selecting previously unselected package libtimedate-perl.
> Preparing to unpack .../15-libtimedate-perl_2.3000-2_all.deb ...
> Unpacking libtimedate-perl (2.3000-2) ...
> Selecting previously unselected package libhttp-date-perl.
> Preparing to unpack .../16-libhttp-date-perl_6.02-1_all.deb ...
> Unpacking libhttp-date-perl (6.02-1) ...
> Selecting previously unselected package libio-html-perl.
> Preparing to unpack .../17-libio-html-perl_1.001-1_all.deb ...
> Unpacking libio-html-perl (1.001-1) ...
> Selecting previously unselected package liblwp-mediatypes-perl.
> Preparing to unpack .../18-liblwp-mediatypes-perl_6.02-1_all.deb ...
> Unpacking liblwp-mediatypes-perl (6.02-1) ...
> Selecting previously unselected package libhttp-message-perl.
> Preparing to unpack .../19-libhttp-message-perl_6.18-1_all.deb ...
> Unpacking libhttp-message-perl (6.18-1) ...
> Selecting previously unselected package mariadb-server.
> Preparing to unpack .../20-mariadb-server_1%3a10.1.37-3_all.deb ...
> Unpacking mariadb-server (1:10.1.37-3) ...
> Setting up libhtml-tagset-perl (3.20-3) ...
> Setting up libencode-locale-perl (1.05-1) ...
> Setting up libjemalloc1 (3.6.0-11) ...
> Setting up libtimedate-perl (2.3000-2) ...
> Setting up socat (1.7.3.2-2) ...
> Setting up libio-html-perl (1.001-1) ...
> Setting up rsync (3.1.2-2.2) ...
> Created symlink /etc/systemd/system/multi-user.target.wants/rsync.service → /lib/systemd/system/rsync.service.
> Setting up liblwp-mediatypes-perl (6.02-1) ...
> Processing triggers for libc-bin (2.28-2) ...
> Setting up galera-3 (25.3.24-1) ...
> Setting up liburi-perl (1.74-1) ...
> Processing triggers for systemd (239-15) ...
> Setting up libhtml-parser-perl (3.72-3+b3) ...
> Setting up libcgi-pm-perl (4.40-1) ...
> Processing triggers for man-db (2.8.4-3) ...
> Setting up libfcgi-perl (0.78-2+b3) ...
> Setting up libdbi-perl:amd64 (1.642-1+b1) ...
> Setting up libhttp-date-perl (6.02-1) ...
> Setting up mariadb-server-core-10.1 (1:10.1.37-3) ...
> Setting up libhtml-template-perl (2.97-1) ...
> Setting up libcgi-fast-perl (1:2.13-1) ...
> Setting up libhttp-message-perl (6.18-1) ...
> Setting up mariadb-server-10.1 (1:10.1.37-3) ...
> Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
> Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
> Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
> Setting up mariadb-server (1:10.1.37-3) ...
> Processing triggers for systemd (239-15) ...
> # Installing MariaDB server package... done.                          #
> #######################################################################

If I add mariadb-server to the Depends of the first autopkgtest all is
working without the need of any tweeks in the smoke script. Hmm, that is
obviously not what we want to have. But a dpkg-reconfigure of the
package kopano-server after the installation of mariadb-server is doing
the trick and the autopkg thingy is working like before!

Any other objections or suggestion I should consider now before pushing
all to Salsa? Something I've forgotten?
I'm glad it's that stupid simple in the end!
I pushed the current tree to GitHub meanwhile.

https://github.com/tijuca/Giraffe/commits/debian/sid

[1] https://www.debian.org/doc/manuals/dbconfig-common/dbconfig-common.pdf

-- 
Regards
Carsten Schoenert



More information about the Pkg-giraffe-discuss mailing list