question

shockwaveriderz avatar image
1 Vote"
shockwaveriderz asked lewisinkirkland-1987 edited

The source files Not found running DISM /Restorehealth

I run the following once a week before I do a system image backup:

Sfc /scannow
Dism /Online /Cleanup-Image /CheckHealth
Dism /Online /Cleanup-Image /ScanHealth
Dism /Online /Cleanup-Image /RestoreHealth


The 1st 3 commands complete successfully.

On the 4th and last command I have started to get The sources files could not be found 0x800f081f.

The relevant entries from the DISM.log file are below:


2020-11-27 22:29:53, Info DISM DISM Package Manager: PID=8500 TID=8796 Error in operation: source for package or file not found, ResolveSource() unsuccessful. (CBS HRESULT=0x800f081f) - CCbsConUIHandler::Error
2020-11-27 22:29:53, Error DISM DISM Package Manager: PID=8500 TID=17644 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x800f081f)
2020-11-27 22:29:53, Error DISM DISM Package Manager: PID=8500 TID=17644 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
2020-11-27 22:29:53, Error DISM DISM Package Manager: PID=8500 TID=17644 Failed processing package changes with session option CbsSessionOptionRepairStoreCorruption - CDISMPackageManager::RestoreHealth(hr:0x800f081f)
2020-11-27 22:29:53, Error DISM DISM Package Manager: PID=8500 TID=17644 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
2020-11-27 22:30:08, Error DISM DISM Package Manager: PID=8500 TID=17644 Failed to restore the image health. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x800f081f)
2020-11-27 22:30:08, Error DISM DISM Package Manager: PID=8500 TID=17644 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x800f081f)



Questions that I have:

where is the .esd/.wim image. ie the sources files , located on my C: disk when this command was running successfully previously without throwing this error?

Why would the dism /restorehealth command run successfully for literally 18 months and then now start saying it can't find the source files?

when you run a dism /restorehealth command or its /Checkhealth or /Scanhealth what files are they comparing against? and where are they located on disk?

Are there any DISM experts here that can answer these questions? Perhaps give me a play by play how DISM is comparing files against files in the esd or wim image on disk?

Running win 10 pro 1909 18363.1110

TIA

windows-10-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoyQiao-MSFT avatar image
0 Votes"
JoyQiao-MSFT answered JoyQiao-MSFT edited

Hi,

The parameter CheckHealth is used to check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired. But this command doesn’t scan the files or fix anything, it only reports if there are any corruptions marked already in the registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing, to check Unserviceable equals to 1 or 0. So CheckHealth returns result very quickly.

The ScanHealth command-line, on the other hand, doesn’t rely on the previously marked data. It would rather scan each file in the C:\Windows\WinSxS directory and sub-directories, verify their hashes. It then reports if the component store is corrupted or healthy. If the ScanHealth command-line finds the component store is healthy, it removes the corrupt and unserviceable values in the registry automatically, thereby marking the component store as healthy.

RestoreHealth parameter uses Windows Update to provide the files that are required to fix corruptions. But if your Windows update component file is corrupted, it will return repair file failure or need to specify location or resource for restore health.

The default measure it repair is that download needed files from Windows update, but we could change it through Group Policy settings like below:
Click Computer Configuration, click Administrative Templates, click System, and then double-click the Specify settings for optional component installation and component repair setting.
Or we could use command line below to limit source to Winsxs component store.
DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:\Windows\WinSxS /LimitAccess

If you are using a computer without network, it will also repair use WinSxS components store files by default.

If it is not able to repair system, we should download Windows 10 ISO image. But it not limit to a same system build image like yours 10.0.18363.1110, as long as it's Windows 10 ISO, it could be used for repair.

As I noticed you are not running as the latest system version, I would recommend to update system at first, then specify source for DISM.

If you have any other issue or confuse, please reply here.

Bests,

============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much for that explanation. I now know what the /checkhealth,/scanhealth and /restorehealth commands do.
Over the past few days I have learned that I can do a /restore health /source command and point it to an esd, wim and now WinSxs....

0 Votes 0 ·

Grad to hear those informations are useful for you. If you have any confuse or issue when specify a source, please contact us.

If you are not sure details steps about specify a source, we could refer to "Fix problems with DISM using WIM image" part in link: How to use DISM command tool to repair Windows 10 image

Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

Bests,

============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 Votes 0 ·
DSPatrick avatar image
0 Votes"
DSPatrick answered shockwaveriderz commented

dism /online /cleanup-image /restorehealth
the default source is from internet (Windows Update) so I'd check an internet connection is available when running.
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/repair-a-windows-image


--please don't forget to Accept as answer if the reply is helpful--





· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick...I just found out that DISM needs an internet connection....but at the same time I'm posting here the dism is running so I know I have an internet connection so that's not the issue

0 Votes 0 ·
shockwaveriderz avatar image
0 Votes"
shockwaveriderz answered

This seems to be what may be causing the Source files not found:


