Bug 29649

Summary: mysqlcheck fails with fatal error in Cauldron breaking mariadb
Product: Mageia Reporter: Barry Jackson <zen25000>
Component: RPM PackagesAssignee: Marc Krämer <mageia>
Status: RESOLVED OLD QA Contact:
Severity: critical    
Priority: Normal CC: ftg
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
See Also: https://jira.mariadb.org/browse/MDEV-27236
Whiteboard:
Source RPM: mariadb-10.6.4-2.mga9.src.rpm CVE:
Status comment:
Attachments: Normal operation in Mga8
Failing in Mga9
Running mysql_upgrade from command line without zmsetup script

Description Barry Jackson 2021-11-12 01:59:59 CET
Description of problem:
In order to avoid failure of zoneminder when mariadb versions change, the zmsetup script runs mysqlcheck. This has never given problems in Mga8 but it repeatably fails in Cauldron.

Attached is the full output of zmsetup in Mga8 and the same output from it in Cauldron. These are taken from a Mga8 VM and the same VM upgraded to Mga9.

The first instance of this showed up in another real system, where the mariadb install is now broken. The VM testing was purely for this report.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
Comment 1 Barry Jackson 2021-11-12 02:01:32 CET
Created attachment 12983 [details]
Normal operation in Mga8
Comment 2 Barry Jackson 2021-11-12 02:02:39 CET
Created attachment 12984 [details]
Failing in Mga9
Comment 3 Frank Griffin 2021-11-12 03:52:29 CET
Assigning to registered maintainer.

CC: (none) => ftg
Assignee: bugsquad => mageia

Comment 4 Barry Jackson 2021-11-12 12:48:39 CET
There are similar but very old reports here:
https://jira.mariadb.org/browse/MDEV-8117
https://jira.mariadb.org/browse/MDEV-8115
https://jira.mariadb.org/browse/MDEV-6916

There is a note in here: https://docs.w3cub.com/mariadb/repair-view/index that says "Note that REPAIR VIEW in MariaDB 10.0.18 and MariaDB 5.5.43 could crash the server (see MDEV-8115). Upgrade to a later version."

Maybe this bug has re-surfaced in 10.6.4 ?

It was OK in 10.5.12 on Mga8.

Once this has happened, mysqld will no longer start. I don't know how to fix it. "Exited with Error code" does not help much :\
Comment 5 Barry Jackson 2021-11-12 13:04:20 CET
A little background that may help:

mysql_upgrade is called from http://svnweb.mageia.org/packages/cauldron/zoneminder/current/SOURCES/zmsetup?revision=1755397&view=markup at line 243.

mysql_update calls mysqlcheck, which it seems is the tool that is failing.

Running mysql_upgrade should not normally break anything see docs here:

https://docs.w3cub.com/mariadb/mysql_upgrade/index

If nothing needs updating it normally returns a message to that effect and closes.
Comment 6 Barry Jackson 2021-11-12 13:06:09 CET
s/mysql_update/mysql_upgrade/  Sorry typo :/
Comment 7 Barry Jackson 2021-11-12 13:56:56 CET
Running mysql_upgrade with -vvvv does not help much:

Phase 3/7: Fixing views
Running 'mysqlcheck' with connection arguments: --port='3306' --socket='/var/lib/mysql/mysql.sock' 
'mysqlcheck' --defaults-file=/tmp/mysql_upgrade-PvkDae --all-databases --repair --process-views=YES --skip-process-tables --verbose  --skip-write-binlog 2>&1 
Processing databases
information_schema
mysql
mysqlcheck: Got error: 2013: Lost connection to server during query when executing 'REPAIR NO_WRITE_TO_BINLOG VIEW ... '
FATAL ERROR: Upgrade failed

However in this Mga9 VM I *CAN* still restart mysqld which was not the case when this error occured on a real system.
ZoneMinder of course will not run as the zmsetup script does not get past mysql_update to upgrade the ZoneMinder database to the new zm db version which it requires to start.
Comment 8 Barry Jackson 2021-11-12 16:03:02 CET
Created attachment 12986 [details]
Running mysql_upgrade from command line without zmsetup script

Just to pull zmsetup script out of the arena this is the output from just running msql_upgrade.
Comment 9 Marc Krämer 2021-12-12 11:59:15 CET
Sorry for the late reply. It looks like some upgrade table definition does not match the running version. I've created an upstream bug for it:

https://jira.mariadb.org/browse/MDEV-27236

The connection is lost, since the server "crashes" (restarts), as you can see in the logs. Thanks for testing! I hope this gets fixed soon, as mariadb will start to release new versions every 1/4 of a year....

See Also: (none) => https://jira.mariadb.org/browse/MDEV-27236

Comment 10 Marc Krämer 2021-12-12 18:46:39 CET
So far it looks like this has to do with openssl upgrade to V3...
Comment 11 Marc Krämer 2021-12-12 18:50:50 CET
"You can see that MDEV-25785 has FixVersion: 10.8, so it's being implemented for 10.8. This is the plan."

https://jira.mariadb.org/browse/MDEV-25785


We'll see what else fails due to ssl upgrade...
Comment 12 Marc Krämer 2023-09-07 21:07:18 CEST
old - cauldron is released.

Status: NEW => RESOLVED
Resolution: (none) => OLD