user565869
user565869

Reputation:

SSIS does not recognize file path

I have a File System Task to copy a local file to a remote drive, using the UNC path. Recently the target file server was moved, so I updated the path, but now I'm getting this error message:

 [File System Task] Error: File or directory "\\path\filename.ext" represented by connection "XYZ" does not exist.

The file most definitely does exist; what else might cause this error?

I can copy the exact path into a Run dialog and open the file without any problem. I can also browse the target folder, and can write to or delete the file outside of VS. I do not have any rights on the parent folder, if that might be relevant.

The File Connection is set to Existing file. The File System Task is set to overwrite. The path is hard-coded, not an expression or variable. This report has been running for months, all that's changed now is the file server and path. The old path had also been UNC.

Most of what I've found online relates to deployment, but I'm developing on the server which runs the package (I know, it's not ideal), under the same account as that under which the package runs. In any case I get the same error when running via SQL Agent or debugging within VS.

Most maddening of all, other SSIS jobs write to the same folder without any trouble. However, those include a subsequent Execute Script task which renames the posted file, so the exact target file does not exist when they run. This package just overwrites the same file every day. If I can't fix this issue I'll add such a task here too.

If I delete the target file, the task will run... once. The next day the package will fail, as the target will again be present, and it seems the problem lies in overwriting an existing file. Of course I could insert a "delete" File System Task... except it also claims that the target does not exist.

I've tried re-creating the File Connection and File System Task, no change.

Screen cap of the File System Task

Upvotes: 5

Views: 12911

Answers (1)

jlvaquero
jlvaquero

Reputation: 8785

I had the same problem long time ago and this solution worked for me.

My error was due to the use of a UNC path and the account runnnig the package not having access to ALL the folders and files in the path.

Internally SSIS package is trying to list all files and directories in \\path, if doing this a exception is throwed, you recive that error.

To solve this you need to ensure that the account running SSIS package has access to ALL folders and files in the path you are accessing.

To check if this works, logon as the relevant account, or run a command window as the specified user and then check you have full rights to all files and subdirectories.

Maybe you have the same issue. It worth a try.

Upvotes: 6

Related Questions