Tuesday, January 29, 2019

ConfigMgr upgrade error "Failed to apply update changes 0x87d20b15"

We attempted to upgrade one of our ConfigMgr environments from 1802 to 1810 and it failed out in the wizard on the 'Upgrade ConfigMgr Database' step. Looking at cmupdate.log we found this error.


 Failed to apply update changes 0x87d20b15  
 Error information persisted in the database.  

Going further back we then find this nice error.



 ERROR: Failed to execute SQL Server command: ~ DECLARE @viewname  nvarchar(255) ~ DECLARE newviews INSENSITIVE CURSOR FOR ~  SELECT name FROM sysobjects WHERE type='V' AND name like 'v[_]%' ~ OPEN newviews ~ FETCH NEXT FROM newviews INTO @viewname ~ WHILE (@@FETCH_STATUS = 0) ~ BEGIN ~  EXEC('GRANT SELECT ON ' + @viewname + ' to smsschm_users') ~  FETCH NEXT FROM newviews INTO @viewname ~ END ~ CLOSE newviews ~ DEALLOCATE newviews  


After much investigation, it turns out someone created a custom view for the ConfigMgr database. We backed up these views and deleted them and retried the upgrade. That fixed this issue.

For the rest of the upgrade story it was a loooong weekend and not having a good time. It progressed further but still on the Upgrade ConfigMgr Database step failed out. cmupdate.log showed that we encountered some deadlocks on the database and the upgrade panicked out and retry stayed greyed out after other tasks were performed to reset it. We then chose to do a site recovery to get us back to pre upgrade state (you do manually fire those off before upgrade right?) We then tried again and it froze at another spot past the ConfigMgr database step. sWe also had a "ghost" secondary. It was torn down years ago and now that we are without Secondarys we actually had a site link present still. This prevented us from using the upgrade reset tool that recently came out. We ended up involving Microsoft who got us going with 1810 and fixed these other quirky things also.

-Kevin

7 comments:

  1. Hi Kevin,
    I have the same issue during my SCCM 1810 upgrade.
    I found some custom views too.
    Ho do you perform a backup of views before the delete and eventually the restore of views after upgrades?

    Thanks.

    ReplyDelete
  2. Hi Emmanuel,
    We just used SSMS and did a copy and paste into a text file then recreated them. Nothing high tech.

    ReplyDelete
  3. Hi Kevin,

    Worked fine. upgrade is successfully now.
    Thanks.

    ReplyDelete
  4. How d I know if I have custom views? Where do you find them?

    ReplyDelete
  5. Hi authoringservices.
    Most likely you do not. Its actually not recommended by MS to have them. If you have a very large environment you just might. You can use SSMS to go look. In Object Explorer expand the CM Database. Then expand Views folder.

    ReplyDelete
  6. I got the same error, unable to install hotfix KB4500571 after upgrading to 1902
    Can you guide me how to fix

    ReplyDelete
  7. Do you have custom views? You can follow my previous note to see if you do. In Object Explorer expand the CM Database. Then expand Views folder.

    ReplyDelete