Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty. RRS feed

  • Question

  • I know the message is self explanatory

    my source folder : C:\Dataloads is mapped in For each loop container and pick up file(s) for my package.

    I do see the files in the folder and I`m using "*.*" in the enumerator configrator and also my folder path is there as well still when i run the package I get the same error message.

    One important thing to know in my case is my package was created when I had WinXP pn my local machine and we got migrated to Win 7 over the weekend. Do I need to take that in account?

    Can someone point in right direction to figure out whats going on ?


    Tuesday, February 10, 2015 6:30 PM


All replies

  • This is NOT an error, it is a sensible warning

    Nothing to do on your end, but you may want to set DelayValidation to TRUE




    Tuesday, February 10, 2015 6:55 PM
  • Arthur, I do have files in my folder and When I execute the package this is where it stops.. Shouldnt it complete for inserting data in the table?


    Tuesday, February 10, 2015 7:05 PM
  • It does not stop, it completes. It clearly did not see the files.

    Question is why it did not.

    So one thing to try is to make a breakpoint on the loop and inspect the values the loop picks for the subject of path, file name.




    Tuesday, February 10, 2015 8:00 PM
  • May be its better to check if its a 32 bit or 64 bit OS


    Tuesday, February 10, 2015 9:00 PM
  • Hi FM,

    Based on the error message, the issue can due to the following reasons:

    • File path is incorrect in the Foreach Loop Container. Please make sure there still have a folder C:\Dataloads with the corresponding files in your Win 7 server.
    • The user runs the package have no access to the folder or the files. Please provide read/write access to the users on the directory.

    The following similar thread is for your reference:

    Katherine Xiong

    Katherine Xiong
    TechNet Community Support

    Thursday, February 12, 2015 7:52 AM
  • Aside from the obvious (path is incorrect, empty, or permissions aren't correctly set) this can also happen when you are doing too many "hops".

    e.g. You open SSMS on Laptop-A, connect to the SQL instance on Server-B and execute an SSIS package which reads a share on Server-C. If this is the case, logging on to Server-B and running the package locally will work (as this removes the "hop" from Laptop-A to Server-B).

    To fix this properly I think you need to configure the SQL Server to be "trusted for delegation" in AD.

    Wednesday, May 31, 2017 10:23 AM
  • Apart from Validating that the Folder path and the File Name in the ForEach Loop are valid and ensuring you have access to the folder path,

    It may also be an issue with the file extensions. 

    Check you File Explorer Options: Control Panel --> File Explorer Options --> 'View' Tab --> UNCHECK the option : 'Hide Extensions for known File Types'

    This way you may ensure having correct file extensions.

    With out this option unchecked, the file extensions would be hidden. Incase you save a csv file with the name testfile.csv,  since the extension is invisible, the file may end up being saved as testfile.csv.csv (with the 2nd csv invisible). For Each loops checks for testfile.csv, while it only finds testfile.csv.csv which is not the file name it expects.

    Unchecking the option would help know the correct file extension.

    And in your case OS Migration might have changed these folder options too

    Note : Just posting it on an older post since it might help anyone else

    Thursday, September 14, 2017 3:38 PM