Forum Discussion
SQL Server 2019 CU22 (KB5027702) does not install correctly - crashes the server
Attempted to install SQL Server 2019 CU22 (KB5027702).
Installation did not complete and I was unable to restart the database engine any more. Got the following error message: "SQL Server is in script upgrade mode"
I had to uninstall this update, please investigate.
- Seems to come from here
Error: 2714, Severity: 16, State: 6.
2023-08-16 18:08:08.62 spid9s There is already an object named 'TargetServersRole' in the database.
Please follow below link. it is mentioning another object related to Database Mail but it should apply for your case too
https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/install/windows/sql-server-upgrade-failed-error-2714
14 Replies
- For sure the SQL error log has a clue on what part of the upgrade fail. to see it you have to open the ERRORLOG file using Windows Explorer
Another way to troubleshoot it is bay starting the SQL Service using Trace Flag 902 which will skip the execution of the upgrade so service will start but the databases won't be upgraded ( and you will be able to solve the root problem on why the installation failed)
https://techcommunity.microsoft.com/t5/sql-server-support-blog/use-trace-flag-902-tf902-to-bring-up-your-sql-service-in-failed/ba-p/2963393
https://www.sqlservercentral.com/blogs/use-trace-flag-902-to-recover-from-a-cumulative-update-failure- M_RusuCopper Contributor
Tried the same action as VK-DBA: reinstalled the patch, no result, server still in crash mode.
The only solution was to completely uninstall it from Windows Update history.
I can look through the logs of course, but it never happened before, all past SQL Server 2019 patches installed correctly. There was no relevant message about the error as well, just "SQL Server Agent cannot be started"
- Could you share the error log ? for sure there is something that gives a clue about what is going on
- VK_DBACopper Contributor
Javier_Villegas thank you for your reply. I have done exactly what is described in the article, started SQL in bypass update mode with flag T902, but havent figured out was went wrong during patch installation. I reinstalled SQL and tried again and ran into the same problem. I have opened ticket with Microsoft and waiting for resolution.