mysql/mariadb corrupted file after the upgrade to LEAP 15.3 (?)

Hi all,
so, I did the upgrade to LEAP 15.3… as described here:
https://forums.opensuse.org/showthread.php/555373-Upgrade-LEAP-15-2-to-15-3

all seems to be fine and well… BUT not everything:

  • mariadb/mysql on my “server” is no longer working…
  • it seems that it could be a corrupted file… THE most important file… (ibdata1)
  • but I’m not yet convinced…
    ** - could it be that the upgrade broke the database or the database file or … ?? OR… it was just a BIG coincidence ? Any ideas?

**as a side note… this “server” had been running 24/7 for several months without any problem (with 15.2)… and this makes me suspect that indeed it was not a coincidence…


2021-06-11 15:05:32 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
2021-06-11 15:05:32 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption

this is not critical to me because I can recreate the databases from SVN… but it means that I will (or lost already) some data… plus, it will give me the work of setting the databases again and so on… so, not so great :frowning:

Anyone with the same problem? or anyone had this already and knows a fix?

thanks!

Please show

systemctl status mariadb

ok, I found the source of the problem:

  • the upgrade from LEAP 15.2 to 15.3 removed mysql and installed mariadb
  • the format of the file ibdata1 that I have is still “mysql format” and maria cannot read it… so it complains “Invalid flags 0x4800 in ./ibdata1”

it would be better if the error message would just say… “…look, your file is in the “old” mysql format… and I cannot read it…”

here it is:


2021-06-10 18:03:07|install|mariadb|10.5.8-1.5|x86_64||repo-oss|
...
...
2021-06-10 18:06:43|remove |mysql-community-server|8.0.25-1.sl15|x86_64||
2021-06-10 18:06:44|remove |mysql-community-client|8.0.25-1.sl15|x86_64||

Here is what?

Please always include the line with the command together with the output. And do not leave out lines (except when it is very, very long). Now we have only some lines without any informationabout what you did to get them.

the lines are from the zypper log…
I don’t have the time now… will update the post with the command asap

So, to give more details:

During the upgrade process (LEAP 15.2 to 15.3), mysql 8 was removed/replaced by mariadb 10.5:


BORG:/var/log/zypp # more history | grep -e "2021-06.*|mysql"
2021-06-10 18:06:43|remove |mysql-community-server|8.0.25-1.sl15|x86_64||
2021-06-10 18:06:44|remove |mysql-community-client|8.0.25-1.sl15|x86_64||

BORG:/var/log/zypp # more history | grep -e "2021-06.*|mariadb"
2021-06-10 17:33:09|install|mariadb-errormessages|10.5.8-1.5|noarch||repo-oss|aa7e7b1218004cdb1f98f2d930d9c1d95c92acc7d2e62b609fef3e9b7b5fc1da|
2021-06-10 18:01:55|install|mariadb-client|10.5.8-1.5|x86_64||repo-oss|59ca68b6d322b2963da3cf8d4a35739322f270fbd6ec328955de50087b20db5a|
2021-06-10 18:03:07|install|mariadb|10.5.8-1.5|x86_64||repo-oss|bfcc8eafff4b970dbd37eb8c113d2d0c3d03c3bfb1572e6de590a0036c37f426|

Now the mariadb cannot read the mysql 8 file ibdata1… it needs to be “migrated”…
More details here:
https://mariadb.com/kb/en/upgrading-from-mysql-to-mariadb/
https://mariadb.com/kb/en/incompatibilities-and-feature-differences-between-mariadb-105-and-mysql-80/

So I have a bit of work to do…
Hope this can help others facing the same issue.

See ya!

The strange fact here is not replacing mysql with mariadb because this is the default behavior since some years (maybe from opensuse 42)
the strange is that you replaced mariadb with mysql and you forgot it :slight_smile:

Thanks for the report.

It seems indeed something to be studied better before upgrading to 15.3.

Hm, yes. This is an extract from zypper se -v mariadb on openSUSE 15.2:

i+ | mariadb                | package    | 10.4.17-lp152.2.8.1 | x86_64 | Update (OSS)

While it is true that mariadb Obsoletes mysql and mysql-server-community Provides mysql, so mariadb replaces it, the package mysql-server-community 8.0.25-1.sl15 is not from openSUSE, so it has different vendor and I would not expect it to be removed without any warning.

Well, it tells to run

zypper --releasever=15.3 dup --download-in-advance --allow-vendor-change

so OP got what was asked for - zypper got carte blanche to switch vendor.

Yet another example that one should never blindly execute random commands one happened to have found on Internet without actually understanding what these commands do and (probably, more important) why exactly those commands were suggested.

I forgot it? You might think this is funny… but it is not.

