[MDEV-8457] preset root password with debconf maybe fails in some situations Created: 2015-07-13  Updated: 2018-12-23  Resolved: 2018-12-23

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform Debian
Affects Version/s: 10.0.16, 10.0.20, 10.1
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Emilien Mantel Assignee: Otto Kekäläinen
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Vagrant - "clean" Debian Jessie - Install from Debian repo or from MariaDB repo


Attachments: File aptitude.log     File aptitude_wheezy.log    
Issue Links:
Relates
relates to MDEV-9532 Upgrade from galera-server-5.5.46 to ... Closed

 Description   

Hi MariaDB team,

I have some problems to install MariaDB 10.0 on Debian Jessie. Silent install fails (with preset root password with debconf). I have the same bug from Debian repo (10.0.16) and from MariaDB repo (10.0.20).

I have no problem with MariaDB 10.0.20 on Debian Wheezy.

root@jessie-amd64:/home/vagrant# dpkg -l | egrep '(mysql|mariadb)' | wc -l
0
root@jessie-amd64:/home/vagrant# echo 'mariadb-server-10.0 mysql-server/root_password password azerty123' | debconf-set-selections
root@jessie-amd64:/home/vagrant# echo 'mariadb-server-10.0 mysql-server/root_password_again password azerty123' | debconf-set-selections
root@jessie-amd64:/home/vagrant# apt-get install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libmariadbclient18 libmysqlclient18 mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server-10.0 mariadb-server-core-10.0 mysql-common
Suggested packages:
  libterm-readkey-perl tinyca mariadb-test
The following NEW packages will be installed:
  libdbd-mysql-perl libmariadbclient18 libmysqlclient18 mariadb-client-10.0 mariadb-client-core-10.0 mariadb-common mariadb-server mariadb-server-10.0 mariadb-server-core-10.0 mysql-common
0 upgraded, 10 newly installed, 0 to remove and 48 not upgraded.
Need to get 0 B/12.7 MB of archives.
After this operation, 133 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 37199 files and directories currently installed.)
Preparing to unpack .../mysql-common_10.0.20+maria-1~jessie_all.deb ...
Unpacking mysql-common (10.0.20+maria-1~jessie) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../mariadb-common_10.0.20+maria-1~jessie_all.deb ...
Unpacking mariadb-common (10.0.20+maria-1~jessie) ...
Selecting previously unselected package libmariadbclient18.
Preparing to unpack .../libmariadbclient18_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking libmariadbclient18 (10.0.20+maria-1~jessie) ...
Selecting previously unselected package libmysqlclient18.
Preparing to unpack .../libmysqlclient18_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking libmysqlclient18 (10.0.20+maria-1~jessie) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.028-2+b1_amd64.deb ...
Unpacking libdbd-mysql-perl (4.028-2+b1) ...
Selecting previously unselected package mariadb-client-core-10.0.
Preparing to unpack .../mariadb-client-core-10.0_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking mariadb-client-core-10.0 (10.0.20+maria-1~jessie) ...
Selecting previously unselected package mariadb-client-10.0.
Preparing to unpack .../mariadb-client-10.0_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking mariadb-client-10.0 (10.0.20+maria-1~jessie) ...
Selecting previously unselected package mariadb-server-core-10.0.
Preparing to unpack .../mariadb-server-core-10.0_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking mariadb-server-core-10.0 (10.0.20+maria-1~jessie) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up mysql-common (10.0.20+maria-1~jessie) ...
Setting up mariadb-common (10.0.20+maria-1~jessie) ...
Selecting previously unselected package mariadb-server-10.0.
(Reading database ... 37386 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.0_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking mariadb-server-10.0 (10.0.20+maria-1~jessie) ...
Selecting previously unselected package mariadb-server.
Preparing to unpack .../mariadb-server_10.0.20+maria-1~jessie_all.deb ...
Unpacking mariadb-server (10.0.20+maria-1~jessie) ...
Processing triggers for systemd (215-17) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up libmysqlclient18 (10.0.20+maria-1~jessie) ...
Setting up libdbd-mysql-perl (4.028-2+b1) ...
Setting up libmariadbclient18 (10.0.20+maria-1~jessie) ...
Setting up mariadb-client-core-10.0 (10.0.20+maria-1~jessie) ...
Setting up mariadb-client-10.0 (10.0.20+maria-1~jessie) ...
Setting up mariadb-server-core-10.0 (10.0.20+maria-1~jessie) ...
Setting up mariadb-server-10.0 (10.0.20+maria-1~jessie) ...
dpkg: error processing package mariadb-server-10.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.0 (= 10.0.20+maria-1~jessie); however:
  Package mariadb-server-10.0 is not configured yet.
 
dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-18) ...
Processing triggers for systemd (215-17) ...
Errors were encountered while processing:
 mariadb-server-10.0
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Cheers,

