DISM StartComponentCleanup give error 0x800f0806 - The operation could not be completed due to pending operations.

Anonymous
2024-09-24T11:34:56+00:00

I have problem cleaning up the WinSxS folder with DISM on a Windows Server 2016 Standard (it's a physical server, not a VM).

The server have a C-drive that have a total of 149 GB of disk space, and only 20 GB is available.

The WinSxS folder usemore than 80 GB of disk space.

And PendingDeletes folder containing 5,501 files using 10.4 GB of disk, Renames folder containing 23,636 files using 534 MB of disk.

I need to clean this up. Any tips?

I done so far:

dism.exe /online /cleanup-image /AnalyzeComponentStore

Result:

Actual Size of Component Store: 82 GB

Shared with windows: 8.84 GB

Backups and Disabled Features: 56.07 GB

Cache and Temporary Data: 17.16 GB

After reboot I done several commands with several more reboots:

dism.exe /online /cleanup-image /startcomponentcleanup

dism.exe /online /cleanup-image /startcomponentcleanup /resetbase

dism.exe /online /cleanup-image /RestoreHealth /Source:C:\Windows\WinSxS /LimitAccess

I also mounted an Windows 2016 Server ISO and ran the same command again, just pointing to the mounted ISO

But nothing works regarding the DISM command, I keep getting the error of Pending Operations.

I also tried these without them giving any issues or solutions:

Dism.exe /Online /Cleanup-Image /ScanHealth

Dism.exe /Online /Cleanup-Image /CheckHealth

Scannow /sfc

A small part of the DISM log:

2024-09-24 12:45:54, Info DISM DISM.EXE: Succesfully registered commands for the provider: OfflineSetupManager.

2024-09-24 12:45:54, Info DISM DISM.EXE: Attempting to add the commands from provider: Edition Manager

2024-09-24 12:45:54, Info DISM DISM.EXE: Succesfully registered commands for the provider: Edition Manager.

2024-09-24 12:45:54, Info DISM DISM Provider Store: PID=9748 TID=6648 Getting Provider DISM Package Manager - CDISMProviderStore::GetProvider

2024-09-24 12:45:54, Info DISM DISM Provider Store: PID=9748 TID=6648 Provider has previously been initialized. Returning the existing instance. - CDISMProviderStore::Internal_GetProvider

2024-09-24 12:45:54, Info DISM DISM Package Manager: PID=9748 TID=6648 Processing the top level command token(cleanup-image). - CPackageManagerCLIHandler::Private_ValidateCmdLine

2024-09-24 12:45:54, Info DISM DISM Package Manager: PID=9748 TID=6648 Attempting to route to appropriate command handler. - CPackageManagerCLIHandler::ExecuteCmdLine

2024-09-24 12:45:54, Info DISM DISM Package Manager: PID=9748 TID=6648 Routing the command... - CPackageManagerCLIHandler::ExecuteCmdLine

2024-09-24 12:45:54, Info DISM DISM Package Manager: PID=9748 TID=6648 Loaded servicing stack for online use only. - CDISMPackageManager::RefreshInstanceAndLock

2024-09-24 12:45:54, Info DISM DISM Package Manager: PID=9748 TID=6648 CBS session options=0x400100! - CDISMPackageManager::Internal_Finalize

2024-09-24 12:47:10, Info DISM DISM Package Manager: PID=9748 TID=10676 Error in operation: the operation could not be complete due to locked resources. (CBS HRESULT=0x800f0806) - CCbsConUIHandler::Error

2024-09-24 12:47:10, Error DISM DISM Package Manager: PID=9748 TID=6648 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x800f0806)

2024-09-24 12:47:10, Error DISM DISM Package Manager: PID=9748 TID=6648 The operation could not be completed due to pending operations. - GetCbsErrorMsg

2024-09-24 12:47:10, Error DISM DISM Package Manager: PID=9748 TID=6648 Failed processing package changes - CDISMPackageManager::StartComponentCleanupEx(hr:0x800f0806)

