Bug #106322 Upgrade from 5.7 to 8.0 fails - "Operating system error number 2 in a file opera
Submitted: 28 Jan 2022 9:43 Modified: 31 Jan 2022 13:35
Reporter: Bruce Porter Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8 OS:Solaris (S11.4)
Assigned to: CPU Architecture:x86 (SRU39)

[28 Jan 2022 9:43] Bruce Porter
Description:
Upgrading from 5.7 to 8.0 but have hit an issue and need help diagnosing it.

Error messages (IMO) not particularly helpful. I'm guessing it may be a locale issue?

ownership and mode of files/dirs in DB have been checked.

Any help/ideas appreciated.

---8<
2022-01-26T11:06:41.550620Z 0 [Note] /usr/mysql/5.7/bin/mysqld: Shutdown complete   <<<<<<<<<<<<<<<<<<<<<<<<<<<<Shutdown of 5.7
2022-01-26T11:06:41.858895Z mysqld_safe mysqld from pid file /nextcloud/mysql/data/ytc1-cloud.dyndns.org.pid ended
2022-01-26T11:53:33.130737Z mysqld_safe Logging to '/nextcloud/mysql/data/ytc1-cloud.dyndns.org.err'.
2022-01-26T11:53:33.216703Z mysqld_safe Starting mysqld daemon with databases from /nextcloud/mysql/data
2022-01-26T11:53:33.807040Z 0 [System] [MY-010116] [Server] /usr/mysql/8.0/bin/mysqld (mysqld 8.0.28) starting as process 22376
2022-01-26T11:53:34.131076Z 1 [System] [MY-011012] [Server] Starting upgrade of data directory.
2022-01-26T11:53:34.131255Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-01-26T11:53:42.145832Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-01-26T11:54:05.382533Z 2 [Warning] [MY-010772] [Server] db.opt file not found for test database. Using default Character set.
2022-01-26T11:54:17.685637Z 2 [System] [MY-011003] [Server] Finished populating Data Dictionary tables with data.
2022-01-26T11:54:33.267006Z mysqld_safe Logging to '/nextcloud/mysql/data/ytc1-cloud.dyndns.org.err'.
2022-01-26T11:54:33.337932Z mysqld_safe Starting mysqld daemon with databases from /nextcloud/mysql/data
2022-01-26T11:54:33.749523Z 0 [Warning] [MY-010918] [Server] 2022-01-26T11:54:33.749541Z 0 [System] [MY-010116] [Server] /usr/mysql/8.0/bin/mysqld (mysqld 8.0.28) starting as process 22697
2022-01-26T11:54:33.783506Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-01-26T11:54:36.294303Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-01-26T11:54:41.942993Z 4 [System] [MY-013381] [Server] Server upgrade from '50700' to '80028' started.
2022-01-26T11:54:43.336463Z 4 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2022-01-26T11:54:43.336671Z 4 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2022-01-26T11:54:43.336786Z 4 [ERROR] [MY-012646] [InnoDB] File ./mysql/#sql-58a9_4.ibd: 'rename' returned OS error 71.
2022-01-26T11:54:43.456072Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement 'ALTER TABLE proxies_priv MODIFY Host char(255) CHARACTER SET ASCII DEFAULT '' NOT NULL, ENGINE=InnoDB; ' failed with error code = 1025, error message = 'Error on rename of './mysql/#sql-58a9_4' to './mysql/proxies_priv' (errno: 168 - Unknown (generic) error from engine)'.
2022-01-26T11:54:43.473322Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2022-01-26T11:54:43.473584Z 0 [ERROR] [MY-010119] [Server] Aborting
---8<

How to repeat:
Current installation mysql-57 (Nextcloud DB)
database/mysql-57 5.7.35-11.4.39.0.1.107.0   i

install MySQL 8 from SFE 
(database/mysql-80 (localhosts12) 8.0.28 0.11.4.39.0.1.107.1

Set the datadir in SMF
Start SMF

Fails on upgrade every time for current DB

When I create a test server, a fresh MySQL DB (5.7) install Nextcloud, then upgrade to 8.0 that works
[28 Jan 2022 14:14] MySQL Verification Team
Hi Mr. Porter,

Thank you for your bug report.

First and first of all, you were supposed to upgrade from the latest 5.7.

However, that is of lesser importance.

What we need to know is whether you have used our Solaris binary from dev.mysql.com. It does not seem to us that it is the case.

Hence, try our binary and then let us know what happened. If you repeat the behaviour with our binary, let us know all the details about the hardware and Solaris that you are using.

We also hope that you have a copy of 5.7 datadir, so that you can try again. Otherwise, you will have to use a backup.

We are waiting on your feedback.
[30 Jan 2022 9:25] Bruce Porter
Thanks for your response.
I note you seem to think that I have not updated from version 5.7.
Current version is 5.7.35 as shown in original bug report, and attempted upgrade was following the procedure to allow 1st run of SMF to perform the upgrade.

I cannot install your version 8.0.28 as you do not supply one for solaris x86. Hence why using SFE version.

The bug issue is the lack of information as to why MySQL cannot upgrade. 
All other testing has been ok.

Ibackup of datadir is via ZFS snapshot, so repeated attempts are doable.
[31 Jan 2022 13:35] MySQL Verification Team
Hi Mr. Porter,

Sorry, but that platform is no longer supported.

You can find a list of the platforms supported on our download pages on dev.mysql.com.

Hence, we can not process your report, since we can not repeat the behaviour. We can repeat the behaviour only on the platforms that we support.

Unsupported.