Installing service pack / cumulative update on SQL Server 2016 / 2017 breaks database engine
This only happens on Windows 10, when the setting "Beta: Use Unicode UTF-8 for worldwide language support" in Region Settings is checked.
SQL Server update fails and Database engine cannot be started normally (it tries to update master db when it starts and because it fails, the service is shut down. Database engine can only be started using the T902 flag, i.e. ignoring updates when starting).
The messages from the error log are quite misleading, starting from the outermost:
"Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online."
And then the following "details":
"Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 200, state 7, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion."
"The code page 65001 is not supported by the server."
This happens actually when executing the following update script:
I lost two days installing, uninstalling and then reinstalling SQL Server 2016 / 2017 Developer edition. Only the RTM releases installed OK, but trying to update using either SP1 / SP2 or cumulative update, the Database engine was left in non-working state.
Comparing the OS settings with another colleague's Windows 10, who didn't have problems with SQL Server updates, it occurred that the only "system" difference was the above mentioned option: "Beta: Use Unicode UTF-8 for worldwide language support" - it was not selected.
Once clearing the option "Beta: Use Unicode UTF-8 for worldwide language support" on my machine and restarting, the Database engine managed to update itself successfully.
It would be nice for the installer to check for this condition and provide some meaningful way to warn the user about the implications of having the option "Beta: Use Unicode UTF-8 for worldwide language support" selected.
Attached is the error log (hostname and user database names are censored).
Toby Henderson commented
Still and issue with the latest SQL Server 2016 update 2021/01/12 13.0.5865.1
where is Microsoft ?! Mate you save my day ..
Christopher Wallin commented
Thanks a lot, just wasted a half a day at a customer for this. I can also confirm that this must be a Dell thing.
Adam Fisher commented
I was starting to lose count of how many times we'd attempted to install SQL 2016 Express with this error message on a New Windows 10 Dell laptop.
I think it was 4 installs with 2 sets of installer files over 2-3 days.
Restarting the computer after disabling the 'Unicode TUF-8 Beta' setting and it magically works.
What a bizarre error.
Thanks for posting your findings here for others to find.
Thank you very much! I cannot believe this was the fix!
Joris Visser commented
Thank you very much this saved us a lot of time debugging.
This is apparently a thing Dell does with laptops since March 2019.
[Deleted User] commented
Absolutely correct. It did the job for me. Thank you very much
Thank You !! Lost one hour of life
...and here's the tricky part... Why the **** was this enabled in the first place? Brand new Dell computer and I have checked all my other custom and HP computers and none of them have this enabled. Must be a Dell thing...
Thanks a lot!
Thanks you bro , u save my 2 days!
Thank you! It solved my problem.
Regards from Colombia
Thank you very much! It's save my time to resolved this error.
Thank you so much ! After 2 days of troobleshooting, I find your Tip and it works like a charm !
Regards from France ;)
Thank you so much. I spend more then 3 days, installing and uninstalling more then 10 times the same sh__.
You saved me.
Thank you again. :)
Thank you so much , you made my day. After endless install and uninstall tries , this was the solution.
God bless you ,
regards from Austria
Thanks! That saved my day!
Omg I lost a day of reinstalling because of this option. Thank you!!!
/t902 saved me!
Hanns Schmidt-Theissen commented
It's hm??, what should I say. I switched back to SQL development after some years of only mobile and desktop development and installed the SLQ server developer edition. In former times, when MS was more proprietary such things never happened.
Very meaningful information. Thank you