Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed

64 views
Skip to first unread message

Otto Kekäläinen

unread,
May 14, 2023, 3:10:05 AM5/14/23
to
Hi Andreas!

Thanks for reporting and looking into this.

> Here apt choses a suboptimal removal order: mariadb-server-10.5 gets
> removed (and therefore stopped, but that fails) only after
> mariadb-client-10.5 and mariadb-client-core-10.5 are already gone.

You are right. The /usr/bin/mysqladmin command is gone and thus the
'$MYADMIN shutdown' will always fail in /etc/init.d/mariadb when
removal happens in this order.

The history here is that I submitted
https://github.com/MariaDB/server/pull/2299/commits/a7fb9f80af6f6aa2e5ca2f36a79d325358b40e00
upstream in a PR that got squashed (against my recommendation) and
thus got applied upstream as
https://github.com/MariaDB/server/commit/f4adf3547420cced027d26ee8b8190be8a2bdea2.
Upstream bug tracker was https://jira.mariadb.org/browse/MDEV-28640
and is still open, and this was filed now in Debian as
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1035949 but I recall
there was duplicates earlier as well. Anyway, clearly this isn't fully
fixed yet.

> I have tried the early upgrade scenario only with one other package that
> needs it (icinga2-ido-mysql), and there it worked flawless.
> Some bits from the log:
>
> ...
> Preparing to unpack .../mariadb-common_1%3a10.11.2-1_all.deb ...
> Unpacking mariadb-common (1:10.11.2-1) over (1:10.5.19-0+deb11u2) ...
> Preparing to unpack .../default-mysql-server_1.1.0_all.deb ...
> Unpacking default-mysql-server (1.1.0) over (1.0.7) ...
> Removing mariadb-server-10.5 (1:10.5.19-0+deb11u2) ...
> invoke-rc.d: could not determine current runlevel
> Stopping MariaDB database server: mariadbd.
> Removing mariadb-client-10.5 (1:10.5.19-0+deb11u2) ...
> Removing mariadb-client-core-10.5 (1:10.5.19-0+deb11u2) ...
> Removing mariadb-server-core-10.5 (1:10.5.19-0+deb11u2) ...
> ...
>
>
> Do you have a test in you CI that does something equivalent to
>
> * apt-get install default-mysql-server
> * sed s/bullseye/bookworm/ sources.list
> * apt-get install default-mysql-server # early upgrade
> * apt-get dist-upgrade

I was able to reproduce this on my laptop in a Docker container with simply:

./test-prepare-container
apt-get install default-mysql-server zoph
sed s/bullseye/bookworm/g -i /etc/apt/sources.list
apt update
apt-get install default-mysql-server

NOTE: Installing 'zoph' here is key. It will pull in dbconfig-common
etc and create this interaction. Removing 'zoph' makes the upgrade
pass just fine. This is similar to what we discovered with Cacti in
Bug#1031116

I added this 'zoph' update as a new Salsa-CI job in commit 2 of
https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/26
(result in https://salsa.debian.org/otto/mariadb-server/-/jobs/4213540).


One way to mitigate this would be to backport
https://github.com/MariaDB/server/pull/2299/commits/a7fb9f80af6f6aa2e5ca2f36a79d325358b40e00
to MariaDB 10.5 in Debian. However it would not fix the fact that the
client library is removed too early.

I need to play around with this to find out a proper solution.

Otto Kekäläinen

unread,
May 14, 2023, 8:51:40 PM5/14/23
to

Otto Kekäläinen

unread,
May 17, 2023, 11:30:11 PM5/17/23
to
I did some more testing in throwaway containers.

In each test starting point was same:

apt-get install default-mysql-server zoph
sed s/bullseye/bookworm/g -i /etc/apt/sources.list
apt update

All cases ran apt 2.6.0.

I only varied the command that followed:

1) apt-get install default-mysql-server

Fails:

debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 16648 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.1.0_all.deb ...
Unpacking mysql-common (5.8+1.1.0) over (5.8+1.0.7) ...
Preparing to unpack .../mariadb-common_1%3a10.11.2-1_all.deb ...
Unpacking mariadb-common (1:10.11.2-1) over (1:10.5.19-0+deb11u2) ...
Preparing to unpack .../default-mysql-server_1.1.0_all.deb ...
Unpacking default-mysql-server (1.1.0) over (1.0.7) ...
dpkg: mariadb-client-10.5: dependency problems, but removing anyway as
you requested:
mariadb-server-10.5 depends on mariadb-client-10.5 (>= 1:10.5.19-0+deb11u2).
dbconfig-mysql depends on default-mysql-client | virtual-mysql-client; however:
Package default-mysql-client is not installed.
Package virtual-mysql-client is not installed.
Package mariadb-client-10.5 which provides virtual-mysql-client is
to be removed.
(Reading database ... 16648 files and directories currently installed.)
Removing mariadb-client-10.5 (1:10.5.19-0+deb11u2) ...
Removing mariadb-client-core-10.5 (1:10.5.19-0+deb11u2) ...
dpkg: mariadb-server-10.5: dependency problems, but removing anyway as
you requested:
zoph depends on default-mysql-server | virtual-mysql-server; however:
Package default-mysql-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.5 which provides virtual-mysql-server is
to be removed.
Removing mariadb-server-10.5 (1:10.5.19-0+deb11u2) ...
Stopping MariaDB database server: mariadbd failed!
invoke-rc.d: initscript mariadb, action "stop" failed.
dpkg: error processing package mariadb-server-10.5 (--remove):
installed mariadb-server-10.5 package pre-removal script subprocess
returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
mariadb-server-10.5
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

# apt --fix-broken install mariadb-client
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
default-mysql-server : Depends: mariadb-server but it is not going to
be installed
mariadb-client : Depends: mariadb-client-core (>= 1:10.11.2-1) but it
is not going to be installed
Depends: libssl3 (>= 3.0.0) but it is not going to
be installed
Breaks: mariadb-server-10.5 but 1:10.5.19-0+deb11u2
is to be installed
mariadb-server-10.5 : Depends: mariadb-client-10.5 (>=
1:10.5.19-0+deb11u2) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages
(or specify a solution).



2) apt upgrade

Passes:

Everything is unpacked and installed, and MariaDB server restart is
among the last things that happen and is successful.

Upgrade of default-mysql-server was postponed and starts only when
running 'apt full-upgrade'.



3) apt full-upgrade

Fails:

...
Preparing to unpack .../default-mysql-server_1.1.0_all.deb ...
Unpacking default-mysql-server (1.1.0) over (1.0.7) ...
dpkg: mariadb-client-10.5: dependency problems, but removing anyway as
you requested:
mariadb-server-10.5 depends on mariadb-client-10.5 (>= 1:10.5.19-0+deb11u2).
dbconfig-mysql depends on default-mysql-client | virtual-mysql-client; however:
Package default-mysql-client is not installed.
Package virtual-mysql-client is not installed.
Package mariadb-client-10.5 which provides virtual-mysql-client is
to be removed.
(Reading database ... 18487 files and directories currently installed.)
Removing mariadb-client-10.5 (1:10.5.19-0+deb11u2) ...
Removing mariadb-client-core-10.5 (1:10.5.19-0+deb11u2) ...
dpkg: mariadb-server-10.5: dependency problems, but removing anyway as
you requested:
zoph depends on default-mysql-server | virtual-mysql-server; however:
Package default-mysql-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.5 which provides virtual-mysql-server is
to be removed.
Removing mariadb-server-10.5 (1:10.5.19-0+deb11u2) ...
Stopping MariaDB database server: mariadbd failed!
invoke-rc.d: initscript mariadb, action "stop" failed.
dpkg: error processing package mariadb-server-10.5 (--remove):
installed mariadb-server-10.5 package pre-removal script subprocess
returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
mariadb-server-10.5
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)



4) apt dist-upgrade

Fails: Seems to do almost the same as full-upgrade (175 vs 174
packages updates).


Preparing to unpack .../default-mysql-server_1.1.0_all.deb ...
Unpacking default-mysql-server (1.1.0) over (1.0.7) ...
dpkg: mariadb-client-10.5: dependency problems, but removing anyway as
you requested:
mariadb-server-10.5 depends on mariadb-client-10.5 (>= 1:10.5.19-0+deb11u2).
dbconfig-mysql depends on default-mysql-client | virtual-mysql-client; however:
Package default-mysql-client is not installed.
Package virtual-mysql-client is not installed.
Package mariadb-client-10.5 which provides virtual-mysql-client is
to be removed.
(Reading database ... 18489 files and directories currently installed.)
Removing mariadb-client-10.5 (1:10.5.19-0+deb11u2) ...
Removing mariadb-client-core-10.5 (1:10.5.19-0+deb11u2) ...
dpkg: mariadb-server-10.5: dependency problems, but removing anyway as
you requested:
zoph depends on default-mysql-server | virtual-mysql-server; however:
Package default-mysql-server is not configured yet.
Package virtual-mysql-server is not installed.
Package mariadb-server-10.5 which provides virtual-mysql-server is
to be removed.
Removing mariadb-server-10.5 (1:10.5.19-0+deb11u2) ...
Stopping MariaDB database server: mariadbd failed!
invoke-rc.d: initscript mariadb, action "stop" failed.
dpkg: error processing package mariadb-server-10.5 (--remove):
installed mariadb-server-10.5 package pre-removal script subprocess
returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
mariadb-server-10.5
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)



