Bug #100737 Upgrade from 8.16 to 8.21 the installer/upgrade broke server
Submitted: 4 Sep 2020 4:44 Modified: 21 Oct 2020 12:52
Reporter: Mx Dog Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S1 (Critical)
Version:80021 OS:Windows (10 version 2004)
Assigned to: CPU Architecture:Any
Tags: Installer Upgrade Server

[4 Sep 2020 4:44] Mx Dog
Description:
I used the community installer to upgrade from 80016 to 80021. The Installer hangs at Apply Configuration/attempting to start service. Going to the actual service.msc it will not start. The error log shows this :

2020-09-03T09:50:32.135008-04:00 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement '-- Create general_log
CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), user_host MEDIUMTEXT NOT NULL, thread_id BIGINT UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMBLOB NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log";
' failed with error code = 13, error message = 'Can't get stat of '.\mysql\general_log.CSV' (OS errno 2 - No such file or directory)'.
2020-09-03T09:50:32.141559-04:00 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2020-09-03T09:50:32.142494-04:00 0 [ERROR] [MY-010119] [Server] Aborting
2020-09-03T09:50:33.403506-04:00 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.21)  MySQL Community Server - GPL.

as you can see it is crashing on the general_log.csv and is not getting the file or data path from the my.ini file the service starts with i.e. the schema is not being created. 

after working past this the /data/mysql schema is never created in either location %program data%\MySql Server 8.0\data (default) or the location that is in the my.ini which in my case was F:\DataBase\MySql8\Data when the installer starts up the server service. 

   

How to repeat:
I would assume it is repeatable for any server instance not using default file locations and names for logs and my.ini and possibly data file locations.

Or if it does turn out to be a permission problem ....any machine without the proper permissions on the write location or whatever user the installer is using in the server? 

Suggested fix:
Not Really sure.... because no idea why the installer cannot create the files/schema/database.

but... insure that the installer can create schema/database for the current user or in the correct /data folder with the /data folder path from the my.ini having priority? 

The workaround I used to get past this..
1. copied all /Data folder to another location for safety 
1.1 copied MY my.ini file to a safe location
2. uninstalled Mysql8 server 
3. deleted the %program data%\Mysql Server 8.0 folder 
4. deleted the %program files%\Mysql\mysql Server 8.0 folder
5. reinstalled mysql 8.21 using defaults except security used native and my old log paths
6. set up 8.21 minimally  mysqld --initialized-insecure --console
7. copied %program data%\Mysql Server 8.0\data\mysql folder to MY original /data folder ( the general_log schema/database was created in there ) 
8. changed service to point at original my.ini 
  sc config binPath mysql "\"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe\"  --defaults-file=C:\Database\Mysql8\my.ini MySQL"
9 started service
10. logged on and made sure databases and log files where in right location and complete ( they seem to be ) 

now i know if you have a complex database or partitioned database this might break so this is a dangerous way but it worked for me. and since the installer had already written the script to the database i was stuck.
[4 Sep 2020 5:00] Mx Dog
I actually reinstalled the 8.0.16 first then ran through the upgrade from the installer before installing 8.0.21. so i am not totally positive where or when the %program data%/MYSQL Server 8/Data/mysql folder and general_log database was created.
[9 Sep 2020 12:23] MySQL Verification Team
Hello David Marlow,

Thank you for the bug report.
I tried to reproduce your issue on windows 10 with MySQL server 8.0.16 and upgraded to 8.0.21 but I am not seeing any issues at my end. To investigate further this issue at our end, may I kindly request you to provide installation log and server log. Thanks.

Regards,
Ashwini Patil
[10 Oct 2020 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Oct 2020 9:30] Mx Dog
Ashwini, sorry I missed your email for logs ...those are long gone and I am kicking myself for not including them here ..but by the time I reported this they would probably have been worthless anyway with all the different things I tried.
I suspect again ..
1. write permission error.
2. path errors because of non-standard my.ini location and data/log/file paths
3. some hidden installer bug same reasons \ instead of \\ kind of stuff or again non default locations.

if i am the only one that has run into this then ..closing it is probably OK ...I did get my DB back so I am a happy camper ..
[21 Oct 2020 12:52] MySQL Verification Team
Hello David Marlow,

Thank you for getting back to us.
We have tried it on different boxes without any luck. For now I'll close the report as can't repeat but in future if your hit this again then don't hesitate to open the bug.

Regards,
Ashwini Patil