By default DISM looks online to find the required files to repair the Windows Image. But in most cases, this doesn't work, so you need to specify a local source for the known good files by using the /Source switch.
The error "The Sources files could not be found files" in DISM tool, is commonly caused because of the following reasons:
Reason 1. DISM tool cannot find online (in Windows Update or WSUS) the files needed to perform the repair, when using this command: "DISM /Online /Cleanup-Image /RestoreHealth"

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

shockwaveriderz avatar image
0 Votes"
shockwaveriderz answered

EDIT Update :

ok I just ran the following 2 commands:

Dism.exe /online /Cleanup-Image /StartComponentCleanup
Deployment Image Servicing and Management tool
Version: 10.0.18362.900

Image Version: 10.0.18363.1110

[=========== 20.0% ]
The operation completed successfully.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

shockwaveriderz avatar image
0 Votes"
shockwaveriderz answered

S C:\Windows\system32> DISM /Online /Cleanup-Image /AnalyzeComponentStore
Deployment Image Servicing and Management tool
Version: 10.0.18362.900

Image Version: 10.0.18363.1110

[===========================60.0%== ]

Error: 2

The system cannot find the file specified.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

shockwaveriderz avatar image
0 Votes"
shockwaveriderz answered

Contents of the DISM.log :

2020-11-28 13:31:30, Error DISM DISM Package Manager: PID=7956 TID=18960 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x80070002)
2020-11-28 13:31:30, Error DISM DISM Package Manager: PID=7956 TID=18960 Failed processing package changes with session option CbsSessionOptionAnalyzeStore - CDISMPackageManager::AnalyzeComponentStore(hr:0x80070002)
2020-11-28 13:31:30, Error DISM DISM Package Manager: PID=7956 TID=18960 Failed to analyze component store. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x80070002)
2020-11-28 13:31:30, Error DISM DISM Package Manager: PID=7956 TID=18960 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80070002)
2020-11-28 13:31:30, Info DISM DISM Package Manager: PID=7956 TID=18960 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine
2020-11-28 13:31:30, Error DISM DISM.EXE: DISM Package Manager processed the command line but failed. HRESULT=80070002

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered

You can also try an offline source, or something here may also help.
https://docs.microsoft.com/en-us/troubleshoot/windows-server/deployment/cbs-log-file-record-entries-not-repaired-run-sfc

--please don't forget to Accept as answer if the reply is helpful--


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

shockwaveriderz avatar image
0 Votes"
shockwaveriderz answered lewisinkirkland-1987 edited

DSPatrick:

I'm aware of that url. I am not getting any error messages in my cbs.log file from running sfc /scannow.....not any error messages from :

Dism /Online /Cleanup-Image /CheckHealth
Dism /Online /Cleanup-Image /ScanHealth

only error messages from
Dism /Online /Cleanup-Image /RestoreHealth


in the dism.log file...

sI'm also getting error messages in the dism.log file when I run :
DISM /Online /Cleanup-Image /AnalyzeComponentStore



One of the so-called fixes to this is to point it to either the .esd file or a .wim file using /sources , BUT the problem is , that the .esd or .wim has to be the exact version of the windows install that you have.
you can't use a 1st version 1909 install .iso esd or iso, if you are above that version level like I am at 18363 .1110 win10pro 1909 and the .esd/.wim in the base 1909 is below 18363.1110.....Catch-22.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Unfortunately not all issues are repairable. Time may be better spent clean installing it, or restore the previous healthy backup.

--please don't forget to Accept as answer if the reply is helpful--




0 Votes 0 ·

I was running 10.0.19044.1620 when a major update in the April 2022 group of updates failed with code 0x800f0831.
An update in the May 2022 group of updates also failed with the same error code.
Eventually I discovered the availability of the DISM utility but the RestoreHealth option failed to find a workable repair source.

Using another PC, I created a USB ISO file for the PC with the problem (version 10 PRO, language Canadian-French, and 64 bit), but the tool downloaded 10.0.19041 instead of 10.0.19044 which was what I needed for the PC with the problem.
This could explain why DISM running on the bad PC did not like the install.wim file from the USB ISO file that I pointed to in the RestoreHealth command.

I decided to run the Media Creation Tool and let it choose the best OS given the state of my bad PC as opposed to downloading another incompatible standalone ISO file .
At some point during the installation process I approved keeping my old files and applications (no clean install here) and the installation eventually completed with no errors.

Windows Updates now reports that all cumulative updates have been successfully installed and my OS is now at 10.0.19044.1706.
Hopefully when the June 2022 updates arrive, they will go through without issue.

While I was happy to discover many of the features of the DISM utility, in the end, my solution came from the Media Creation Tool.


0 Votes 0 ·
ZakernyZlodej-8180 avatar image
0 Votes"
ZakernyZlodej-8180 answered ZakernyZlodej-8180 published

@shockwaveriderz DId you solve the issue somehow? Im having the same problem now.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

shockwaveriderz avatar image
0 Votes"
shockwaveriderz answered

My system just grew out of it and started working again. I'm at 19042.906 20H2 Win 10 Pro. I just kept applying patches and it started working again. try the following:

dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

This command will tell you whether or not you need to run the following command:

dism.exe /Online /Cleanup-Image /StartComponentCleanup

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.