The new mariadb-server breaks/replaces on mariadb-server-10.5, and
mariadb-client breaks/replaces on mariadb-client-10.5.

I am not sure what to debug next.

Otto Kekäläinen

unread,
May 18, 2023, 1:10:06 AM5/18/23
to
Here is the apt resolver output for debugging:

# apt install default-mysql-server -o Debug::pkgDepCache::Marker=1 -o
Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
MarkInstall default-mysql-server:amd64 < 1.0.7 -> 1.1.0 @ii pumU Ib > FU=1
Installing mariadb-server:amd64 as Depends of default-mysql-server:amd64
Removing: mariadb-server-10.5:amd64 as upgrade is not an option
for mariadb-server:amd64 (1:10.11.2-1)
MarkDelete mariadb-server-10.5:amd64 < 1:10.5.19-0+deb11u2 @ii
mK Ib > FU=0
MarkInstall mariadb-server:amd64 < none -> 1:10.11.2-1 @un puN Ib > FU=0
Installing mariadb-common:amd64 as PreDepends of mariadb-server:amd64
MarkInstall mariadb-common:amd64 < 1:10.5.19-0+deb11u2 ->
1:10.11.2-1 @ii pumU > FU=0
Installing mariadb-client:amd64 as Depends of mariadb-server:amd64
Removing: mariadb-client-10.5:amd64 as upgrade is not an option
for mariadb-client:amd64 (1:10.11.2-1)
MarkDelete mariadb-client-10.5:amd64 < 1:10.5.19-0+deb11u2 @ii
mK Ib > FU=0
Removing: mariadb-client-core-10.5:amd64 as upgrade is not an
option for mariadb-client:amd64 (1:10.11.2-1)
MarkDelete mariadb-client-core-10.5:amd64 <
1:10.5.19-0+deb11u2 @ii mK > FU=0
MarkInstall mariadb-client:amd64 < none -> 1:10.11.2-1 @un puN Ib > FU=0
Installing mariadb-client-core:amd64 as Depends of mariadb-client:amd64
Removing: mariadb-server-core-10.5:amd64 as upgrade is not an
option for mariadb-client-core:amd64 (1:10.11.2-1)
MarkDelete mariadb-server-core-10.5:amd64 <
1:10.5.19-0+deb11u2 @ii mK > FU=0
MarkInstall mariadb-client-core:amd64 < none -> 1:10.11.2-1
@un puN Ib > FU=0
Installing libc6:amd64 as Depends of mariadb-client-core:amd64
MarkInstall libc6:amd64 < 2.31-13+deb11u5 -> 2.36-9 @ii pumU
NPb > FU=0
Installing libssl3:amd64 as Depends of mariadb-client-core:amd64
MarkInstall libssl3:amd64 < none -> 3.0.8-1 @un puN > FU=0
Installing mariadb-server-core:amd64 as Depends of mariadb-server:amd64
MarkInstall mariadb-server-core:amd64 < none -> 1:10.11.2-1 @un
puN Ib > FU=0
Installing libpmem1:amd64 as Depends of mariadb-server-core:amd64
MarkInstall libpmem1:amd64 < none -> 1.12.1-2 @un puN Ib > FU=0
Installing libdaxctl1:amd64 as Depends of libpmem1:amd64
MarkInstall libdaxctl1:amd64 < none -> 76.1-1 @un puN Ib > FU=0
Installing libkmod2:amd64 as Depends of libdaxctl1:amd64
MarkInstall libkmod2:amd64 < none -> 30+20221128-1 @un puN Ib > FU=0
Installing libzstd1:amd64 as Depends of libkmod2:amd64
MarkInstall libzstd1:amd64 < 1.4.8+dfsg-2.1 ->
1.5.4+dfsg2-5 @ii pumU > FU=0
Installing libndctl6:amd64 as Depends of libpmem1:amd64
MarkInstall libndctl6:amd64 < none -> 76.1-1 @un puN > FU=0
Installing libstdc++6:amd64 as Depends of mariadb-server-core:amd64
MarkInstall libstdc++6:amd64 < 10.2.1-6 -> 12.2.0-14 @ii pumU Ib > FU=0
Installing gcc-12-base:amd64 as Depends of libstdc++6:amd64
MarkInstall gcc-12-base:amd64 < none -> 12.2.0-14 @un puN > FU=0
Installing liburing2:amd64 as Depends of mariadb-server-core:amd64
MarkInstall liburing2:amd64 < none -> 2.3-3 @un puN > FU=0
Installing mariadb-plugin-provider-bzip2:amd64 as Recommends of
mariadb-server:amd64
MarkInstall mariadb-plugin-provider-bzip2:amd64 < none ->
1:10.11.2-1 @un uN > FU=0
Installing mariadb-plugin-provider-lz4:amd64 as Recommends of
mariadb-server:amd64
MarkInstall mariadb-plugin-provider-lz4:amd64 < none ->
1:10.11.2-1 @un uN > FU=0
Installing mariadb-plugin-provider-lzma:amd64 as Recommends of
mariadb-server:amd64
MarkInstall mariadb-plugin-provider-lzma:amd64 < none ->
1:10.11.2-1 @un uN > FU=0
Installing mariadb-plugin-provider-lzo:amd64 as Recommends of
mariadb-server:amd64
MarkInstall mariadb-plugin-provider-lzo:amd64 < none ->
1:10.11.2-1 @un uN Ib > FU=0
Installing liblzo2-2:amd64 as Depends of mariadb-plugin-provider-lzo:amd64
MarkInstall liblzo2-2:amd64 < none -> 2.10-2 @un uN > FU=0
Installing mariadb-plugin-provider-snappy:amd64 as Recommends of
mariadb-server:amd64
MarkInstall mariadb-plugin-provider-snappy:amd64 < none ->
1:10.11.2-1 @un uN Ib > FU=0
Installing libsnappy1v5:amd64 as Depends of
mariadb-plugin-provider-snappy:amd64
MarkInstall libsnappy1v5:amd64 < 1.1.8-1 -> 1.1.9-3 @ii umU > FU=0
Installing pv:amd64 as Recommends of mariadb-server:amd64
MarkInstall pv:amd64 < none -> 1.6.20-1 @un uN > FU=0
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following package was automatically installed and is no longer required:
libaio1
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
gcc-12-base libc-bin libc6 libdaxctl1 libkmod2 liblzo2-2 libndctl6
libpmem1 libsnappy1v5 libssl3 libstdc++6 liburing2 libzstd1
mariadb-client mariadb-client-core mariadb-common
mariadb-plugin-provider-bzip2 mariadb-plugin-provider-lz4
mariadb-plugin-provider-lzma mariadb-plugin-provider-lzo
mariadb-plugin-provider-snappy mariadb-server mariadb-server-core pv
Suggested packages:
glibc-doc libc-l10n locales libnss-nis libnss-nisplus mailx
mariadb-test netcat-openbsd doc-base
Recommended packages:
manpages
The following packages will be REMOVED:
mariadb-client-10.5 mariadb-client-core-10.5 mariadb-server-10.5
mariadb-server-core-10.5
The following NEW packages will be installed:
gcc-12-base libdaxctl1 libkmod2 liblzo2-2 libndctl6 libpmem1 libssl3
liburing2 mariadb-client mariadb-client-core
mariadb-plugin-provider-bzip2 mariadb-plugin-provider-lz4
mariadb-plugin-provider-lzma mariadb-plugin-provider-lzo
mariadb-plugin-provider-snappy mariadb-server mariadb-server-core pv
The following packages will be upgraded:
default-mysql-server libc-bin libc6 libsnappy1v5 libstdc++6 libzstd1
mariadb-common
7 upgraded, 18 newly installed, 4 to remove and 253 not upgraded.
Need to get 21.4 MB of archives.
After this operation, 38.3 MB of additional disk space will be used.
Do you want to continue? [Y/n]


We only care about mariadb-client-10.5 upgrading to mariadb-client
(from 10.11, without version suffix):

# dpkg -S /usr/bin/mariadb-admin
mariadb-client-10.5: /usr/bin/mariadb-admin

Otto Kekäläinen

unread,
May 22, 2023, 10:40:12 PM5/22/23
to

Andreas Beckmann

unread,
Jun 4, 2023, 8:10:05 AM6/4/23
to
On 04/06/2023 07.03, Otto Kekäläinen wrote:
> What do you Andreas suggest we do now?

I'd suggest uploading it to experimental immediately (for NEW
processing) and filing a pre-approval bug and let the release team
decide what to do. This fix will probably be delayed to the first point
release.
Should there be something about this issue in the release notes?


Andreas

Otto Kekäläinen

unread,
Jun 4, 2023, 7:40:04 PM6/4/23
to
0 new messages