How To Troubleshoot Windows 10 Installation Failed With Error 0x8007001f-0x20006

Windows 10 0x8007001F 0x20006

In this post, I will show you how to troubleshoot and fix a Windows 10 installation that failed with error 0x8007001F-0x20006, “The installation Failed in the SAFE_OS phase with an error during REPLICATE_OC operation.”

This week, I faced a tricky Windows 10 Upgrade process.

I wanted to upgrade my Windows 10 1703 to Windows 10 1809 version. So, I started the upgrade process, and things went fine till the first reboot, where just after 1% of processing the upgrade, Windows restarted and started to cancel the changes it made to the system!

And just after I log on, I get this message:

0x8007001F-0x20006
The installation Failed in the SAFE_OS phase with an error during REPLICATE_OC operation

Windows 10 0x8007001F 0x20006

If you are just interested in the fix, go to the Solution section.
If you want to learn more about the troubleshooting process, keep reading…

Steps I first tried for troubleshooting:

As I was busy and in a hurry to find a solution quickly, I started searching on the web for the different keywords “Windows 10 Error 0x8007001f-0x20006”, “SAFE_OS”, “REPLICATE_OC”…etc.

The majority of the solutions go through the classic Windows Update/Upgrade troubleshooting;

  • Running the SetupDiag
  • Run “sfc /scannow” command
  • Scan the disk for errors
  • Run “DISM /Online /Cleanup-image /Restorehealth
  • Delete “C:\$WINDOWS.~BT” and “C:\$Windows.~WS” folders.
  • Uninstalling the Antivirus

None of those suggested solutions worked for me.

My Troubleshooting:

First, I had to understand the error code meaning to get a clue on the problem’s nature.

The “0x8007001F – 0x20006” is composed of two parts:

  • Part One: The 0x8007001F code, The “8” digit designates a Win32 Error Code, and the last four digits of this code describe the nature of the problem. The 0x001F means that “A device attached to the system is not functioning”. Check this page for more details on the upgrade error codes.
  • Part two: Referred to as the extended code, contains the installation phase and the operation executed when the problem occurred.

The extended code 0x20006 is interpreted like that:

Setup Phase: 2 = SP_EXECUTION_SAFE_OS

operation: 6 = SP_EXECUTION_OP_REPLICATE_OC

The “result code” is pretty vague. What could be this device attached to the system that is not functioning?

I don’t have any external device attached to my laptop except the Windows 10 Installation USB key.

I need to look at the extended code and try to grab any useful information.

Interpreting the extended code, I can understand that the error happened during the second phase of the setup process.

But before going further, I want to briefly explain the different phases the Windows Setup processes go through;

Understanding Windows 10 Setup phases:

Phase 1: Downlevel

Mainly, the tasks performed during this phase are:

  • System requirement checks: CPU, RAM, Disk space in system reserved partition, other checks (Windows to go, VHD);
  • Disk space checks: Minimum space on OS drive needed;
  • Dynamic Update: Latest fixes to Setup, New drivers from Windows Update, Fixes for the new OS;
  • Full app and device scan;

Phase 2: Windows RE (aka Safe OS)

  • Boot into WindowsPE-based offline environment;
  • Lay down the new OS;
  • Inject drivers into the new system’s driver store;
  • Gather the old OS into Windows.old;

Phase 3: First Boot

  • Apply BCD settings for the new OS;
  • Install drivers;
  • Migrate Apps;
  • Migrate system settings;

Phase 4: Second Boot

  • Migrate user settings;
  • Migrate user data;
  • Start OOBE (Out Of the Box Experience);

Decipher the upgrade error code:

According to the extended code (0x20006), the setup is getting stuck at phase 2 while WinRE is running, trying to replicate optional components!

To get more details on the error, I would look at the “C:\$WINDOWS.~BT\Sources\Panther\SetupAct.log” log file.

