Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-33262

Fatal error 1408 when installing mariadb-server / mariadb-upgrade

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.11.4
    • 10.5, 10.6, 10.11
    • Platform Debian, Upgrades
    • None
    • Debian 12, 10.11.4-MariaDB-1~deb12u1

    Description

      I recently upgraded a Debian 10 server running MySQL 5.7 to MariaDB 10.3. That upgrade went smoothly so I then upgraded to Debian 11 and MariaDB 10.5. That also went smoothly. I then upgraded to Debian 12 and MariaDB 10.11. While performing that upgrade, I encountered an issue with mariadb-server:

      Setting up mariadb-server (1:10.11.4-1~deb12u1) ...
      dpkg: error processing package mariadb-server (--configure):
       installed mariadb-server package post-installation script subprocess returned error exit status 1
      Processing triggers for man-db (2.11.2-2) ...
      Processing triggers for libc-bin (2.36-9+deb12u3) ...
      Errors were encountered while processing:
       mariadb-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)
      

      I recently upgraded my Debian 10 server running MySQL 5.7 to Debian 11 and MariaDB 10.3. That upgrade went smoothly. I then decided to upgrade to Debian 12 and MariaDB 10.11. While performing that upgrade, I encountered an issue with mariadb-server:

      Setting up mariadb-server (1:10.11.4-1~deb12u1) ...
      dpkg: error processing package mariadb-server (--configure):
       installed mariadb-server package post-installation script subprocess returned error exit status 1
      Processing triggers for man-db (2.11.2-2) ...
      Processing triggers for libc-bin (2.36-9+deb12u3) ...
      Errors were encountered while processing:
       mariadb-server
      E: Sub-process /usr/bin/dpkg returned an error code (1)
      I re-ran apt install mariadb-server and got the same error. I then ran apt install -f and dpkg --configure -a but they both returned the same error as well.
      

      Next, I ran apt purge mariadb-server and then tried to reinstall with apt install mariadb-server and got the same error as above.

      It appears that the installation itself succeedes as I was able to run systemctl start mariadb so that I could then run mariadb-upgrade but that failed part of the way through with:

      Phase 4/7: Running 'mysql_fix_privilege_tables'
      ERROR 1408 (HY000) at line 429: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
      FATAL ERROR: Upgrade failed
      

      /var/log/mysql/error.log shows a few errors related to a column type mismatch for mysql.event table but I'm not sure if that is related to the mariadb-upgrade/mysql_fix_privilege_tables error or not.

      I ran mariadb-check --check-upgrade --all-databases and all of the tables were marked as "OK".

      Running SELECT @@Version; returns "10.11.4-MariaDB-1~deb12u1" so the upgrade appears to have been mostly successful but I'm not sure how to fix the privilege tables.

      In addition, every time I run apt install or apt upgrade, dpkg attempts to configure mariadb-server, which kills the mariadb.service. So, I need to figure out how to get this issue resolved.

      Attachments

        1. mariadb_10.11_error.log
          8 kB
        2. mariadb_10.3_error.log
          8 kB
        3. mariadb_10.5_error.log
          10 kB
        4. mariadb-dump.sql
          43 kB
        5. my.cnf
          4 kB

        Activity

          danblack Daniel Black added a comment -

          mysql.user in 10.11.6 isn't a table, but a view. You cannot update the view.

          This is from a debian postinst, and even this is scoped around criteria that would indicate a mysql previous install

          UPDATE mysql.user SET plugin='unix_socket' WHERE plugin='auth_socket';
          

          Which criteria would be true from https://github.com/MariaDB/server/blob/10.11/debian/mariadb-server.postinst#L125 ?

          What mysql/mariadb version where you running prior to install?

          danblack Daniel Black added a comment - mysql.user in 10.11.6 isn't a table, but a view. You cannot update the view. This is from a debian postinst, and even this is scoped around criteria that would indicate a mysql previous install UPDATE mysql. user SET plugin= 'unix_socket' WHERE plugin= 'auth_socket' ; Which criteria would be true from https://github.com/MariaDB/server/blob/10.11/debian/mariadb-server.postinst#L125 ? What mysql/mariadb version where you running prior to install?
          curtis.spencer Curtis Spencer added a comment - - edited

          We were running MySQL 5.7 on Debian 9. Here's the process I followed to upgrade:

          1. Remove MySQL
          2. Install MariaDB
          3. Upgrade to Debian 10 and run mariadb-upgrade
          4. Upgrade to Debian 11 and run mariadb-upgrade
          curtis.spencer Curtis Spencer added a comment - - edited We were running MySQL 5.7 on Debian 9. Here's the process I followed to upgrade: Remove MySQL Install MariaDB Upgrade to Debian 10 and run mariadb-upgrade Upgrade to Debian 11 and run mariadb-upgrade

          I've tested this on Debian Docker and installed new MySQL 5.7 and then installed MariaDB 10.11 (I've used git version but it should work the same) and it worked as expected. At least I didn't have to run mariadb-upgrade --force.

          illuusio Tuukka Pasanen added a comment - I've tested this on Debian Docker and installed new MySQL 5.7 and then installed MariaDB 10.11 (I've used git version but it should work the same) and it worked as expected. At least I didn't have to run mariadb-upgrade --force.
          illuusio Tuukka Pasanen added a comment - - edited

          I've bite bullet and installed MySQL 5.7 to Debian 9 and first tried this:

          1. Remove MySQL
          2. Install MariaDB 10.6 (which is still fairly supported in stretch aka Debian 9) which worked as expected
          3. Upgrade to 10
          4. Upgrade to 11
          5. Upgrade to MariaDB 10.11

          That path worked as expected. Wanted to share this is someone wants to do it. After this I followed this one but it failed like this

          1. Remove MySQL
          2. Install MariaDB 10.3 (Which is the used path?)

          It fails in password right away after asking it. curtis.spencer can you give me some glues how did you get thru that phase to install 10.5?

          illuusio Tuukka Pasanen added a comment - - edited I've bite bullet and installed MySQL 5.7 to Debian 9 and first tried this: Remove MySQL Install MariaDB 10.6 (which is still fairly supported in stretch aka Debian 9) which worked as expected Upgrade to 10 Upgrade to 11 Upgrade to MariaDB 10.11 That path worked as expected. Wanted to share this is someone wants to do it. After this I followed this one but it failed like this Remove MySQL Install MariaDB 10.3 (Which is the used path?) It fails in password right away after asking it. curtis.spencer can you give me some glues how did you get thru that phase to install 10.5?

          @Tuukka Pasanen,

          The upgrades from MySQL 5.7 to MariaDB 10.3 on Debian 10 and then to Debian 11 and MariaDB 10.5 went smoothly for me. It wasn't until I upgraded to Debian 12 and MariaDB 10.11 that I encountered an issue.

          I'm not sure what you mean when you say it "fails in password right away after asking it". Which part of the upgrade is failing (i.e. apt, mysql-upgrade, etc.)? Can you provide more detail/specific error messages? Is there anything in the logs?

          curtis.spencer Curtis Spencer added a comment - @Tuukka Pasanen, The upgrades from MySQL 5.7 to MariaDB 10.3 on Debian 10 and then to Debian 11 and MariaDB 10.5 went smoothly for me. It wasn't until I upgraded to Debian 12 and MariaDB 10.11 that I encountered an issue. I'm not sure what you mean when you say it "fails in password right away after asking it". Which part of the upgrade is failing (i.e. apt, mysql-upgrade, etc.)? Can you provide more detail/specific error messages? Is there anything in the logs?

          People

            rucha174 Rucha Deodhar
            curtis.spencer Curtis Spencer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.