Share via

SQL 2019 CU13 upgrade issue: Missing 'sys.sp_MSIsContainedAGSession'

Mantini, Ronald M 6 Reputation points
2021-12-10T17:31:46.343+00:00

Hello, I have 9 separate SQL 2019 instances all on their own stand alone servers, 5 production, 4 Development, 1 of the 9 had this issue. While trying to apply CU 13 (SQLServer2019-KB5005679-x64.exe) the installation crashed and SQL would not start afterwards. Below is the error in the error log.

2021-12-10 08:22:44.35 spid13s Could not find stored procedure 'sys.sp_MSIsContainedAGSession'.
2021-12-10 08:22:44.35 spid13s Error: 912, Severity: 21, State: 2.
2021-12-10 08:22:44.35 spid13s Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 2812, state 62, 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.

Steps I have already taken:
I started SQL from command line (NET START MSSQL$SQL01 /T902), and verified indeed 'sys.sp_MSIsContainedAGSession' does not exist in MSDB. I can see it in all my other instances, so I have the code, however I can not apply a sys schema stored proc to add it to the instance where it is missing. I ran the 'msdb110_upgrade.sql' manually after starting at the command line and confirmed the error.

Any workaround for this? I can't backout the CU because the OS doesn't think its installed, but if I try to re-run it it won't let me because it shows SQL is already upgraded, which it is, the version number is upgraded when I launched from command line.

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

2 answers

Sort by: Most helpful
  1. CathyJi-MSFT 22,431 Reputation points Microsoft External Staff
    2021-12-13T07:05:07.04+00:00

    Hi @Mantini, Ronald M ,

    Did you have the latest backup of MSDB?

    Please try to start SQL server with trace flag 902, restore the latest MSDB backup, then stop SQL Service and start normally (without any trace flag)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Was this answer helpful?


  2. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2021-12-10T22:38:01.873+00:00

    I thought I had seen this before, so I went to Google. I did find https://www.sqlservercentral.com/forums/topic/missing-sys-sp_msiscontainedagsession-causing-failure-in-cu13-update-script, but I don't think was what I had in mind. Nevertheless, that poster was able to resolve the problem by uninstalling and re-installing.

    I don't think this SP is in msdb, but I would expect it to be in the resource database. It could be that the install did not properly replace the resource database, and this instance was on a CU level that did not have an SP. (Something in the back of my mind tells me that this SP was added in a CU after the initial release of SQL 2019.)

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.