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

mysql_upgrade failed with "('mariadb.sys'@'localhost') does not exist" and mariadb 10.4/10.5 on docker

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.4.17, 10.5.8
    • N/A
    • Upgrades
    • None

    Description

      With fresh installation of MariaDB 10.4.17 on docker, when we run mysql_upgrade, its getting failed with below error.

      mysql.user
      Error    : The user specified as a definer ('mariadb.sys'@'localhost') does not exist
      error    : Corrupt
      Phase 4/7: Running 'mysql_fix_privilege_tables'
      ERROR 1449 (HY000) at line 7: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
      ERROR 1449 (HY000) at line 16: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
      ERROR 1449 (HY000) at line 59: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
      ..
      

      You can reproduce it on docker with simple steps.

      Step 1: docker run -d --name marianil -eMARIADB_ROOT_PASSWORD=nil2020 -P mariadb/server:10.4
      Step 2: docker start marianil
      marianil
      Step 3: echo "show databases" | docker exec -i marianil mysql --user=root --password=nil2020 – confirm is instance is running or not.
      Database
      information_schema
      mysql
      performance_schema
      [root@localhost mysql]# echo "select version()" | docker exec -i marianil mysql --user=root --password=nil2020
      version()
      10.4.17-MariaDB-1:10.4.17+maria~bionic
      [root@localhost mysql]#

      Step 4: docker exec -i marianil mysql_upgrade --user=root --password=nil2020

      Attachments

        Issue Links

          Activity

            what docker images do you use?

            serg Sergei Golubchik added a comment - what docker images do you use?
            christian.bulitta@kessler.ch Christian Bulitta added a comment - - edited

            Bug was originally found by me.
            Bug is present in mariadb 10.4 AND mariadb 10.5:

            • 10.4.17-MariaDB-1:10.4.17+maria~bionic
            • 10.5.8-MariaDB-1:10.5.8+maria~bionic

            maridb 10.2 and 10.3 are good, i.e. do not show this bug:

            • 10.2.36-MariaDB-1:10.2.36+maria~bionic
            • 10.3.27-MariaDB-1:10.3.27+maria~bionic
            christian.bulitta@kessler.ch Christian Bulitta added a comment - - edited Bug was originally found by me. Bug is present in mariadb 10.4 AND mariadb 10.5: 10.4.17-MariaDB-1:10.4.17+maria~bionic 10.5.8-MariaDB-1:10.5.8+maria~bionic maridb 10.2 and 10.3 are good, i.e. do not show this bug: 10.2.36-MariaDB-1:10.2.36+maria~bionic 10.3.27-MariaDB-1:10.3.27+maria~bionic

            Just found out a potential root cause / even more serious bug with the docker image of mariadb/server:10.4 and mariadb/server:10.5:
            The view "mysql.user" is corrupt!

            Steps to reproduce:

            docker run -d --rm --name marianil -eMARIADB_ROOT_PASSWORD=nil2020 -P mariadb/server:10.4
             
            echo "show databases" | docker exec -i marianil mysql --user=root --password=nil2020 
            -->
            Database
            information_schema
            mysql
            performance_schema
             
            echo "select version()" | docker exec -i marianil mysql --user=root --password=nil2020
            -->
            version()
            10.4.17-MariaDB-1:10.4.17+maria~bionic
             
            echo "select * from mysql.user" | docker exec -i marianil mysql --user=root --password=nil2020
             
            -->
            ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
             

            christian.bulitta@kessler.ch Christian Bulitta added a comment - Just found out a potential root cause / even more serious bug with the docker image of mariadb/server:10.4 and mariadb/server:10.5: The view "mysql.user" is corrupt! Steps to reproduce: docker run -d --rm --name marianil -eMARIADB_ROOT_PASSWORD=nil2020 -P mariadb/server:10.4   echo "show databases" | docker exec -i marianil mysql --user=root --password=nil2020 --> Database information_schema mysql performance_schema   echo "select version()" | docker exec -i marianil mysql --user=root --password=nil2020 --> version() 10.4.17-MariaDB-1:10.4.17+maria~bionic   echo "select * from mysql.user" | docker exec -i marianil mysql --user=root --password=nil2020   --> ERROR 1449 (HY000) at line 1: The user specified as a definer ('mariadb.sys'@'localhost') does not exist
            christian.bulitta@kessler.ch Christian Bulitta added a comment - - edited

            Another remark:
            Both bugs (mysql_upgrade and corrupt mysql.user view) are only present in the docker images maintained by MariaDB: https://hub.docker.com/r/mariadb/server
            They are not present in the official docker images: https://hub.docker.com/_/mariadb

            christian.bulitta@kessler.ch Christian Bulitta added a comment - - edited Another remark: Both bugs (mysql_upgrade and corrupt mysql.user view) are only present in the docker images maintained by MariaDB: https://hub.docker.com/r/mariadb/server They are not present in the official docker images: https://hub.docker.com/_/mariadb

            pushed the fix for 10.4 and 10.5

            abychko Alexey Bychko (Inactive) added a comment - pushed the fix for 10.4 and 10.5

            niljoshi please test 10.4 and 10.5 reported

            abychko Alexey Bychko (Inactive) added a comment - niljoshi please test 10.4 and 10.5 reported

            Thanks so much for fixing this!
            Tests on my side with 10.4 and 10.5 are OK.

            christian.bulitta@kessler.ch Christian Bulitta added a comment - Thanks so much for fixing this! Tests on my side with 10.4 and 10.5 are OK.

            It is fixed.

            niljoshi Nilnandan Joshi added a comment - It is fixed.

            People

              niljoshi Nilnandan Joshi
              niljoshi Nilnandan Joshi
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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