Reasons why the error Enumeration of the files failed may occur during System State backup

 

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.

 

A closer inspection of the System Event Log may actually identify a service that is failing to start when the “Enumeration of the files failed” error is received as such:

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.

* OR *

     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)

 

TROUBLESHOOTING TIPS:

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.

 

image

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.

image

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

image

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:

image

This error is experienced in PoSH v2:

image

 

This command works with both PoSH v1 and v2, it needs to be executed in order to allow the script to run:

                                    Set-ExecutionPolicy unrestricted

When the change is made in the ExecutionPolicy, this will allow you to run the script to list the Reasons found as such :

 

image

Once .\ GetInvalidPathsv2.ps1 completes running, the following command needs to be executed in order to avoid any potential security risks:

 

                        Set-ExecutionPolicy restricted

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

image

 

 

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:

                HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SystemWriter

                         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.

image

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.

NOTE:

· 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.

Author:

Mike Rosado
Senior Support Escalation Engineer
Microsoft Enterprise Platforms Support