Microsoft Enterprise Platforms Support: Windows Server Core Team
In today’s blog submission, we would like to address some reasons and troubleshooting tips for resolving the error of “Enumeration of the files failed” that can occur during System State backup. This particular error can be experienced on various versions of operating systems. But for the purpose of this blog, we will focus on Windows Vista and Windows Server 2008.
The error is captured in the Application Event Log as such as:
Log Name: Application Source: Microsoft-Windows-Backup Date: date Event ID: 517 Task Category: None Level: Error Keywords: User: user name Computer: computer name Description: Backup started at ' time ' failed with following error code '2155348237' (Enumeration of the files failed.). Please rerun backup once issue is resolved.
Log Name: System Source: Service Control Manager Date: date Event ID: 7000 Task Category: None Level: Error Keywords: User: user name Computer: computer name
Description: The <servicename> service failed to start due to the following error: The system cannot find the path specified.
Another place where the error may appear is when using the Windows Server Backup tool from a command-line interface (elevated, running as Administrator) as such:
wbadmin start systemstatebackup -backuptarget:E: wbadmin 1.0 - Backup command-line tool (C) Copyright 2004 Microsoft Corp.
Starting System State Backup [date time] Retrieving volume information... This would backup the system state from volume(s) Local Disk(C:) to E:. Do you want to start the backup operation? [Y] Yes [N] No y
Creating the shadow copy of volumes requested for backup. Creating the shadow copy of volumes requested for backup. Identifying system state files to backup (This may take a few minutes)... Found (2862) files Found (6420) files Found (9828) files
Summary of backup: ------------------ Backup of system state failed [date time]
Log of files successfully backed up 'C:\Windows\Logs\WindowsServerBackup\SystemStateBackup date time.log'
Log of files for which backup failed 'C:\Windows\Logs\WindowsServerBackup\SystemStateBackup_Error date time.log'
Enumeration of the files failed. The parameter is incorrect.
* OR *
Enumeration of the files failed. The process cannot access the file because it is being used by another process.
Enumeration of the files failed. The file name, directory name, or volume label syntax is incorrect.......
Several causes can be attributed to this error condition of “Enumeration of the files failed”. The majority of the times, these causes have a direct correlation to the ImagePath in the registry for a service that is installed. To outline a few we discovered thus far are:
1. An invalid path. 2. Invalid characters in the path. 3. Syntax formatting of the path. 4. A valid path on SAN drives of a Failover Cluster.
1. An invalid path – This can be any of the following that have been seen:
• A path pointing to a local that no longer exists.
• An incomplete path (such as \myservice\myservice.exe).
• A UNC path the service does not understand how to query the folder (such as \\myservice\myservice.exe).
2. Invalid characters in the path – This can be any of the following that have been seen:
• Using dots which some application vendors use (such as C:\myservice\bin\..\myservice.exe).
3. Syntax formatting of the path – This can be any of the following that have been seen:
· This would be a path that includes space and it’s not enclosed by double quotes (such as C:\Program Files (x86)\ my service\bin\myservice.exe).
4. A valid path on SAN drives of a Failover Cluster – This can be any of the following that have been seen:
· This would be any service(s) in which its path is on the passive node of a Failover Cluster pointing to a Physical Disk resource that is owned by another nodes when error is experienced (such as Z:\folder\app\bin\myservice.exe)
1. Launch MSINFO32.EXE, then review and closely inspect each of the paths for all the services installed. HINT: Click on the Start Mode column, so that all the Auto services are at the top. This will make it easier to closely inspect each of the paths for the services are in a Stopped state.
2. Another method to locate the paths in the registry, would be to export the entire services key and closely inspect the ImagePath that are pointing to either a local disk or a Physical Disk resource on the SAN owned by one of the nodes in the Failover Cluster.
To do this manually, use this command-line interface (elevated, running as Administrator) as such:
reg query HKLM\SYSTEM\CurrentControlSet\Services /s /v ImagePath > regkeys.txt
Then use Notepad.exe to closely inspect each ImagePath.
3. Most of the time, tracking down this kind problem can be very time consuming. So an easier way of tracking down these invalid ImagePaths would be to us a PowerShell (PoSH) script. This PoSH script will locate potential paths in question that need to be corrected by displaying the following Reasons:
· The service path contains invalid characters. Characters < > : `" | ? cannot be used in a file path.
· The service path does not have a proper path format. Only paths beginning with [<Drive>]:\ format are supported.
· The service path contains a double inverted slashes. UNC Network paths or paths containing a double inverted slashes are not supported.
· The service path is relative. Only absolute paths are supported.
· The service path contains a front slash. Only paths containing an inverted slash are supported.
· The service path contains a reparse point. Paths containing a reparse point are not supported.
· Unable to check the path. Expecting the ImagePath for the service to be a .dll or .exe
· The service path contains spaces, the whole path needs to be enclosed using double quotes
Download the following PoSH script, rename it to GetInvalidPathsv2.ps1 and run it from an elevated PoSH command prompt:
Get Invalid Paths
If the following error is experienced, this is more of a syntax issue which has to do with having a (.\) in front of the script name such as .\GetInvalidPathsv2.ps1
If any of the following errors are experienced, it is because the ExecutionPolicy needs to be set to Unrestricted.
This error is experienced in PoSH v1:
This error is experienced in PoSH v2:
This command works with both PoSH v1 and v2, it needs to be executed in order to allow the script to run:
When the change is made in the ExecutionPolicy, this will allow you to run the script to list the Reasons found as such:
Once .\ GetInvalidPathsv2.ps1 completes running, the following command needs to be executed in order to avoid any potential security risks:
4. Once all the paths have been identified, launch REGEDIT, drill down to Services and begin changing the ImagePath with a valid path. Some examples of valid paths would be: \SystemRoot\system32\drivers\adpu160m.sys %SystemRoot%\system32\drivers\adpu160m.sys %WinDir%\system32\drivers\adpu160m.sys C:\Windows\system32\drivers\adpu160m.sys
5. Now in the case where the path is valid on a SAN shared drive of a Windows Server 2008 Failover Cluster, then the hotfix and steps outlined in KB980794 would need to be followed as such:
980794 System state backup error in Windows Server 2008 and in Windows Vista: "Enumeration of the files failed"
Use one of the hotfixes in this package and create an ExcludedBinaryPaths registry key. To do this, follow these steps:
1. Click Start, type regedit in the Search programs and files box, and then press ENTER.
NOTE: If you are prompted for an administrator password, type the password. If you are prompted for confirmation, provide confirmation.
2. Locate and then click the following registry subkey:
NOTE: If this registry subkey does not exist, please create it manually.
3. On the Edit menu, point to New, and then click Multi-String Value. 4. Type ExcludedBinaryPaths, and then press ENTER. 5. Right-click ExcludedBinaryPaths, and then click Modify. 6. In the Value data box, type all binary paths that should be excluded from the system state backup operation, and then click OK.
Note The binary paths should be absolute paths. They should not include environment variables (such as %windir%) and should not be enclosed in double or single quotation marks.
6. Exit Registry Editor.
· If you use this method to exclude the service data from the system state backup scope, you have to back up the service data on the shared volume manually.
· If you assign a drive letter to a shared volume that is excluded from the system state backup scope, you have to manually re-enter all the registry keys again by using a new path because the assigned drive letter does not function any longer. · If the issue “Enumeration of the files failed” is occurring during a System State backup of a shared SAN drive on a Windows Server 2008 R2 Failover Cluster, Microsoft acknowledges this is a problem in the operating system of this product. Microsoft is currently investigating the issue and working to provide a solution. Once a solution is ready for Windows Server 2008 R2, this blog will be updated.
Important: You have to exclude services carefully, because wrong entries can corrupt the system state.
Please feel free to post your comments. Thanks for your time and, as always, we hope the information here has been useful to you.
Mike Rosado Senior Support Escalation Engineer Microsoft Enterprise Platforms Support
Mike, I keep getting a error when I try to run the script that the last line is miss a curly bracket. Would you know how to fix this?
Just wondering - while you text says the registry key should be called "SystemWriter", it's "SystemWriters" in your last screeenshot. Which one is correct?
Thank you Mike,
My case was number 4. A valid path on SAN drives of a Failover Cluster.
I solved the problem applying hotfix kb980794 and creating the registry key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SystemWriter\ExcludedBinaryPaths and setting as value the path to the executable of the cluster service.
This one helped me several times, good work!
we need also so check the CCS001 and CCS003 also if there's also services that have also "malformed" path. I was troubleshooting that issue with one customer, and even the excludedbinarypath exclusion was correct, the System Writer Metada was still locating those files that I want to exclude. Searching for them, we found on CCS001 and CCS03 malformed imagepath names. Correcting that, the Diskshadow>list writers detailed, didn't report anymore those files.
Carlos Carrolo (MSFT)
Is there something new regarding the following?
"Microsoft acknowledges this is a problem in the operating system of this product. Microsoft is currently investigating the issue and working to provide a solution. Once a solution is ready for Windows Server 2008 R2, this blog will be updated."
Related to step 5. regarding "Now in the case where the path is valid on a SAN shared drive of a Windows Server 2008 Failover Cluster"