Troubleshoot Windows 10, version 2004 Upgrade using SetupDiag

Microsoft is continuously working towards improving Window 10 upgrade experience for administrators as well as end users. There are many tools available for IT professionals which they can leverage to implement Windows 10 feature updates:
  • Windows Update (stand-alone)
  • Windows Update for Business
  • Windows Server Update Services (WSUS)
  • Microsoft Endpoint Configuration Manager
Now, with all this, in real world Windows 10 upgrades cannot complete without having to come across certain roadblocks and issues.Whenever an upgrade fails, administrators need to know the cause and to know the cause administrators have to go through a number of logs depending upon at which stage upgrade has failed.I am sure you would agree that going through these many logs to isolate the cause is a tedious task and even Microsoft understands that. Therefore, Microsoft has introduced a tool call SetupDiag to help administrator troubleshooting upgrade failures.

 

SetupDiag

Microsoft released SetupDiag in March 2018 as a standalone diagnostics tool available to be downloaded from download center.  Please refer to this article to understand use cases and how to use this tool.
 
 
SetupDiag searches and analyzes all the windows setup logs based on predefined rules and helps in identifying the root cause of an upgrade failure. Over last few years Microsoft has introduced many improvements. Please refer to this release notes for further details.
 
 

 SetupDiag – Windows 10, Version 2004 and later

Starting Windows 10, version 2004, SetupDiag is included in Windows Setup. SetupDiag is extracted to %SystemDrive%$Windows.~bt\Sources\ directory along with other Windows setup files.  SetupDiag searches logs files from following location:
 
  • %SystemDrive%\$Windows.~bt\sources\panther
  • %SystemDrive%\Windows\Panther
  • %SystemDrive%\Windows\Panther\NewOS
  • %SystemDrive%\$Windows.~bt\sources\rollback
 
These location are hardcoded in SetupDiag configuration file SetupDiag.exe.config which is also stored in the same location as SetupDiag.exe i.e. %SystemDrive%$Windows.~bt\Sources\ 
In event of Upgrade failure SetupDiag.exe is triggered automatically with following parameter and saves the result to SetupDiagResults.xml in directory %WinDir%\Logs\SetupDiag\
  • /Scenario:Upgrade
  • /ZipLogs:False
  • /Format:xml
  • /Output:%windir%\logs\SetupDiag\SetupDiagResults.xml
  • /RegPath:HKEY_LOCAL_MACHINE\SYSTEM\Setup\SetupDiag\Results
Here is how SetupDiag.exe execution is logged in Setupact.log file
Here is how SetupDiagResults.xml looked like in one of troubleshooting session
SetupDiagResults.xml provides summery of what went wrong, according to this result error logged at 2020-06-17 21:24:27 caused upgrade failure.
<LogErrorLine>2020-06-17 21:24:27, Error   SP     Operation failed: Update Boot Code. Error:0x80004005[gle=0x000000b7]</LogErrorLine>
 
Taking hint from here, I was curious to understand what went wrong specially at 2020-06-17 21:24:27 and taken another look into Setupact.log file.
2020-06-17 21:24:27, Error      [0x064199] IBSLIB SetCheckpoint(WinPEBootFilesRestoreCheckpoint): threw exception.: Win32Exception: \\?\E:\EFI\Microsoft\Boot\es-MX\bootmgr.efi.mui dir copy to \\?\C:\$WINDOWS.~BT\Sources\Rollback\EFI\Microsoft\Boot\es-MX\bootmgr.efi.mui: Data error (cyclic redundancy check). [0x80070017] void __cdecl UnBCL::Directory::Copy(const class UnBCL::String *,const class UnBCL::String *,int,struct UnBCL::Directory::ICopyDelegate *)
void __cdecl UnBCL::Directory::Copy(const class UnBCL::String *,const class UnBCL::String *,int,struct UnBCL::Directory::ICopyDelegate *)[gle=0x00000012]
2020-06-17 21:24:27, Error      [0x06418a] IBSLIB RollbackSetCheckpoint(WinPEBootFilesRestoreCheckpoint): threw exception.: Win32Exception: \\?\E:\EFI\Microsoft\Boot\es-MX\bootmgr.efi.mui dir copy to \\?\C:\$WINDOWS.~BT\Sources\Rollback\EFI\Microsoft\Boot\es-MX\bootmgr.efi.mui: Data error (cyclic redundancy check). [0x80070017] void __cdecl OSRollbackService::CCheckpointImpressario::SetCheckpoint(const unsigned short *,struct OSRollbackService::ICheckpointParameters *)
void __cdecl UnBCL::Directory::Copy(const class UnBCL::String *,const class UnBCL::String *,int,struct UnBCL::Directory::ICopyDelegate *)
void __cdecl UnBCL::Directory::Copy(const class UnBCL::String *,const class UnBCL::String *,int,struct UnBCL::Directory::ICopyDelegate *)[gle=0x00000012]
2020-06-17 21:24:27, Error      [0x06414e] IBSLIB RollbackSetCheckpoint(WinPEBootFilesRestoreCheckpoint) failed. Disabling Rollback.[gle=0x00000012]
2020-06-17 21:24:27, Error                 SP     Error setting OS Switch Rollback checkpoint[gle=0x00000012]
2020-06-17 21:24:27, Error                 SP     Operation failed: Update Boot Code. Error: 0x80004005[gle=0x000000b7]
2020-06-17 21:24:27, Info                  MOUPG  Finalize: Registering Setup Platform error: [0x80004005]
2020-06-17 21:24:27, Error                 SP     ExecuteOperations: Failed execution phase Finalize. Error: 0x80004005
2020-06-17 21:24:27, Info                  MOUPG  MoSetupPlatform: SetupPlatform::INewSystem::Finalize returned: [0x4]
2020-06-17 21:24:27, Error                 MOUPG  MoSetupPlatform: Finalize reported failure!
2020-06-17 21:24:27, Error                 MOUPG  MoSetupPlatform: Using action error code: [0x80004005]
2020-06-17 21:24:27, Error                 MOUPG  CDlpActionFinalize::ExecuteSetupPlatformFinalize(1120): Result = 0x80004005
2020-06-17 21:24:27, Error                 MOUPG  CDlpActionFinalize::ExecuteRoutine(510): Result = 0x80004005
Setupact.log says that due to “Data error (cyclic redundancy check)” copying boot configuration failed. cyclic redundancy check normally occurs due to damaged disks or disk having bad sectors. To confirm the same, I ran BIOS onboard diagnostics on disk which resulted in failure. It was confirmed disk has some issue. In this case replacing disk was the solution.

Conclusion

In this article describes how SetupDiag works on Windows 10 upgrade to version 2004. However, its also essential to note that SetupDiag is powerful and which can be directly on computer where upgrade has failed, also there is an option to run this tool to analyze logs collected from another computer. Which means this tool can be executed manually as well with additional parameters and advanced options, depending on the requirement. For example, /Verbose to produce more detailed output log file.
I hope this post has been helpful for you. Please feel free to reach out if you have any further questions/comments/feedback.
 
Thank you.
Thanks for Sharing :)

Leave a Reply