How to repair SCCM Offline Servicing: Error Failed to apply updates with Schedule Updates
Since SCCM 2012 there is the Schedule Updates option that allows us to update a reference image with KBs that we have previously synchronized in Configuration Manager. But sometimes we may fail to apply an update and because of this fails to disassemble the image.
This will prevent us from continuing to use the Schedule Updates option until we manually remove the image from the Windows Server installed on the Primary Server. Therefore, in this article we are going to see how to fix the Error Failed to apply updates in SCCM.
TL;DR
Error SCCM Offline Servicing
This post is a guide on how to repair SCCM’s Offline Servicing feature so that you can continue injecting updates into images after the “Failed to apply one or more updates” error.
To determine if this is your problem, you can read the OfflineServicingMgr.log. This log will be in the Logs folder within the System Center Configuration Manager installation on your Site Server (Primary Server). The error should look something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Image info: Package id ABC00001, Size 4821466 KB, Image path '\\contoso.com\sccm\images\Windows_10_1803.wim', Type: 'OS Image' $<SMS_OFFLINE_SERVICING_MANAGER> Deleting file \\?\D:\ConfigMgr_OfflineImageServicing\ABC00001\ImageMountDir\bootmgr, FAILED, Win32 Error = 5 $<SMS_OFFLINE_SERVICING_MANAGER> Failed to remove previously existing staging folder D:\ConfigMgr_OfflineImageServicing\ABC00001, GLE = 5 $<SMS_OFFLINE_SERVICING_MANAGER> Initialization of schedule processing failed $<SMS_OFFLINE_SERVICING_MANAGER> Processing completed for Schedule with ID 16777255 $<SMS_OFFLINE_SERVICING_MANAGER> STATMSG: ID=7910 SEV=E LEV=M SOURCE="SMS Server" COMP="SMS_OFFLINE_SERVICING_MANAGER" SYS=MyServer.Contoso.com SITE=ABC PID=4176 TID=21720 $<SMS_OFFLINE_SERVICING_MANAGER> Deleting file \\?\D:\ConfigMgr_OfflineImageServicing\ABC00001\ImageMountDir\bootmgr, FAILED, Win32 Error = 5 $<SMS_OFFLINE_SERVICING_MANAGER> Failed to remove the staging folder D:\ConfigMgr_OfflineImageServicing, GLE = 5 $<SMS_OFFLINE_SERVICING_MANAGER> Schedule processing thread stopped~ $<SMS_OFFLINE_SERVICING_MANAGER> Closing the thread handle. $<SMS_OFFLINE_SERVICING_MANAGER> Checking if there are schedule(s) which need to be run at this time. $<SMS_OFFLINE_SERVICING_MANAGER> This Schedule with ID 16777222 does not have a next run time $<SMS_OFFLINE_SERVICING_MANAGER> No more schedules are found to be run at this time or in the future. $<SMS_OFFLINE_SERVICING_MANAGER> Will sleep till a new schedule is created. $<SMS_OFFLINE_SERVICING_MANAGER> No schedule exists which needs to be run anytime in future. $<SMS_OFFLINE_SERVICING_MANAGER> Offline Servicing Manager thread is exiting.~ $<SMS_OFFLINE_SERVICING_MANAGER> |
Fix SCCM Offline Servicing error
As you can see, the DISM process is not able to disassemble the previous image to which we tried to inject the KBs (possibly because the installation failed). To resolve this issue, we will need to open a CMD with administrator permissions:
And run the following command: dism.exe /cleanup-wim
This command will look for all images that are on all Windows Server partitions (so you don’t need to switch partitions from the CMD).
Then we can see the images mounted with the command: dism.exe /get-MountedWiminfo
And unmount the images with the command: dism.exe /unmount-Wim /MountDir:<mountDir> /commit</mountDir>
Optionally, we can check the folder ConfigMgr_OfflineImageServicing where the image was mounted to make sure it is no longer locked and we can delete it. If you don’t, the next Schedule Updates process will do it automatically.
Check the repaired SCCM Offline Servicing log
Now we will need to re-launch the Schedule Updates on the image and follow the OfflineServicingMgr log.log to verify that you can already mount the new image and apply the updates correctly to the reference image:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | Completed processing image package ABC00001. Status = Success $<SMS_OFFLINE_SERVICING_MANAGER> STATMSG: ID=7904 SEV=I LEV=M SOURCE="SMS Server" COMP="SMS_OFFLINE_SERVICING_MANAGER" SYS=MyServer.Contoso.com SITE=ABC PID=4176 TID=21968 $<SMS_OFFLINE_SERVICING_MANAGER> Create backup copy for image ABC00001 $<SMS_OFFLINE_SERVICING_MANAGER> copying image file '\\contoso.com\sccm\images\Windows_10_1803.wim' to '\\contoso.com\sccm\images\Windows_10_1803.wim.bak' ... $<SMS_OFFLINE_SERVICING_MANAGER> Copy image ( ID ABC00001, size 4821 MB ) $<SMS_OFFLINE_SERVICING_MANAGER> copying file from 'D:\ConfigMgr_OfflineImageServicing\ABC00001\Windows_10_1803.wim' $<SMS_OFFLINE_SERVICING_MANAGER> to '\\contoso.com\sccm\images\Windows_10_1803.wim' .... $<SMS_OFFLINE_SERVICING_MANAGER> Copying (25% complete)... $<SMS_OFFLINE_SERVICING_MANAGER> Copying (50% complete)... $<SMS_OFFLINE_SERVICING_MANAGER> Copying (75% complete)... $<SMS_OFFLINE_SERVICING_MANAGER> Copying (100% complete)... $<SMS_OFFLINE_SERVICING_MANAGER> Deleted the backed up copy of image ''. $<SMS_OFFLINE_SERVICING_MANAGER> Successfully requested image ABC00001 to be updated from its source.~ $<SMS_OFFLINE_SERVICING_MANAGER> STATMSG: ID=7905 SEV=I LEV=M SOURCE="SMS Server" COMP="SMS_OFFLINE_SERVICING_MANAGER" SYS=MyServer.Contoso.com SITE=ABC PID=4176 TID=21968 $<SMS_OFFLINE_SERVICING_MANAGER> Updated history for image package ABC00001 in the database $<SMS_OFFLINE_SERVICING_MANAGER>< Schedule processing succeeded $<SMS_OFFLINE_SERVICING_MANAGER> Processing completed for Schedule with ID 16777256 $<SMS_OFFLINE_SERVICING_MANAGER> STATMSG: ID=7901 SEV=I LEV=M SOURCE="SMS Server" COMP="SMS_OFFLINE_SERVICING_MANAGER" SYS=MyServer.Contoso.com SITE=ABC PID=4176 TID=21968 $<SMS_OFFLINE_SERVICING_MANAGER> Schedule processing thread stopped~ $<SMS_OFFLINE_SERVICING_MANAGER> Closing the thread handle. $<SMS_OFFLINE_SERVICING_MANAGER> Checking if there are schedule(s) which need to be run at this time. $<SMS_OFFLINE_SERVICING_MANAGER> This Schedule with ID 16777222 does not have a next run time $<SMS_OFFLINE_SERVICING_MANAGER> No more schedules are found to be run at this time or in the future. $<SMS_OFFLINE_SERVICING_MANAGER> Will sleep till a new schedule is created. $<SMS_OFFLINE_SERVICING_MANAGER> No schedule exists which needs to be run anytime in future. $<SMS_OFFLINE_SERVICING_MANAGER> Offline Servicing Manager thread is exiting.~ $<SMS_OFFLINE_SERVICING_MANAGER> |