My investigation technique is to scroll all the way down to the bottom, and then from there, I will search for the 0x8007001F error code. Here is what I found:

 2019-06-13 20:14:25, Error                 MIG    OC Exception: OC::COCDismAdapter::GetFoundationPackageName: Couldn't find the Foundation package
 2019-06-13 20:14:25, Error                 SP     Could not save OC status. Error: 0x8007001F
 2019-06-13 20:14:25, Info                  SP     SetupPlatform: Global progress: 1, Phase progress: 5
 2019-06-13 20:14:25, Error                 SP     Operation failed: Gather Optional Component status. Error: 0x8007001F[gle=0x000000b7]
 2019-06-13 20:14:25, Info                  SP     Operation can retry, we'll attempt to revert its execution.
 2019-06-13 20:14:25, Info                  SP     Attempt to revert execution for operation 30
 2019-06-13 20:14:25, Error                 SP     COperationQueue::Sort: Could not find an execution phase for 45
 2019-06-13 20:14:25, Error                 SP     Operations can no longer be sorted following an attempt to retry a failed operation.
 2019-06-13 20:14:25, Error                 SP     Operation execution failed: 6. hr = 0x8007001F
 2019-06-13 20:14:25, Error                 SP     ExecuteOperations: Failed execution phase Safe OS. Error: 0x8007001F
 2019-06-13 20:14:25, Error                 SP     CSetupPlatformPrivate::Execute: Execution of operations queue failed, abandoning. Error: 0x8007001F 

At the end of the setupact.log file, I can see lines with error mention and a short description of the error, followed by the 0x8007001F error code explanation.

And just a few lines above, there is this error description: “OC Exception: OC::COCDismAdapter::GetFoundationPackageName: Couldn’t find the Foundation package

From here, I understood that the problem could be related to a package that was not found on my system, during the setup process.

Now, I need to find the package name. So, I scrolled to the top and found this line:

Failed to find a matching version for servicing stack: E:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.15063.410_none_9e914f9d2d85dacb\ [HRESULT = 0x80070490 – ERROR_NOT_FOUND]

It seems that the Windows setup program was expecting to find the amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.15063.410_none_9e914f9d2d85dacb package in E:\Windows\WinSxS\ path and this package was missing!

Not that “E:” drive letter represents my Windows 10 drive (i.e. C: drive). Because, as the setup is running in Windows-RE context (The safe OS); this one gets the “C:” letter for its OS drive, and the installed OS gets the “E:” drive letter.

Now that I know I’m missing a package on my system, I tried to fix that by running a “DISM /Online /Cleanup-Image /RestoreHealth“, command without success!

Then I downloaded a Windows 10 1703 ISO image and created an installation USB key, then I tried the following command “DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:H:\sources\install.wim:1 /LimitAccess

Where “H:” is the USB drive letter.

After running to a certain percentage, the command ends up with the following error: “Source Files Could not be found “. Yet I did specify the source image!

From there, I concluded that my Windows installation was broken, and I needed to fix it, hopefully, this will also solve my upgrade problem.

The Solution:

  1. Download the same Windows 10 edition with the same or newer build as the installed one. You can use the tool Rufus to download a Windows 10 ISO image. The advantage of Rufus is that it allows you to download the ISO image and burn it on a USB key.
  2. Create the installation USB key using Rufus. If you don’t have a USB key, you can mount the ISO image directly on your session.
  3. Run the Setup.exe to start a Windows 10 in-place upgrade.

Conclusion:

If you are facing the same Windows 10 upgrade error, then first try the above fixes. And if none of them works, then do an in-place upgrade using the same Windows 10 version.

This fix has worked for me to solve my Windows 10 error 8007001F-20006 code, but I was facing a new error “0xC1900101 – 0x4001E“.
Read this post for a step-by-step fix for Windows 10 installation failed with 0xC1900101 – 0x4001E error code

Please leave a comment below and share this article on your preferred social media platform, so that other persons can benefit.

Do You Need Assistance?

Check out My Gig:

Share this article

Leave a Reply