hanx



 Comments   
Comment by Daniel Black [ 2015-07-13 ]

To get a bit more info can you try:

# export DEBIAN_SCRIPT_DEBUG=1
# aptitude install mariadb-server-10.0   

Comment by Emilien Mantel [ 2015-07-13 ]

Hi, see attachment

Comment by Elena Stepanova [ 2015-07-13 ]

danblack, do you see anything helpful in the log? I don't, but I don't have much experience with aptitude installations.

If nobody does, hanx, can you provide the error log (either from the log file or from syslog)?

Comment by Emilien Mantel [ 2015-07-13 ]

In line 1272, "ROOT_PW" is unset...

The offending lines seems (1167-1170):

    if [ "$RET" == "$ROOT_PW" ]; then
      ROOT_PW=''
      break
    fi

Comment by Daniel Black [ 2015-07-14 ]

hanx is spot on. debian/mariadb-server-10.0.config is the code that dates from the initial 5.5 commit of this file (debian/mariadb-server-5.5.config).

revno: 3229
committer: knielsen
branch nick: mariadb-5.5
timestamp: Mon 2012-01-23 12:20:16 +0100
message:
  Initial draft for building .deb packages for MariaDB 5.5.

It looks like the condition in these lines should be !=, i.e. if the password and its confirmation don't match set the ROOT_PW to ''.

A workaround in the mean time might be to set mysql-server/root_password_again to the real password and mysql-server/root_password to something different.

Comment by Emilien Mantel [ 2015-07-15 ]

I compared Jessie and Wheezy (see new aptitude log).

The error seems starting at (220-221):

 # Upgrade password column format before the root password gets set.
echo "$password_column_fix_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER

https://github.com/MariaDB/server/blob/10.0/debian/dist/Debian/mariadb-server-10.0.postinst

Comment by Elena Stepanova [ 2015-07-16 ]

otto,
If we need to fix something in there, it should be probably done the same way you do in your version?

Comment by Otto Kekäläinen [ 2015-07-21 ]

hanx As Debian Jessie includes MariaDB packages from Debian, and you have at the same time the mariadb.org repositories enabled, what methods do you use to make sure that the two different packaging of the same program does not interfere with each other? Do you use apt-pinning?

What if you disable the mariadb.org repositories and only use the Debian provided packages, is the error still there?

Comment by Otto Kekäläinen [ 2015-07-21 ]

While looking into this I noticed an interesting difference that I don't know why it is there:

$ diff -u debian/dist/Debian/mariadb-server-10.0.postinst debian/dist/Ubuntu/mariadb-server-10.0.postinst
--- debian/dist/Debian/mariadb-server-10.0.postinst	2015-07-21 12:13:13.548952149 +0300
+++ debian/dist/Ubuntu/mariadb-server-10.0.postinst	2015-07-21 12:13:13.552952149 +0300
@@ -31,6 +31,7 @@
 set_mysql_rootpw() {
        # forget we ever saw the password.  don't use reset to keep the seen status
        db_set mysql-server/root_password ""
+       db_set mysql-server/root_password_again ""
 
        tfile=`mktemp`
        if [ ! -f "$tfile" ]; then

Comment by Andrii Nikitin (Inactive) [ 2016-11-08 ]

This looks fixed in recent 10.2.3 . Otto Kekäläinen - is there any chance to fix it in 10.1 as well? (Because recent internal build 10.1.20 still showing the issue)

Comment by Faustin Lammler [ 2018-12-21 ]

HI,
I can confirm, the problem is still present in Debian version 10.1.37-0+deb9u1 but not on MariaDB version.

Here is a recent BR on this issue:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=915130

Comment by Otto Kekäläinen [ 2018-12-23 ]

Setting passwords via debconf is a hack and security risk. You should try to avoid that. Thanks to changes in Debian for MariaDB 10.0 this security issue is not a concern anymore thanks to the use of socket authentication for the default root and system maintenance user.

See also:

This same improvement was supposed to land in upstream in 10.1, but was postponed many releases and it is unclear if it will be in 10.4. See details in https://jira.mariadb.org/browse/MDEV-11340

Generated at Thu Feb 08 07:27:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.