[MDEV-24566] mysql_upgrade failed with "('mariadb.sys'@'localhost') does not exist" and mariadb 10.4/10.5 on docker Created: 2021-01-11  Updated: 2021-04-19  Due: 2021-01-26  Resolved: 2021-01-23

Status: Closed
Project: MariaDB Server
Component/s: Upgrades
Affects Version/s: 10.4.17, 10.5.8
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Nilnandan Joshi Assignee: Nilnandan Joshi
Resolution: Fixed Votes: 2
Labels: None

Issue Links:
Relates
relates to MDEV-22542 mysql_upgrade fails on 10.4.13 in doc... Closed

 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



 Comments   
Comment by Sergei Golubchik [ 2021-01-11 ]

what docker images do you use?

Comment by Christian Bulitta [ 2021-01-11 ]

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
Comment by Christian Bulitta [ 2021-01-11 ]

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
 

Comment by Christian Bulitta [ 2021-01-11 ]

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

Comment by Alexey Bychko (Inactive) [ 2021-01-22 ]

pushed the fix for 10.4 and 10.5

Comment by Alexey Bychko (Inactive) [ 2021-01-22 ]

niljoshi please test 10.4 and 10.5 reported

Comment by Christian Bulitta [ 2021-01-22 ]

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

Comment by Nilnandan Joshi [ 2021-01-23 ]

It is fixed.

Generated at Thu Feb 08 09:30:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.