[MDEV-23342] MariaDB cannot be installed over MySQL 5.7.30 on Bionic anymore Created: 2020-07-30  Updated: 2021-03-29  Resolved: 2020-08-07

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform Debian
Affects Version/s: 10.5
Fix Version/s: 10.5.5

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: regression


 Description   

After MySQL was upgraded to 5.7.31 in Bionic repos, cross-grade from pre-installed MySQL 5.7.30 to MariaDB 10.5 doesn't work anymore.

These are pre-installed packages:

$ dpkg -l | grep -iE 'mysql|maria'
ii  mysql-client-5.7                      5.7.30-0ubuntu0.18.04.1             amd64        MySQL database client binaries
ii  mysql-client-core-5.7                 5.7.30-0ubuntu0.18.04.1             amd64        MySQL database core client binaries
ii  mysql-common                          5.8+1.0.4                           all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                          5.7.30-0ubuntu0.18.04.1             all          MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.7                      5.7.30-0ubuntu0.18.04.1             amd64        MySQL database server binaries and system database setup
ii  mysql-server-core-5.7                 5.7.30-0ubuntu0.18.04.1             amd64        MySQL database server binaries

Specifically, this doesn't work:

$ sudo apt-get install mariadb-server
...
The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.5 (>= 1:10.5.5+maria~bionic) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

This also doesn't work:

$ sudo apt-get install mariadb-server-10.5
...
The following packages have unmet dependencies:
 mariadb-server-10.5 : Depends: mariadb-client-10.5 (>= 1:10.5.5+maria~bionic) but it is not going to be installed
                       Depends: mariadb-server-core-10.5 (>= 1:10.5.5+maria~bionic) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

But this works:

$ sudo apt-get install mariadb-server-core-10.5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.1-6 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl
  libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libtimedate-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpcre2-8-0 mariadb-common mysql-client-5.7
The following packages will be REMOVED:
  mysql-server mysql-server-5.7 mysql-server-core-5.7
The following NEW packages will be installed:
  libpcre2-8-0 mariadb-common mariadb-server-core-10.5
The following packages will be upgraded:
  mysql-client-5.7
1 upgraded, 3 newly installed, 3 to remove and 87 not upgraded.
Need to get 2,127 kB/9,092 kB of archives.
After this operation, 48.8 MB disk space will be freed.
Do you want to continue? [Y/n] 

Also, if MySQL first upgraded to 5.7.31, after that installation of MariaDB works:

$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  mysql-server
1 upgraded, 0 newly installed, 0 to remove and 90 not upgraded.
Need to get 9,948 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 mysql-server all 5.7.31-0ubuntu0.18.04.1 [9,948 B]
Fetched 9,948 B in 0s (287 kB/s)         
(Reading database ... 67597 files and directories currently installed.)
Preparing to unpack .../mysql-server_5.7.31-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-server (5.7.31-0ubuntu0.18.04.1) over (5.7.30-0ubuntu0.18.04.1) ...
Setting up mysql-server (5.7.31-0ubuntu0.18.04.1) ...
 
$ sudo apt-get install mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libevent-core-2.1-6
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  galera-4 libdbd-mysql-perl libdbi-perl libmariadb3 libmysqlclient20 libpcre2-8-0 libterm-readkey-perl mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-server-10.5
  mariadb-server-core-10.5 socat
Suggested packages:
  libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl mailx mariadb-test
The following packages will be REMOVED:
  mysql-client-5.7 mysql-client-core-5.7 mysql-server mysql-server-5.7 mysql-server-core-5.7
The following NEW packages will be installed:
  galera-4 libdbd-mysql-perl libdbi-perl libmariadb3 libmysqlclient20 libpcre2-8-0 libterm-readkey-perl mariadb-client-10.5 mariadb-client-core-10.5 mariadb-common mariadb-server
  mariadb-server-10.5 mariadb-server-core-10.5 socat
0 upgraded, 14 newly installed, 5 to remove and 86 not upgraded.
Need to get 11.5 MB/25.5 MB of archives.
After this operation, 49.2 MB of additional disk space will be used.
...



 Comments   
Comment by Otto Kekäläinen [ 2020-08-03 ]

Thanks for reporting! These "Depends: XYZ but it is not going to be installed" type of errors are quite hard to debug and the apt error messages are quite unhelpful.

It could potentially be related to https://jira.mariadb.org/browse/MDEV-22735.

The changelogs for Ubuntu can be found at https://launchpad.net/ubuntu/bionic/+source/mysql-5.7. The changelog at https://launchpad.net/ubuntu/+source/mysql-5.7/5.7.31-0ubuntu0.18.04.1 does not state any packaging changes, nor does the diff http://launchpadlibrarian.net/489331240/mysql-5.7_5.7.30-0ubuntu0.18.04.1_5.7.31-0ubuntu0.18.04.1.diff.gz contain any debian/control changes.