I upgraded the OS… I was not expecting that by upgrading the OS… the database would be replaced… my mysql database has nothing to do with the OS.
and btw… I’m not an expert in opensuse or linux… I use it because I like it… and have been using Linux for decades… from the time that configuring wifi was an herculean task for several days with lots of debugging and try/error…

Anyway… did your comment help? No, it did not.

did I receive any warning about this replace during the upgrade?

  • honestly I don’t know. I did the upgrade on my laptop (that doesn’t have mysql) and all went well… so days after I did the same on my home server… and did not pay much attention… it was just go go go… and the server has much more stuff… svn, nfs, backups, databases, web server and so on and so on… but like I said… I took measures… but did not expect the upgrade to touch my databases.

From your rant above I conclude that you still do not understand why it happened.

if you bother to read my upgrade post… you will see that I did my upgrade without that parameter.
I suggested that parameter to a user that had +200 conflicts to solve… and some moderator edited my post (as it is stated there)… if you read…
And I don’t copy/paste commands… either I know what commands do, or I read/investigate to learn what commands/options/parameters do.
I’m not an expert… but I’m not that dumb

I try to stay objective, so, just a request in advance: If anyone feels offended by my post, I’m sorry. I noticed this already heated up a bit and I don’t want to “spill oil into the fire”, but do want to throw in my two cents:

In fact: I’m using opensuse on my server for quite a few years now, starting back from somewhen around mid-2014 - so it was some 13.x back then - or maybe even some 12.x - don’T remember, I have to look it up in some time chart. Back then MySQL was still the main vendor on a clean install. I don’t remember the exact version, but if I have to guess it maybe was already in some 13.x - or maybe with the first 42 release - but opensuse switched to MariaDB a few years ago. So, anyone still using MySQL had to set it specific at some point in the past. Hence I’m more tend to go with Max here: At some point in the past you decided to stick to MySQL and didn’t move over to MariaDB when opensuse did. Now it bid you in the arse as, for whatever reason, your upgrade just now switched the vendor from MySQL to MariaDB - something opensuse did a few years ago - and MariaDB and MySQL already diverged enough so the current MariaDB server is no longer able to read files written by MySQL v8.

A possible solution could be to copy over the data files onto another system still running leap 15.2 and MySQL v8 which should be able to load the data and migrate them via database-vendor independed SQL.

In addition to that: Although I still have no explanation, for some reason it seems that the binaries availble from the opensuse repos are in some way altered than what one gets from mariadb.org repo. I’m using Apache James for years now, and every time I upgrade to the new release I get some strange exception when setting up the database when using the opensuse version. Switching to the mariadb.org repo anything works fine. I also had two threads about it - but both still not got any conclusion as for WHY this happen. So, although that MAY be just some special edge case I experience with my Apache James mail server when setting up the database - at least I personally would recommend to ditch what ever you got from the opensuse repos - add the mariadb.org repo and use it instead. Be aware: That still wouldn’t solve your issue as that’s still some specific to the differences between MariaDB and MariaDB.

cryptearth,
I have been using opensuse for quite some time… and so upgrading from version to version… and my mysql 8 database has been there working quietly and fine for quite some time…
I had no ideia about opensuse including mariadb and not mysql… And honestly… I don’t care… just that before… for example, when I did the upgrade to 15.2… mysql was there and remained there.

Anyway, I’m now using maria!
I recreated my dbs from svn… loaded the data… all is back online… except that now my dbs are maria :smiley: :smiley:

about getting offended… no no… all is good and fine :smiley: no stress… peace!
and thanks for your two cents :wink:

openSUSE Leap 15.2 don’t provides mysql-community-{server,client}, maybe you disabled some extra repo and that’s why zypper replace it with mariadb :confused:

just found this file:

-rw-r--r-- 1 root root 264 10 jun 18:03 mariadb-10.5.8-1.5-something
BORG:/var/adm/update-messages # more mariadb-10.5.8-1.5-something


WARNING: You are upgrading from different stable version of MySQL!


Your database will be migrated automatically during next restart of MySQL.
Before you do that make sure you have up to date backup of your data. It
should be mainly in /var/lib/mysql directory.


BORG:/var/adm/update-messages #

but obviously this didn’t go so well :smiley:

yes, indeed I disabled all non opensuse repos before the upgrade… as it is documented by opensuse…

in any case… I have mariadb now running… and for next opensuse upgrades… I’ll be way more careful :slight_smile:

Glad to hear you were able to restore your data from a backup / another source.

~ rest of wall-of-text cut due to not fit into this topic
if someone is interested in some issues about MySQL vs MariaDB on opensuse over the years in combination with using it for managing two redundant e-mail-servers - hit me up

https://en.opensuse.org/Portal:MySQL
https://en.opensuse.org/SDB:Switching_between_MySQL_variants