Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Windows Update error 0x80070002 typically occurs because of 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.
Prerequisites
Before proceeding with the troubleshooting steps, ensure you have backed up your operating system (OS) disk. This precautionary step is crucial to prevent data loss during the resolution process.
Root cause
The error 0x80070002 is primarily caused by missing or corrupt files that are necessary for the update process. This issue can occur due to:
- Incomplete previous updates that left the system in an inconsistent state.
- Missing DLLs or system files in critical directories.
- Registry entries pointing to nonexistent services or files.
CBS logs
When troubleshooting Windows Update issues, CBS logs are helpful for identifying the root cause.
The CBS log is located at C:\Windows\Logs\CBS\CBS.log
. The log can roll over from CBS.log to CBSpersisttXXXXXXXXXXXXX.log or CBSpersisttXXXXXXXXXXXXX.cab within the same folder.
Symptom 1: Security monthly rollup installation failure
If the Security Monthly Rollup fails to install with error 0x80070002, check the CBS logs. You might find entries indicating missing files or services that failed to start.
Info CSI 000000fb Begin executing advanced installer phase 50 (0x00000032) index 0 (sequence 0)
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]
Error CSI 000000fd (F) 80070002 [Warning,Facility=FACILITY_NTWIN32,Code=ERROR_FILE_NOT_FOUND] #17049# from Windows::COM::NgenOnlineServiceTickler(...)[gle=0x80070002]
Check the directory C:\Windows\Microsoft.NET\Framework\v4.0.30319
to confirm if it's empty.
Resolution: Registry key deletion
Important
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For protection, back up the registry before you modify it so that you can restore it if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
Navigate to the following registry locations:
HKLM\System\CurrentControlSet\services\clr_optimization_v4.0.30319_32
HKLM\System\CurrentControlSet\services\clr_optimization_v4.0.30319_64
Back up and delete these registry keys.
Attempt to install the update again.
Symptom 2: Update installation failure
If you encounter error 0x80070002 during update installation, review the CBS logs for entries like the following:
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)
Verify the existence of the folder C:\ProgramData\Microsoft\Windows\Start Menu\Programs\System Tools
.
Resolution: Copy missing folders
Copy the System Tools folder from a working machine to the affected machine, ensuring all shortcuts are included.
Symptom 3: Missing DLLs in C:\Windows\WinSxS
Monthly rollups might fail with error 0x80070002 due to missing DLLs in the Side-by-Side store. Check the WindowsUpdate.log and CBS logs for missing files like DWrite.dll
.
Info CBS Failed to find file: x86_microsoft-windows-directwrite_31bf3856ad364e35_7.1.7601.23545_none_229deeb1ba2a85d3DWrite.dll [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
Resolution: Restore missing DLLs
Identify missing DLLs from the CBS logs.
Source these files from a working server and place them in the correct directories. To do so, run the following commands:
takeown /f c:\windows\winsxs icacls c:\windows\winsxs /grant administrators:F cd c:\windows\winsxs
Run the
mkdir
command to create a folder for the missing DLL file, and then copy the missing files to the folder.For example, assume that the file x86_microsoft-windows-directwrite_31bf3856ad364e35_7.1.7601.23545_none_229deeb1ba2a85d3DWrite.dll is missing. You can copy the file from a working server to
c:\windows\temp\dwrite.dll
, and then, run the following command:mkdir x86_microsoft-windows-directwrite_31bf3856ad364e35_7.1.7601.23545_none_c67f532e01cd149d copy c:\windows\temp\dwrite.dll c:\windows\winsxs\x86_microsoft-windows-directwrite_31bf3856ad364e35_7.1.7601.23545_none_c67f532e01cd149d
Run the following command to check for corruptions:
DISM.exe /Online /Cleanup-image /Restorehealth
Download and install the standalone package for the Monthly Rollup from the Microsoft Update Catalog.
Symptom 4: Cumulative update rollback
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.
Here's a sample of the event log:
Log Name: System
Source: Microsoft-Windows-WindowsUpdateClient
Date: DD/MM/yyyy hh:ss:ff
Event ID: 20
Task Category: Windows Update Agent
Level: Error
Keywords: Installation,Installation
User: SYSTEM
Computer: <ComputerName>
Description:
Installation Failure: Windows failed to install the following update with error 0x80070002: Security Update for Windows (KB4586793).
The failure is caused by an issue during update drivers operation. For example, the following entries in the CBS logs indicates the flpydisk.inf
driver is the cause:
Info CBS INSTALL index: 55, phase: 2, result 2, inf: flpydisk.inf
Info CBS Doqe: Failed installing driver updates [HRESULT = 0x80070002 - ERROR_FILE_NOT_FOUND]
Resolution: Import registry keys
To fix the issue, you need to export the registry keys for the driver on a working computer, and then import them on the computer with the issue.
The resolution depends on what is missing. For example, to fix the issue with flpydisk.inf
, which is listed as an example in the symptom section, export and import the following two registry keys.
HKLM\System\CurrentControlSet\Services\flpydisk
HKLM\System\CurrentControlSet\Services\sfloppy
Symptom 5: Windows upgrade failure
For Windows upgrade failures with error 0x80070002, examine the Setupact.log file for issues related to mounting WIM files.
Warning SP Failed to get WimMount ImagePath, 0x80070002
Error SP CMountWIM::DoExecute: Failed to mount WIM file C:\$WINDOWS.~BT\Sources\SafeOS\winre.wim. Error 0xC1420121[gle=0xc1420121]
Resolution: Restore WIMMOUNT.sys
Export WIMMOUNT.sys from registry: HKLM\System\CCS\Services\Wimmount.sys
from the working server and merge it on the affected server. Then, merge them on the affected server.
Next steps
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.