[MDEV-14990] mysql_upgrade fails with ERROR 1408 (HY000) at line 566: Event Scheduler: An error occurred when initializing system tables Created: 2018-01-18  Updated: 2018-03-06  Resolved: 2018-02-13

Status: Closed
Project: MariaDB Server
Component/s: Events, Server
Affects Version/s: 10.3.4
Fix Version/s: 10.3.5

Type: Bug Priority: Blocker
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None


 Description   

Upon upgrade from previous versions, the first server startup produces errors in the log:

2018-01-19  1:04:37 0 [ERROR] Column count of mysql.db is wrong. Expected 23, found 22. Created with MariaDB 100303, now running 100304. Please use mysql_upgrade to fix this error
2018-01-19  1:04:37 0 [ERROR] mysqld: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.

This is fine, since mysql_upgrade hasn't been run yet. However, after that mysql_upgrade also fails:

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

The second attempt to run mysql_upgrade, even right after the first failure, actually works:

Phase 4/7: Running 'mysql_fix_privilege_tables'
Phase 5/7: Fixing table and database names
Phase 6/7: Checking and upgrading tables
Processing databases
information_schema
performance_schema
test
Phase 7/7: Running 'FLUSH PRIVILEGES'
OK

and after that the server restarts without any errors.
Given that Debian packages run mysql_upgrade in the background (which means it doesn't make the server upgrade/startup fail), and RPM packages don't run mysql_upgrade at all, manual re-run of the failed mysql_upgrade is a viable workaround for the beta, but it should naturally be fixed.

Apparently upgrade from all versions is affected, I've seen it happen on upgrade from 10.0, 10.1, 10.2, 10.3.3, didn't try 5.5.


Generated at Thu Feb 08 08:17:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.