2024-09-24 12:47:10, Error DISM DISM Package Manager: PID=9748 TID=6648 The operation could not be completed due to pending operations. - GetCbsErrorMsg

2024-09-24 12:47:10, Error DISM DISM Package Manager: PID=9748 TID=6648 Failed to start component cleanup. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x800f0806)

2024-09-24 12:47:10, Error DISM DISM Package Manager: PID=9748 TID=6648 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x800f0806)

2024-09-24 12:47:10, Info DISM DISM Package Manager: PID=9748 TID=6648 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine

2024-09-24 12:47:10, Info DISM DISM Provider Store: PID=9748 TID=6648 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect

2024-09-24 12:47:10, Info DISM DISM Provider Store: PID=9748 TID=6648 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect

2024-09-24 12:47:10, Info DISM DISM Provider Store: PID=9748 TID=6648 Found the PE Provider. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect

2024-09-24 12:47:10, Info DISM DISM Provider Store: PID=9748 TID=6648 Finalizing the servicing provider(DISM Package Manager) - CDISMProviderStore::Internal_DisconnectProvider

2024-09-24 12:47:10, Info DISM DISM Package Manager: PID=9748 TID=6648 Finalizing CBS core. - CDISMPackageManager::Finalize

2024-09-24 12:47:10, Info DISM DISM Provider Store: PID=9748 TID=6648 Disconnecting Provider: DISM Package Manager - CDISMProviderStore::Internal_DisconnectProvider

2024-09-24 12:47:10, Info DISM DISM Provider Store: PID=9748 TID=6648 Finalizing the servicing provider(MsiManager) - CDISMProviderStore::Internal_DisconnectProvider

Windows for business | Windows Server | Performance | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-09-25T01:42:06+00:00

    Hello,

    Thank you for posting in Microsoft Community forum.

    Based on the description, I understand your question is related to clean Up the WinSxS Folder.

    Firstly it is important that never delete the WinSxS folder, you can instead reduce the size of the WinSxS folder using tools built into Windows.

    As you have already tried cmd commands, try run the StartComponentCleanup task in Task Scheduler to clean up and compress components

    1. If Task Scheduler is not open, start the Task Scheduler. For more information, see Start Task Scheduler.
    2. Expand the console tree and navigate to Task Scheduler Library\Microsoft\Windows\Servicing\StartComponentCleanup.
    3. Under Selected Item, click Run
       schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"
      

    Also, you can use Disk Cleanup to reduce the number of unnecessary files on your drives, which can help your PC run faster. It can delete temporary files and system files, empty the Recycle Bin, and remove a variety of other items that you might no longer need. The option to cleanup updates helps reduce the size of the component store.

    Disk cleanup in Windows - Microsoft Support

    Have a nice day. 

    Best Regards,

    Molly

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-09-26T05:59:40+00:00

    Hello

    Thank you for you answer.

    I know that it's important to never delete any files in the WinSxS folder, so I need to get this done with the right tool.

    I did the Disk Cleanup in 2 rounds, and I managed to clean up about 3 GB. But it did not clean much if anything in the WinSxS folder.

    The task scheduler you mentioned, I have tried to run it manually a few weeks ago and again today, but it seems that it's not doing its job correctly. There is no error on the job. I ran it again today, but no changes to the WinSxS folder.

    Do you have any other tip of what can be done?

    0 comments No comments
  3. Anonymous
    2024-10-01T06:19:26+00:00

    Hello

    Thank you for you answer.

    I know that it's important to never delete any files in the WinSxS folder, so I need to get this done with the right tool.

    I did the Disk Cleanup in 2 rounds, and I managed to clean up about 3 GB. But it did not clean much if anything in the WinSxS folder.

    The task scheduler you mentioned, I have tried to run it manually a few weeks ago and again today, but it seems that it's not doing its job correctly. There is no error on the job. I ran it again today, but no changes to the WinSxS folder.

    Do you have any other tip of what can be done?

    0 comments No comments