Skip to content

Est. 2011·Microsoft Partner ID 7033487·Delivery under 3 min·Support 7 days a week

Your vault is empty.

License Error 0x80004005 - 0x20007

0x80004005 – 0x20007: driver installation fails in the SAFE_OS phase

10 min read Updated October 5, 2026 Windows Update & Setup

Recommended fix

Windows 11 Pro Retail license

Original price was: 25,00 €.Current price is: 14,99 €.

Fix It Now

Fix it now

Setup was running offline in the SafeOS phase, installing drivers into the new image, and one of them failed. Microsoft’s own wording for the companion code is blunt about it: an incompatible device driver is present. The fastest route through is to stop setup migrating your drivers at all.

Run setup this way from the mounted media, or list the drivers first to decide what to remove

setup.exe /auto upgrade /migratedrivers none
pnputil /enum-drivers
  1. /migratedrivers takes All or None. With None, setup installs only the drivers that ship in the new image, and your vendor drivers are reinstalled afterwards.
  2. If you would rather remove the culprit than skip them all, run pnputil /enum-drivers and note anything from a storage, graphics, network or peripheral vendor.
  3. Remove a candidate with pnputil /delete-driver oem##.inf /uninstall, using the published name from the enumeration output.
  4. Disconnect every device that is not needed to run the upgrade: docks, card readers, external drives, printers, capture devices.
  5. Repair the component store before retrying if the machine has any history of update failures: DISM /Online /Cleanup-Image /RestoreHealth, then sfc /scannow.

Plan to reinstall graphics, storage and network drivers after an upgrade run with /migratedrivers none, and have them downloaded before you start.

If the upgrade completes you can stop here. If not, the next section explains what SafeOS actually is and why a driver that works today can fail there.

Why it happens

An in-place upgrade runs part of its work outside Windows. The SafeOS phase boots a minimal environment from the media, and in that environment setup applies the new image and installs drivers into it. The machine is not running your Windows at this point, which is the important part: the drivers being installed are being installed cold, into an image, without the software they normally sit alongside.

That is why a driver can work perfectly every day and still fail here. It may depend on a service that is not running, on a filter that is not loaded, or on a registry state that exists only in the installed system. The extend code 0x20007 marks the failure as happening during driver installation in that phase, and the front half of the code says how it failed.

Microsoft publishes three of the four pairs directly. 0x80004005 – 0x20007 is an unspecified error with a driver during the SafeOS phase. 0x80070003 – 0x20007 is a failure during SafeOS phase driver installation, and 0x80070003 on its own is Win32 3, ERROR_PATH_NOT_FOUND. 0x80070490 – 0x20007 is the one with the clearest wording: an incompatible device driver is present.

0x8007001F – 0x20006 is the odd one out. Microsoft publishes 0x8007001F paired with 0x3000D and with 0x4000D, but not with 0x20006. 0x8007001F is Win32 31, ERROR_GEN_FAILURE, a device attached to the system is not functioning, and the extend code decodes from the published tables as phase 2 SafeOS, operation 6 REPLICATE_OC. Since that specific pair is not in Microsoft’s table, treat the decode as a decode rather than as a published meaning.

A third-party driver cannot install into the new image

You have this one if Any of the 0x20007 pairs, on a machine with vendor storage, graphics or peripheral drivers.

  1. Run the upgrade with setup.exe /auto upgrade /migratedrivers none so nothing of yours is carried over.
  2. Let it complete, then reinstall vendor drivers from current downloads.
  3. If you would rather be surgical, use pnputil /enum-drivers to find candidates and pnputil /delete-driver oem##.inf /uninstall to remove them first.

Removing a storage driver on a machine that needs it to see its own disk is the one case where you should skip the driver and use /migratedrivers none instead.

Hardware attached to the machine is the thing that fails

You have this one if 0x8007001F – 0x20006, which decodes to a general failure and a device not functioning.

  1. Disconnect everything that is not the keyboard, mouse and display, including docks and hubs.
  2. Retry the upgrade with the machine as bare as you can make it.
  3. If it succeeds, reattach devices one at a time afterwards to find the one that was at fault.

The component store is damaged, so servicing fails wherever it is asked to work

You have this one if The failure moves around between attempts, and the machine has a history of updates failing too.

  1. Run DISM /Online /Cleanup-Image /ScanHealth and read what it says before repairing.
  2. Run DISM /Online /Cleanup-Image /RestoreHealth, with an explicit /Source if it cannot fetch what it needs.
  3. Follow with sfc /scannow, then retry the upgrade.

Security software is intercepting the offline phase

You have this one if The failure is consistent, the drivers are unremarkable, and the machine runs a third-party endpoint product.

  1. Uninstall the product for the duration of the upgrade. Disabling it leaves its drivers loaded.
  2. Retry the upgrade and let it run through without interruption.
  3. Reinstall the product afterwards from a current installer rather than from the version you removed.

Full reference

The phase and operation codes, and what they buy you

