Just another WordPress.com site

SQL services could not start after patching

We recently had issues with the new SQL patching for SQL server 2019 and SQL 2012

In the Errorlog file, you will find some lines like below:

On SQL 2012:

2021-03-21 19:47:04.24 spid5s      Cannot find the user ‘##MS_SSISServerCleanupJobUser##’, because it does not exist or you do not have permission.

2021-03-21 19:47:04.24 spid5s      Error: 912, Severity: 21, State: 2.

2021-03-21 19:47:04.24 spid5s      Script level upgrade for database ‘master’ failed because upgrade step ‘SSIS_hotfix_install.sql’ encountered error 15151, state 1, severity 16. 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.

2021-03-21 19:47:04.24 spid5s      Error: 3417, Severity: 21, State: 3.

On SQL2019:

2021-04-16 09:26:18.84 spid9s      Database ‘master’ is upgrading script ‘ISServer_upgrade.sql’ from level 0 to level 500.

2021-04-16 09:26:18.84 spid9s      Starting execution of ISServer_upgrade.SQL

2021-04-16 09:26:21.21 spid9s      Error: 15151, Severity: 16, State: 1.

2021-04-16 09:26:21.21 spid9s      Cannot find the user ‘ModuleSigner’, because it does not exist or you do not have permission.

2021-04-16 09:26:21.21 spid9s      Error: 912, Severity: 21, State: 2.

2021-04-16 09:26:21.21 spid9s      Script level upgrade for database ‘master’ failed because upgrade step ‘ISServer_upgrade.sql’ encountered error 15151, state 1, severity 16. 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.

2021-04-16 09:26:21.21 spid9s      Error: 3417, Severity: 21, State: 3.

2021-04-16 09:26:21.21 spid9s      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.

Workaround:

NET START MSSQLSERVER /T902

  1. Start SQL services using trace flag 902 as below via command prompt;

2. Run SQLServer Management Studio as an Administrator;

3. Manually create USER or remap user:

3.1Create USER ModuleSigner in SSISDB.

USE [SSISDB]

CREATE USER [ModuleSigner] FOR CERTIFICATE [MS_SQLISSigningCertificate]

GO

3.2 Create USER ‘##MS_SSISServerCleanupJobUser##’ in SSISDB.

USE [SSISDB]

CREATE USER [##MS_SSISServerCleanupJobUser##] FOR login [##MS_SSISServerCleanupJobLogin##]

GO

4. Stop SQL services with trace flag.

5. Restart SQL services regularly.

Leave a comment