Automatic testing at https://salsa.debian.org/mariadb-team/mariadb-server/-/jobs/903736 installed from Debian Sid version 5.7.26-1+b1 and upgraded to MariaDB 10.5.5 without problems.

Maybe faust could try to isolate this case and track down what is going on?

Comment by Otto Kekäläinen [ 2020-08-07 ]

Thanks serg for fixing this. If you tell me which commit it was I can review. Currently I don't see any related commits on 10.5 so I assume you fixed it in some dev branch.

Comment by Otto Kekäläinen [ 2020-08-13 ]

serg I found the commit now as it has landed on the 10.5 branch: https://github.com/MariaDB/server/commit/44885273f2cffd3b269fb18b0c369b343d9de512#diff-6e9552c9bd8e61c8f277c21220160234

Unfortunately these changes are wrong and makes MariaDB now conflict with MySQL 5.7 on Debian:

[ERROR] mariadb-client-10.5 conflicts with mariadb-client-core-10.3 files: {'/usr/bin/mysqlcheck'}
[ERROR] mariadb-server-core-10.5 conflicts with mysql-server-5.7 files: {'/usr/bin/resolveip', '/usr/share/mysql/mysql_test_data_timezone.sql', '/usr/share/man/man1/resolveip.1.gz'}
[ERROR] mariadb-test conflicts with mysql-server-5.7 files: {'/usr/lib/mysql/plugin/adt_null.so', '/usr/lib/mysql/plugin/mypluglib.so'}
[ERROR] mariadb-test conflicts with mysql-testsuite-5.7 files: {'/usr/lib/mysql/plugin/qa_auth_server.so', '/usr/lib/mysql/plugin/ha_example.so', '/usr/lib/mysql/plugin/daemon_example.ini', '/usr/lib/mysql/plugin/libdaemon_example.so', '/usr/lib/mysql/plugin/auth_test_plugin.so', '/usr/lib/mysql/plugin/qa_auth_interface.so'}

I'll make a PR on 10.5 in the coming weeks to fix this.

Detected regression with CI run at https://salsa.debian.org/mariadb-team/mariadb-server/-/pipelines/164599

Comment by Otto Kekäläinen [ 2020-08-13 ]

I am a bit confused about your commit serg as the commit message in https://github.com/MariaDB/server/commit/44885273f2cffd3b269fb18b0c369b343d9de512#diff-6e9552c9bd8e61c8f277c21220160234 does not state anything about why this change was made, what was the problem and how the fix addresses it. Neither does this issue have that documented... Worst case scenario is that I need to revert your commit, and debug the original issue from scratch to see what the problem exactly was, and then apply a precise fix for that without regressions.

I am sure Serg is very busy. That is why I asked if faust could help out here and at debug how to reproduce this issue so that we would better know what was the exact bug.

Comment by Sergei Golubchik [ 2020-08-13 ]

There were few non-functional changes, like removing the version from mysql-client-5.7 (<< ${source:Version}) — it didn't have any effect, as any mysql-client-5.7 version will always be below 10.5.x, so the restriction was always true. And also I've reordered elements a bit, so that, for example, mariadb-server-core-5.1 would appear before mariadb-server-core-10.0.

The actual change that fixed the original bug symptoms and allowed MariaDB to install over MySQL 5.7.30 on Bionic, was to purge Replaces: lists from incorrect entries. It was claiming, for example, that mariadb-client-10.5 was replacing mariadb-server-10.5 (<< ${source:Version}) or that mariadb-server-10.5 was replacing mysql-client-5.7. This was clearly wrong, the packages conflicted, no doubt, but the one was not a replacement for the other.

As for new conflicts that you reported above — it means that more entries should be added to the Conflicts: list. Not that my commit should be reverted — in my commit I did not remove anything from Conflicts: (or, at least I didn't want to)

Comment by Otto Kekäläinen [ 2020-08-24 ]

> There were few non-functional changes, like removing the version from mysql-client-5.7 (<< ${source:Version}) — it didn't have any effect, as any mysql-client-5.7 version will always be below 10.5.x, so the restriction was always true.

We have situations where the MariaDB(.org repo) packages claim to provide MySQL packages (beyond just the virtual-mysql-* stuff) which forces the use of versioned Breaks/Replaces.

> This was clearly wrong, the packages conflicted, no doubt, but the one was not a replacement for the other.

It's not about the packages being replacements, it is about individual files inside them that replace files provided from other packages.
https://www.debian.org/doc/debian-policy/ch-relationships.html#packages-which-break-other-packages-breaks

I am now working on putting MariaDB 10.5.5 into Debian and will sort out the Conflicts/Breaks/Replaces correctly.

Comment by Otto Kekäläinen [ 2020-12-28 ]

Related PR at https://github.com/MariaDB/server/pull/1729

Generated at Thu Feb 08 09:21:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.