• Bookworm - broken update? (mariadb-common)

    From Gareth Evans@21:1/5 to All on Sun Mar 16 10:10:01 2025
    Hello,

    $ cat /etc/debian_version
    12.10

    An automated apt update/upgrade failed last night. On trying again, I get:

    $ sudo apt update; sudo apt upgrade
    <snip>
    Preconfiguring packages ...
    48 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    Need to get 0 B/133 MB of archives.
    After this operation, 474 MB of additional disk space will be used.
    Setting up mariadb-common (1:10.11.11-0+deb12u1) ...
    update-alternatives: error: alternative path /etc/mysql/mariadb.cnf doesn't exist
    dpkg: error processing package mariadb-common (--configure):
    installed mariadb-common package post-installation script subprocess returned error exit status 2
    Errors were encountered while processing:
    mariadb-common
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    /etc/mysql/mariadb.cnf doesn't exist on my system, but is provided within the package:

    $ ls /etc/mysql/*cnf
    /etc/mysql/debian.cnf

    $ dpkg -x /var/cache/apt/archives/mariadb-common_1%3a10.11.11-0+deb12u1_all.deb ~/deb
    $ dpkg -e /var/cache/apt/archives/mariadb-common_1%3a10.11.11-0+deb12u1_all.deb ~/deb
    $ ls ~/deb/etc/mysql/*cnf
    /home/user/deb/etc/mysql/mariadb.cnf

    $ tail ~/deb/postinst
    # Thus, we need to ensure here that mariadb.cnf indeed became the primary
    # alternative and override with priority 500 if needed.
    if ! update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf"
    then
    update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mariadb.cnf" 500 || true
    fi
    ;;
    esac

    Isn't this supposed to add/replace mariadb.cnf from the package into /etc/mysql/?

    FWIW:

    $ update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf"
    update-alternatives: warning: alternative /etc/mysql/mariadb.cnf (part of link group my.cnf) doesn't exist; removing from list of alternatives
    update-alternatives: warning: alternative /etc/mysql/my.cnf.fallback (part of link group my.cnf) doesn't exist; removing from list of alternatives

    Has anyone else seen this?

    Thanks,
    Gareth

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe@21:1/5 to Gareth Evans on Sun Mar 16 12:10:02 2025
    On Sun, 16 Mar 2025 08:56:47 +0000
    "Gareth Evans" <[email protected]> wrote:

    Hello,

    $ cat /etc/debian_version
    12.10

    An automated apt update/upgrade failed last night. On trying again,
    I get:

    $ sudo apt update; sudo apt upgrade
    <snip>
    Preconfiguring packages ...
    48 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    Need to get 0 B/133 MB of archives.
    After this operation, 474 MB of additional disk space will be used.
    Setting up mariadb-common (1:10.11.11-0+deb12u1) ...
    update-alternatives: error: alternative path /etc/mysql/mariadb.cnf
    doesn't exist dpkg: error processing package mariadb-common
    (--configure): installed mariadb-common package post-installation
    script subprocess returned error exit status 2 Errors were
    encountered while processing: mariadb-common
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    /etc/mysql/mariadb.cnf doesn't exist on my system, but is provided
    within the package:

    $ ls /etc/mysql/*cnf
    /etc/mysql/debian.cnf

    $ dpkg -x /var/cache/apt/archives/mariadb-common_1%3a10.11.11-0+deb12u1_all.deb
    ~/deb $ dpkg -e /var/cache/apt/archives/mariadb-common_1%3a10.11.11-0+deb12u1_all.deb
    ~/deb $ ls ~/deb/etc/mysql/*cnf /home/user/deb/etc/mysql/mariadb.cnf

    $ tail ~/deb/postinst
    # Thus, we need to ensure here that mariadb.cnf indeed became the
    primary # alternative and override with priority 500 if needed.
    if ! update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf" then
    update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mariadb.cnf" 500 || true fi
    ;;
    esac

    Isn't this supposed to add/replace mariadb.cnf from the package into /etc/mysql/?

    FWIW:

    $ update-alternatives --query my.cnf | grep --quiet "Value: /etc/mysql/mariadb.cnf" update-alternatives: warning: alternative /etc/mysql/mariadb.cnf (part of link group my.cnf) doesn't exist;
    removing from list of alternatives update-alternatives: warning:
    alternative /etc/mysql/my.cnf.fallback (part of link group my.cnf)
    doesn't exist; removing from list of alternatives

    Has anyone else seen this?




    What's the background here? Did you have a working mariadb installation
    before, and is it still working?

    I have mariadb on sid and it certainly has those files. There is a
    somewhat complicated arrangement, and it looks as if a working
    configuration file could be in more than one location. It should only
    be generic anyway, it includes conf.d and mariabd.conf.d where the
    actual configurations are.

    --
    Joe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gareth Evans@21:1/5 to Joe on Sun Mar 16 15:40:01 2025
    On Sun 16/03/2025 at 11:01, Joe <[email protected]> wrote:

    What's the background here? Did you have a working mariadb installation before, and is it still working?

    Hi Joe,

    It was working before and after the failed upgrade, as neither it nor anything else had been upgraded.

    I copied mariadb.cnf from the extracted mariadb-common package files to /etc/mysql/ and retried the upgrade, which succeeded, but mariadb then produced "SQLSTATE <some code> no such file or directory" errors in my web apps, so I restarted the mariadb
    service, and got:

    $ sudo systemctl status mariadb
    × mariadb.service - MariaDB 10.11.11 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enabled)
    Active: failed (Result: exit-code) since Sun 2025-03-16 14:21:46 GMT; 15s ago
    Duration: 7h 28min 31.155s
    Docs: man:mariadbd(8)
    https://mariadb.com/kb/en/library/systemd/
    Process: 1777879 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 1777880 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 1777882 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment>
    Process: 1777899 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
    Main PID: 1777899 (code=exited, status=1/FAILURE)
    CPU: 102ms

    Mar 16 14:21:46 qwerty.local systemd[1]: Starting mariadb.service - MariaDB 10.11.11 database server...
    Mar 16 14:21:46 qwerty.local sh[1777896]: [108B blob data]
    Mar 16 14:21:46 qwerty.local sh[1777896]: Fatal error in defaults handling. Program aborted
    Mar 16 14:21:46 qwerty.local mariadbd[1777899]: [100B blob data]
    Mar 16 14:21:46 qwerty.local mariadbd[1777899]: Fatal error in defaults handling. Program aborted
    Mar 16 14:21:46 qwerty.local systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
    Mar 16 14:21:46 qwerty.local systemd[1]: mariadb.service: Failed with result 'exit-code'.
    Mar 16 14:21:46 qwerty.local systemd[1]: Failed to start mariadb.service - MariaDB 10.11.11 database server.


    Same state reported after a reboot.

    Then:

    $ sudo mv /etc/mysql/mariadb.cnf /etc/mysql/mariadb.cnf.xxx

    $ sudo systemctl restart mariadb

    $ sudo systemctl status mariadb

    ● mariadb.service - MariaDB 10.11.11 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; preset: enab>
    Active: active (running) since Sun 2025-03-16 14:30:37 GMT; 4s ago
    ...

    So working again, but a messy/broken upgrade process for me.

    Is this worth reporting?

    Thanks,
    G



    I have mariadb on sid and it certainly has those files. There is a
    somewhat complicated arrangement, and it looks as if a working
    configuration file could be in more than one location. It should only
    be generic anyway, it includes conf.d and mariabd.conf.d where the
    actual configurations are.

    --
    Joe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe@21:1/5 to Gareth Evans on Sun Mar 16 17:10:01 2025
    On Sun, 16 Mar 2025 14:38:45 +0000
    "Gareth Evans" <[email protected]> wrote:

    On Sun 16/03/2025 at 11:01, Joe <[email protected]> wrote:

    What's the background here? Did you have a working mariadb
    installation before, and is it still working?

    Hi Joe,

    It was working before and after the failed upgrade, as neither it nor anything else had been upgraded.

    I copied mariadb.cnf from the extracted mariadb-common package files
    to /etc/mysql/ and retried the upgrade, which succeeded, but mariadb
    then produced "SQLSTATE <some code> no such file or directory" errors
    in my web apps, so I restarted the mariadb service, and got:

    $ sudo systemctl status mariadb
    × mariadb.service - MariaDB 10.11.11 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled;
    preset: enabled) Active: failed (Result: exit-code) since Sun
    2025-03-16 14:21:46 GMT; 15s ago Duration: 7h 28min 31.155s
    Docs: man:mariadbd(8)
    https://mariadb.com/kb/en/library/systemd/
    Process: 1777879 ExecStartPre=/usr/bin/install -m 755 -o mysql -g
    root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Process:
    1777880 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process:
    1777882 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] &&
    VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment> Process: 1777899 ExecStart=/usr/sbin/mariadbd
    $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE) Main PID: 1777899 (code=exited, status=1/FAILURE)
    CPU: 102ms

    Mar 16 14:21:46 qwerty.local systemd[1]: Starting mariadb.service -
    MariaDB 10.11.11 database server... Mar 16 14:21:46 qwerty.local
    sh[1777896]: [108B blob data] Mar 16 14:21:46 qwerty.local
    sh[1777896]: Fatal error in defaults handling. Program aborted Mar 16 14:21:46 qwerty.local mariadbd[1777899]: [100B blob data] Mar 16
    14:21:46 qwerty.local mariadbd[1777899]: Fatal error in defaults
    handling. Program aborted Mar 16 14:21:46 qwerty.local systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
    Mar 16 14:21:46 qwerty.local systemd[1]: mariadb.service: Failed with
    result 'exit-code'. Mar 16 14:21:46 qwerty.local systemd[1]: Failed
    to start mariadb.service - MariaDB 10.11.11 database server.


    Same state reported after a reboot.

    Then:

    $ sudo mv /etc/mysql/mariadb.cnf /etc/mysql/mariadb.cnf.xxx

    $ sudo systemctl restart mariadb

    $ sudo systemctl status mariadb

    ● mariadb.service - MariaDB 10.11.11 database server
    Loaded: loaded (/lib/systemd/system/mariadb.service; enabled;
    preset: enab> Active: active (running) since Sun 2025-03-16 14:30:37
    GMT; 4s ago ...

    So working again, but a messy/broken upgrade process for me.

    Is this worth reporting?


    Yes, I would think so, most Debian servers will be running mariadb on
    bookworm, either for production use or for internal purposes or both.

    Sid is on mariadb 11.4.5, so while it would have used the current
    bookworm version at some time, the fact that there has just been an
    upgrade in stable means a security fix for a bug that was not known
    when it was in sid.

    --
    Joe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gareth Evans@21:1/5 to All on Sun Mar 16 17:30:01 2025
    On 16 Mar 2025, at 16:06, Joe <[email protected]> wrote:

    On Sun, 16 Mar 2025 14:38:45 +0000
    "Gareth Evans" <[email protected]> wrote

    So working again, but a messy/broken upgrade process for me.

    Is this worth reporting?

    Yes, I would think so, most Debian servers will be running mariadb on bookworm, either for production use or for internal purposes or both.

    Sid is on mariadb 11.4.5, so while it would have used the current
    bookworm version at some time, the fact that there has just been an
    upgrade in stable means a security fix for a bug that was not known
    when it was in sid.

    OK thanks very much
    G

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gareth Evans@21:1/5 to All on Sun Mar 16 18:50:01 2025
    Reported at

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1100655

    for anyone interested.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)