Every one of these codes is a pair. The first half is an ordinary Windows error and the second half says where setup was when it happened. Learning to split them is the single most useful habit for upgrade failures, because it turns a search for the whole string into two much more productive questions: what does this error mean, and what was setup doing.

Extend code Where setup was
0x20007 Driver installation during the SafeOS phase
0x20006 The SafeOS phase, at the operation that replicates optional components
0x20009 Partition analysis and validation
0x3000D The first boot phase, during data migration
0x4000D The second boot phase, during data migration

Driver commands worth knowing

Command What it does
pnputil /enum-drivers Lists every third-party driver package in the driver store with its published name
pnputil /delete-driver <oem#.inf> Removes a driver package from the store
pnputil /delete-driver <oem#.inf> /uninstall Removes the package and uninstalls it from any device using it
setup.exe /auto upgrade /migratedrivers none Runs the upgrade without carrying your drivers into the new build
setup.exe /auto upgrade /migratedrivers all The other value the switch takes, which is the default behaviour

Do not remove a storage controller driver the machine needs to see its own boot disk. If you are unsure whether a driver is load-bearing, use /migratedrivers none instead, which sidesteps the question entirely.

Reading the logs from the offline phase

  • $Windows.~BT\Sources\Panther holds the logs from before the machine restarts into the new build. Search setupact.log for the code and read upwards.
  • setuperr.log in the same folder is the shorter list of errors only, which is often quicker to start with.
  • SetupDiag reads both and matches them against published rules, which turns a log hunt into a named finding when a rule applies.
  • Driver-specific detail appears in setupapi.dev.log once the machine is back in Windows, and it names the INF that failed.

Getting the drivers back afterwards

An upgrade run with /migratedrivers none finishes with whatever drivers the new image ships, which is enough to boot, display and usually network, but not enough to be finished. Reinstall graphics, chipset, storage and network drivers from the machine vendor’s current downloads rather than from an installer saved before the upgrade, since the point of the exercise was to stop carrying old driver packages forward.

Do that before you reconnect docks and peripherals, so that when something misbehaves you know whether it is the device or the driver you have just installed.

When a licence is the actual fix

No licence fixes a driver failure, and any advice to buy one to clear a 0x20007 code is wrong. The commands here cost nothing and they resolve the great majority of these. A licence becomes relevant only when the machine’s driver situation is genuinely unsalvageable and a clean install of a supported build is the pragmatic answer, at which point you need media and an entitlement for the edition you are installing. Arco supplies Windows 11 Pro upgrade licences for that case, and will check whether your current entitlement already covers the rebuild first.

Every code this article covers

Code What it points at Source
0x80004005 - 0x20007 An unspecified error occurred with a driver during the SafeOS phase Microsoft Learn
0x80070003 - 0x20007 A failure during SafeOS phase driver installation. 0x80070003 is Win32 3 ERROR_PATH_NOT_FOUND Microsoft Learn
0x8007001F - 0x20006 Not published as a pair by Microsoft. 0x8007001F is Win32 31 ERROR_GEN_FAILURE and the extend code decodes as SafeOS, replicate optional components not published by the vendor
0x80070490 - 0x20007 An incompatible device driver is present Microsoft Learn

Confirm the fix worked

  1. The machine boots into the new build and winver reports the version you were installing.
  2. Device Manager shows no devices with a warning marker, once you have reinstalled vendor drivers.
  3. pnputil /enum-drivers no longer lists the driver package you removed.
  4. A cumulative update installs cleanly, which confirms servicing is healthy on the new build.

Questions people ask about this

What is the SafeOS phase?

It is the part of the upgrade that runs outside your Windows, in a minimal environment booted from the media. Setup uses it to apply the new image and install drivers into it. Because your Windows is not running, drivers are installed without the services, filters and registry state they normally depend on, which is why one that works every day can still fail there.

Is /migratedrivers none safe?

Yes, and it is the fastest way past this family of failures. The cost is that you finish with only the drivers in the new image, so plan to reinstall graphics, chipset, storage and network drivers afterwards. Download them before you start, because a machine on generic network drivers may not be able to fetch them for you.

How do I know which driver is the problem?

Read setupapi.dev.log after the rollback, which names the INF that failed, and cross-reference it with the pnputil enumeration. If the log is inconclusive, the practical approach is to skip driver migration entirely rather than to guess, because a wrong guess costs another failed upgrade and an hour.

Why does 0x8007001F – 0x20006 not appear in Microsoft’s table?

Because Microsoft publishes 0x8007001F with other extend codes but not with that one. The parts are documented separately, so the pair can be decoded, but a decode is not the same as a published meaning and this article does not pretend otherwise. Treat it as a general device failure during the offline phase and diagnose it by disconnecting hardware.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix 0x87D00692 and 0x87D00664: Configuration Manager update deployments fail License Error 0xC1900200 and 0xC1900201: this PC does not meet Windows 11 requirements Free Fix 0x80244019 and 0x80244022: WSUS returns 404 or 503 to update clients License Error 0x800F0906 in DISM: Windows cannot download the repair source files
← Back to Knowledge Base