I hope you take backups or have a recovery plan in place before a SQL Server service pack upgrade, if not you might want to reconsider. Initially I wasn’t going to capture the screen shots during this recovery because my focus was to fix the issue but I thought I would just in case others experience the same thing.
I wanted to move from SQL Server 2014 SP1 to SP2, as you can see I had a clear issue.
If you navigate to the following directory location: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\
This is where you will have all the information you need for troubleshooting.
Now is the time to start working through the error logs. The first one I usually go to is the summary file:
It is not that detailed so based on the time-stamp highlighted above I go looking at a detailed one. For this example it is called SQLServer_ERRORLOG_2017-03-31T10.17.57
Look at that message (highlighted). I have to restore or rebuild the master database due to this service pack failure? Well guess what, I don’t have a master database backup and I don’t really want to rebuild the master database.
I try to start the service but it fails. (I was desperate ok!)
Script level upgrade for database ‘master’ failed because upgrade step ‘msdb110_upgrade.sql’ encountered error 5846, 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.
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.
To be honest, rebuilding master would be my last option.
I did the following to bypass upgrade mode ( /T902).
I knew from the error log what script screwed up.
I then connected to the instance and ran the ‘msdb110_upgrade.sql’ which is found in the INSTALL folder.
Msg 5846, Level 16, State 1, Line 78
Common language runtime (CLR) execution is not supported under lightweight pooling. Disable one of two options: “clr enabled” or “lightweight pooling”.
Look at the failure message, who set that then?
I turn these settings off and go through the installer for the service pack again.
Well it worked this time.
Everything feels cleaner and I am much happier – probably because I didn’t have to rebuild the master database oh and I turned those settings off!
OMG, priority boost AND fiber mode? Wow, man, get sp_Blitz running in that environment, stat, heh.
I know right! It was actually the same server that I ran the first responder kit on for the last blog post, I just forgot to turn them off when I started the SP, I still havent fixed everything 😉
Thanks Arun, I came across this on SQL 2016 and used your approach to resolve the issue. Regards. Nav 🙂
Well sir – hope you are well 😉
Thank you so much for this, you saved my day.