|
| 1 | +--- |
| 2 | +title: Troubleshoot Windows Update Error 0x80070002 |
| 3 | +description: Learn how to resolve the Windows Update error 0x80070002, which occurs due to missing or corrupt files or incomplete updates. |
| 4 | +ms.date: 04/08/2025 |
| 5 | +manager: dcscontentpm |
| 6 | +audience: itpro |
| 7 | +ms.topic: troubleshooting |
| 8 | +ms.reviewer: scotro,mwesley |
| 9 | +ms.custom: |
| 10 | +- sap:add_sap |
| 11 | +- pcy:add_pcy |
| 12 | +--- |
| 13 | +# Troubleshoot Windows Update Error 0x80070002 |
| 14 | + |
| 15 | +Encountering the Windows Update error 0x80070002 can be frustrating. This error typically arises due to missing or corrupt files necessary for the update or incomplete previous updates. Understanding the root causes and following the appropriate troubleshooting steps can help resolve this issue effectively. |
| 16 | + |
| 17 | +:::image type="content" source="./media/troubleshoot-windows-update-error-0x80070002/updateerror0x80070002-wusaerror.png" alt-text="Windows Update error 0x80070002 message"::: |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +Before proceeding with the troubleshooting steps, ensure you have backed up your OS disk. This precautionary step is crucial to prevent data loss during the resolution process. |
| 22 | + |
| 23 | +## How to Identify the Issue |
| 24 | + |
| 25 | +### Symptom 1: Security Monthly Rollup Installation Failure |
| 26 | + |
| 27 | +If the Security Monthly Rollup fails to install with error 0x80070002, check the CBS.log located at `C:\Windows\Logs\CBS\CBS.log`. You might find entries indicating missing files or services that failed to start. |
| 28 | + |
| 29 | +```output |
| 30 | +Info CSI 000000fb Begin executing advanced installer phase 50 (0x00000032) index 0 (sequence 0) |
| 31 | +Error CSI 000000fc@2018/9/29:08:45:29.414 (F) Failed in StartService for [30]"clr_optimization_v4.0.30319_32" with error code 2[gle=0x80004005] |
| 32 | +Error CSI 000000fd (F) 80070002 [Warning,Facility=FACILITY_NTWIN32,Code=ERROR_FILE_NOT_FOUND] #17049# from Windows::COM::NgenOnlineServiceTickler(...)[gle=0x80070002] |
| 33 | +``` |
| 34 | + |
| 35 | +Check the directory `C:\Windows\Microsoft.NET\Framework\v4.0.30319` to confirm if it's empty. |
| 36 | + |
| 37 | +:::image type="content" source="./media/troubleshoot-windows-update-error-0x80070002/updateerror0x80070002-fileexplorer.png" alt-text="Empty directory in Windows Explorer"::: |
| 38 | + |
| 39 | +### Symptom 2: Update Installation Failure |
| 40 | + |
| 41 | +If you encounter error 0x80070002 during update installation, review the CBS.log for entries like the following: |
| 42 | + |
| 43 | +```output |
| 44 | +Error CSI 00000e47 (F) STATUS_OBJECT_NAME_NOT_FOUND #13367681# from Windows::Rtl::SystemImplementation::DirectFileSystemProvider::SysCreateFile(flags = (AllowSharingViolation), handle = {provider=NULL, handle=0, name= ("null")}, da = (SYNCHRONIZE|FILE_READ_ATTRIBUTES), oa = @0xa130e9e088->OBJECT_ATTRIBUTES {s:48; rd:NULL; on:[69]"\??\C:\ProgramData\Microsoft\Windows\Start Menu\Programs\System Tools"; a:(OBJ_CASE_INSENSITIVE)}, iosb = @0xa130e9e068, as = (null), fa = 0, sa = (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE), cd = FILE_OPEN, co = (FILE_SYNCHRONOUS_IO_NONALERT|0x00004000), eab = NULL, eal = 0, disp = Invalid) |
| 45 | +``` |
| 46 | + |
| 47 | +Verify the existence of the folder `C:\ProgramData\Microsoft\Windows\Start Menu\Programs\System Tools`. |
| 48 | + |
| 49 | +### Symptom 3: Missing DLLs in C:\Windows\WinSxS |
| 50 | + |
| 51 | +Monthly rollups may fail with error 0x80070002 due to missing DLLs in the Side-by-Side store. Check the WindowsUpdate.log and CBS.log for missing files like `DWrite.dll` and `FntCache.dll`. |
| 52 | + |
| 53 | +```output |
| 54 | +Info CBS Failed to find file: x86_microsoft-windows-directwrite_31bf3856ad364e35_7.1.7601.23545_none_229deeb1ba2a85d3DWrite.dll [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND] |
| 55 | +``` |
| 56 | + |
| 57 | +### Symptom 4: Cumulative Update Rollback |
| 58 | + |
| 59 | +If a cumulative update on Windows Server rolls back after a restart, check the Event Viewer for error 0x80070002 and review the CBS logs for driver update issues. |
| 60 | + |
| 61 | +```output |
| 62 | +Info CBS INSTALL index: 55, phase: 2, result 2, inf: flpydisk.inf |
| 63 | +Info CBS Doqe: Failed installing driver updates [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND] |
| 64 | +``` |
| 65 | + |
| 66 | +### Symptom 5: Windows Upgrade Failure |
| 67 | + |
| 68 | +For Windows upgrade failures with error 0x80070002, examine the Setupact.log for issues related to mounting WIM files. |
| 69 | + |
| 70 | +```output |
| 71 | +Warning SP Failed to get WimMount ImagePath, 0x80070002 |
| 72 | +Error SP CMountWIM::DoExecute: Failed to mount WIM file C:\$WINDOWS.~BT\Sources\SafeOS\winre.wim. Error 0xC1420121[gle=0xc1420121] |
| 73 | +``` |
| 74 | + |
| 75 | +## Root Cause for Windows Update Error 0x80070002 |
| 76 | + |
| 77 | +The error 0x80070002 is primarily caused by missing or corrupt files necessary for the update process. This can occur due to: |
| 78 | + |
| 79 | +- Incomplete previous updates that left the system in an inconsistent state. |
| 80 | +- Missing DLLs or system files in critical directories. |
| 81 | +- Registry entries pointing to non-existent services or files. |
| 82 | + |
| 83 | +## Resolution or Troubleshooting Steps |
| 84 | + |
| 85 | +### Mitigation 1: Registry Key Deletion |
| 86 | + |
| 87 | +1. Navigate to the following registry locations: |
| 88 | + - `HKLM\System\CurrentControlSet\services\clr_optimization_v4.0.30319_32` |
| 89 | + - `HKLM\System\CurrentControlSet\services\clr_optimization_v4.0.30319_64` |
| 90 | + |
| 91 | + :::image type="content" source="./media/troubleshoot-windows-update-error-0x80070002/updateerror0x80070002-registryhklm.png" alt-text="Registry keys for clr_optimization"::: |
| 92 | + |
| 93 | +2. Back up and delete these registry keys. |
| 94 | +3. Attempt to install the update again. |
| 95 | + |
| 96 | +### Mitigation 2: Copy Missing Folders |
| 97 | + |
| 98 | +Copy the folder "System Tools" from a working machine to the affected machine, ensuring all shortcuts are included. |
| 99 | + |
| 100 | +### Mitigation 3: Restore Missing DLLs |
| 101 | + |
| 102 | +1. Identify missing DLLs from the CBS logs. |
| 103 | +2. Source these files from a working server and place them in the correct directories. |
| 104 | + |
| 105 | + **Commands:** |
| 106 | + ```bash |
| 107 | + takeown /f c:\windows\winsxs |
| 108 | + icacls c:\windows\winsxs /grant administrators:F |
| 109 | + cd c:\windows\winsxs |
| 110 | + mkdir x86_microsoft-windows-directwrite_31bf3856ad364e35_7.1.7601.23545_none_c67f532e01cd149d |
| 111 | + ``` |
| 112 | + |
| 113 | +3. Run the following command to check for corruptions: |
| 114 | + ```bash |
| 115 | + DISM.exe /Online /Cleanup-image /Restorehealth |
| 116 | + ``` |
| 117 | + |
| 118 | +4. Download and install the standalone package for the Monthly Rollup from the [Microsoft Update Catalog](https://www.catalog.update.microsoft.com/Home.aspx). |
| 119 | + |
| 120 | +### Mitigation 4: Import Registry Keys |
| 121 | + |
| 122 | +Export and import the following registry keys from a working machine: |
| 123 | + |
| 124 | +```bash |
| 125 | +1. HKLM\System\CurrentControlSet\Services\flpydisk |
| 126 | +2. HKLM\System\CurrentControlSet\Services\sfloppy |
| 127 | +``` |
| 128 | + |
| 129 | +### Mitigation 5: Restore WIMMOUNT.sys |
| 130 | + |
| 131 | +Export `WIMMOUNT.sys` from the registry of a working server and merge it on the affected server. |
| 132 | + |
| 133 | +## Next Steps |
| 134 | + |
| 135 | +After resolving the issue, ensure that your system is up to date with the latest updates and patches. Regularly check for updates to prevent similar issues in the future. |
| 136 | + |
| 137 | +**Partial Use of AI disclaimer** |
| 138 | + |
| 139 | +Certain sections of this document have been generated or enhanced using artificial intelligence (AI) technology. |
0 commit comments