Fix it now
0x800F0831 is CBS_E_STORE_CORRUPTION: the component store is corrupt. Microsoft’s mitigation is store repair followed by System File Checker, not hunting for a single missing KB. Install the servicing stack update for your build first, because 0x80242017 in the same log says the stack has to be updated before anything else can install.
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
DISM /Online /Get-Packages /Format:Table
- Read the package table. Anything showing as Install Pending or Staged rather than Installed is unfinished work; reboot fully and let servicing complete it before you try anything else.
- If the machine also reported 0x80242017, install the servicing stack update for your exact build from the Microsoft Update Catalog and reboot before the cumulative update.
- If RestoreHealth cannot reach a source, supply one:
DISM /Online /Cleanup-Image /RestoreHealth /Source:WIM:D:\sources\install.wim:1 /LimitAccess. - Reboot, then reinstall the update that was failing.
Do not remove packages with DISM to tidy up while you are here. Removing the wrong one can leave the machine unbootable, and it is far easier to break the store further than to repair it.
If ScanHealth is clean and the update installs, stop here. If repair does not take, the next section covers what the store is checking and which of these codes is telling you what.
Why it happens
Every update Windows installs is registered as a package, and the component store keeps the manifests and payload that describe what is present. Component-Based Servicing verifies that picture before it applies anything, because an update is expressed as a change against a known state. 0x800F0831 is that verification concluding that the store itself is corrupt, and Microsoft’s published mitigation is store repair: DISM /RestoreHealth, then sfc /scannow.
That is worth stating plainly, because this code is widely described as a missing package in a supersedence chain, with instructions to find a KB number in the log and reinject it. That is not what the code says. Reinjecting a package on a corrupt store sometimes clears one symptom and leaves the underlying condition in place, which is why the next month’s update fails in the same way. Repair the store, then reinstall.
The other codes narrow the diagnosis. 0x80242017 is WU_E_UH_NEW_SERVICING_STACK_REQUIRED: the servicing stack must be updated before this update can be downloaded or installed. That one is a straight instruction, and it is often the whole answer on a machine that has been offline for a long time. 0x8007371B is ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE, meaning one or more required members of the transaction are not present, which is what a half-committed servicing operation looks like from the side-by-side layer.
0x80242013 and 0x800F0805 point at metadata and at the file you handed to servicing. 0x80242013 is WU_E_UH_BADCBSPACKAGEID, an invalid CBS package identifier in the update metadata, so the handler cannot match the update to a package in the store. 0x800F0805 is CBS_E_INVALID_PACKAGE, meaning the file itself is not a valid Windows package. In this article’s own workflow that almost always means the wrong cabinet was picked out of an expanded .msu.
The store is corrupt and repairable in place
You have this one if DISM /Online /Cleanup-Image /ScanHealth reports corruption, and the machine has a route to Windows Update.
- Run
DISM /Online /Cleanup-Image /RestoreHealthand let it finish. - Follow with
sfc /scannow, then reboot. - Reinstall the update that was failing.
- Rescan afterwards to confirm the repair held rather than assuming it did.
The servicing stack has not been updated
You have this one if 0x80242017 appears in the log, or the machine has been offline for months and every cumulative update fails at the same point.
- Find the servicing stack update for your exact build and architecture in the Microsoft Update Catalog.
- Install it on its own and reboot before installing anything else.
- Then install the cumulative update.
- In a managed environment, approve servicing stack updates ahead of the cumulative updates that depend on them rather than in the same batch.
A previous update is stuck in a pending state
You have this one if DISM /Online /Get-Packages shows packages as Install Pending or Staged and there is an outstanding restart.
- Restart fully, twice if necessary, and let servicing finish what it started.
- Recheck the package list and confirm the states have moved to Installed.
- If a package is still stuck, note its name and read CBS.log for what blocked it.
- Only retry the update once nothing is pending.
The file you handed DISM is not a servicing package
You have this one if 0x800F0805 from an Add-Package step, after expanding an .msu by hand.
- Check which file you pointed DISM at. An expanded .msu contains more than the payload cabinet, and metadata cabinets are not valid packages.
- Expand with the documented argument order:
expand C:\temp\update.msu -f:* C:\temp\extract. - Pick the payload cabinet from the extracted folder, not a WSUS scan cabinet or a properties file.
- Add it with
DISM /Online /Add-Package /PackagePath:C:\temp\extract\name.caband read what the command returns rather than only the update result.
On Windows 11 21H2 and later you can add an .msu directly to an online image. On earlier images .msu packages can only be added offline, which is why expanding is needed at all.
Repair does not hold and the same error returns
You have this one if RestoreHealth reports success, the update installs, and the next month’s update fails with the same code.
- Check the disk. Recurring corruption on healthy servicing is usually storage: run
chkdsk C: /scanand read the drive’s own health reporting. - Check whether a security product is quarantining or replacing system files, and add the vendor’s documented servicing exclusions.
- Repair once more from media patched to at least the machine’s level.
- If it still recurs, plan an in-place upgrade. That is where Microsoft’s own guidance for this family of codes ends.
Full reference
Reading the store’s own account of itself
Before you inject or remove anything, look at what state the packages are actually in. This costs nothing and frequently ends the investigation, because a machine with a pending transaction needs a restart rather than a repair.
DISM /Online /Get-Packages /Format:Table
rem narrow the servicing log to the failure
findstr /i /c:"0x800f0831" %windir%\Logs\CBS\CBS.log
Every code in this article, with what it actually says
| Code | Published name | Reading |
|---|---|---|
| 0x800F0831 | CBS_E_STORE_CORRUPTION | The CBS store is corrupted. Mitigation is DISM /RestoreHealth then sfc |
| 0x800F0805 | CBS_E_INVALID_PACKAGE | The package is invalid: the file is not a valid Windows package |
| 0x8007371B | ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE | Decimal 14107. One or more required members of the transaction are not present |
| 0x80242017 | WU_E_UH_NEW_SERVICING_STACK_REQUIRED | The OS servicing stack must be updated before this update is downloaded or installed |
| 0x80242013 | WU_E_UH_BADCBSPACKAGEID | The update metadata contains an invalid CBS package identifier |
Injecting a package, when it is genuinely the right move
Package injection is a narrow tool, not the opening move. It is appropriate when the store is otherwise healthy and one specific update has to go on by hand, most often to install a servicing stack update the machine cannot fetch. The argument order for expand matters: the documented form puts the source first, then -f:, then the destination.
expand C:\temp\windows10.0-kb0000000-x64.msu -f:* C:\temp\extract
DISM /Online /Add-Package /PackagePath:C:\temp\extract\windows10.0-kb0000000-x64.cab
| Command | Documented behaviour |
|---|---|
expand <source>.cab -f:<files> <destination> |
Expands named files from a cabinet. -f: specifies which files, and wildcards are allowed |
DISM /Online /Add-Package /PackagePath: |
Installs a specified .cab or .msu package in the image |
DISM /Online /Get-Packages /Format:Table |
Displays basic information about all packages in the image |
DISM /Online /Cleanup-Image /RestoreHealth |
Scans for component store corruption and repairs it automatically |
DISM /Online /Remove-Package is not a tidying tool. It removes a .cab package from the image, and removing something the running system depends on can leave the machine unable to boot. If a package is in the way, work out why before you remove it.
Where to read what failed
%windir%\Logs\CBS\CBS.logrecords what servicing was doing when it stopped, including the component or package name. Search on the failure time and read backwards.%windir%\Logs\DISM\dism.logrecords what a repair attempted and which source it used.- Update history in Settings gives you the KB number and the code, which is enough to find the right standalone package in the Microsoft Update Catalog.
winvergives the exact build, which is what the catalogue entry has to match. Close enough is not good enough here.
When store repair does not clear it
Microsoft documents an escalation for this family of servicing codes, and it is worth knowing where the ladder ends. If repair from a good source does not clear the corruption, the supported route is an in-place upgrade with media at least as patched as the machine, keeping files and applications. It rebuilds the store rather than patching around it, and on an activated machine it needs no new key. Take a full backup and confirm you hold any encryption recovery keys before you start.
Every code this article covers
| Code | What it points at | Source |
|---|---|---|
0x800F0831 |
CBS_E_STORE_CORRUPTION: the component store is corrupted. Repair it with DISM /RestoreHealth and sfc rather than reinjecting a single package | Microsoft Learn |
0x800F0805 |
CBS_E_INVALID_PACKAGE: the file handed to servicing is not a valid Windows package. Check which cabinet you picked out of the expanded .msu | Microsoft Learn |
0x8007371B |
ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE: one or more required members of the transaction are not present | Microsoft Learn |
0x80242017 |
WU_E_UH_NEW_SERVICING_STACK_REQUIRED: the OS servicing stack must be updated before this update is downloaded or installed | Microsoft Learn |
0x80242013 |
WU_E_UH_BADCBSPACKAGEID: the update metadata contains an invalid CBS package identifier, so the handler cannot match it to a package in the store | Microsoft Learn |
Confirm the fix worked
- Run
DISM /Online /Cleanup-Image /ScanHealthand confirm no corruption is reported. - Run
sfc /scannowand confirm no integrity violations remain. - Run
DISM /Online /Get-Packages /Format:Tableand confirm nothing is left Install Pending or Staged. - Install the update that was failing and confirm it completes.
- Confirm the following month’s cumulative update also installs without intervention.
Questions people ask about this
Is this really not a missing package?
Not according to the code. 0x800F0831 is published as CBS_E_STORE_CORRUPTION, ‘CBS store is corrupted’, and the mitigation Microsoft gives for it is DISM /RestoreHealth followed by SFC. Injecting a package can clear a symptom, but on a corrupt store it usually just moves the failure to the next update.
Does this cost anything to fix?
No. The Microsoft Update Catalog is free, DISM ships with Windows, and nothing here is a licensing problem. If a search result tells you this error means your Windows is not genuine, it has misread it.
How do I find the right KB in a log that size?
Search CBS.log on the failure time first, then read backwards a few hundred lines. Servicing writes the package or component it was working on immediately before it gives up, and the name contains the KB number and the build.
Can I skip the failing update instead?
You can pause or hide it, but the underlying store problem stays where it is and cumulative updates build on each other. Fixing the store once is less work than deferring it every month.
Is an in-place upgrade overkill?
It is heavier than a repair, but it is the documented end of the road for this family of codes. It rebuilds the store, keeps files and applications, and on an activated machine needs no new key. Back up first.
