Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1146687 > unrolled thread

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

Started byOtto Kekäläinen <otto@debian.org>
First post2023-05-14 09:10 +0200
Last post2023-06-05 01:40 +0200
Articles 7 — 2 participants

Back to article view | Back to linux.debian.bugs.dist

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Otto Kekäläinen <otto@debian.org> - 2023-05-14 09:10 +0200
    Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Otto Kekäläinen <otto@debian.org> - 2023-05-15 02:50 +0200
      Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Otto Kekäläinen <otto@debian.org> - 2023-05-18 05:30 +0200
        Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Otto Kekäläinen <otto@debian.org> - 2023-05-18 07:10 +0200
        Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Otto Kekäläinen <otto@debian.org> - 2023-05-23 04:40 +0200
          Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Andreas Beckmann <anbe@debian.org> - 2023-06-04 14:10 +0200
            Bug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed Otto Kekäläinen <otto@debian.org> - 2023-06-05 01:40 +0200

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

FromOtto Kekäläinen <otto@debian.org>
Date2023-05-14 09:10 +0200
SubjectBug#1035949: mariadb: upgrade issue: mariadb-server-10.5 fails to stop after all other -10.5 packages were removed
Message-ID<Gve1H-8Nxy-3@gated-at.bofh.it>
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.

[toc] | [next] | [standalone]


#1146757

FromOtto Kekäläinen <otto@debian.org>
Date2023-05-15 02:50 +0200
Message-ID<Gvuzv-8Xpy-3@gated-at.bofh.it>
In reply to#1146687
This is not a fix, but could help make the situation easier to
detect/debug for users:

* https://salsa.debian.org/mariadb-team/mariadb-10.5/-/merge_requests/14
* https://salsa.debian.org/mariadb-team/mariadb-10.3/-/merge_requests/37

[toc] | [prev] | [next] | [standalone]


#1147089

FromOtto Kekäläinen <otto@debian.org>
Date2023-05-18 05:30 +0200
Message-ID<GwCuZ-9FnG-1@gated-at.bofh.it>
In reply to#1146757
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.

[toc] | [prev] | [next] | [standalone]


#1147091

FromOtto Kekäläinen <otto@debian.org>
Date2023-05-18 07:10 +0200
Message-ID<GwE3L-9GKN-1@gated-at.bofh.it>
In reply to#1147089
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

[toc] | [prev] | [next] | [standalone]


#1147595

FromOtto Kekäläinen <otto@debian.org>
Date2023-05-23 04:40 +0200
Message-ID<Gyq6l-aNdd-1@gated-at.bofh.it>
In reply to#1147089
I am experimenting the suggestion in
https://salsa.debian.org/otto/mariadb-server/-/commits/bugfix/1035949-upgrade-removes-client

[toc] | [prev] | [next] | [standalone]


#1148725

FromAndreas Beckmann <anbe@debian.org>
Date2023-06-04 14:10 +0200
Message-ID<GCUIx-dBss-1@gated-at.bofh.it>
In reply to#1147595
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

[toc] | [prev] | [next] | [standalone]


#1148768

FromOtto Kekäläinen <otto@debian.org>
Date2023-06-05 01:40 +0200
Message-ID<GD5uh-dHZe-3@gated-at.bofh.it>
In reply to#1148725
Forwarded: https://jira.mariadb.org/browse/MDEV-28640

For reference:

* The upgrade scenario this MR fixed:
https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/15cbf6e691827608636e6ff7f0a50432f50d0c4f
* Release notes mention:
https://salsa.debian.org/ddp-team/release-notes/-/merge_requests/187
* Upload to experimental pending in NEW queue:
https://ftp-master.debian.org/new/mariadb_1:10.11.3-2~exp1.html
* Release team consultation:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037107

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.bugs.dist


csiph-web