Error getting name of current remote directory
I've seen this error before when trying to login using an interface session where the remote directory has not been set. But now it is set, and I'm seeing this error from an SSIS script task.
Here's the error output:
<?xml version="1.0" encoding="UTF-8"?>
-<session start="2013-04-06T21:50:52.674Z" name="login@ip_address" xmlns="https://winscp.net/schema/session/1.0"> -<failure> <message>Error getting name of current remote directory.</message> <message>Cannot get real path for '.'.</message> <message>Permission denied. Error code: 3 Error message from server (en): The data is invalid. , file: . Request code: 16</message> </failure> </session>
Here's the FTP Server log:
2062 Sft_server_no_virtual_folder_dir, "2062 Sft_server_no_virtual_folder_dir, "C:", Directory name: C:\, "Path 'C:\': is not a direcotory.""
Here's the WinSCP section of the script task:
Here is the obfuscated value of the variable WinSCPopen: "open sftp://login:password@IP_address:port". I have confirmed the values by copying and pasting them into the GUI and successfully connecting.
As you can see, I tried adding a CD command before I realized that the error was thrown just after the open command is passed. The server shows a successful connection at first, then it realizes my session is "trying" to visit the C: drive.
Here's the error output:
<?xml version="1.0" encoding="UTF-8"?>
-<session start="2013-04-06T21:50:52.674Z" name="login@ip_address" xmlns="https://winscp.net/schema/session/1.0"> -<failure> <message>Error getting name of current remote directory.</message> <message>Cannot get real path for '.'.</message> <message>Permission denied. Error code: 3 Error message from server (en): The data is invalid. , file: . Request code: 16</message> </failure> </session>
Here's the FTP Server log:
2062 Sft_server_no_virtual_folder_dir, "2062 Sft_server_no_virtual_folder_dir, "C:", Directory name: C:\, "Path 'C:\': is not a direcotory.""
Here's the WinSCP section of the script task:
Process winscp = new Process(); //winscp.StartInfo.FileName = "winscp.com"; winscp.StartInfo.FileName = Dts.Variables["User::WinSCPcom"].Value.ToString(); winscp.StartInfo.Arguments = "/log=\"" + logname + "\""; winscp.StartInfo.UseShellExecute = false; winscp.StartInfo.RedirectStandardInput = true; winscp.StartInfo.RedirectStandardOutput = true; winscp.StartInfo.CreateNoWindow = true; winscp.Start(); // Feed in the scripting commands winscp.StandardInput.WriteLine("option batch abort"); winscp.StandardInput.WriteLine("option confirm off"); winscp.StandardInput.WriteLine(Dts.Variables["User::WinSCPopen"].Value.ToString()); winscp.StandardInput.WriteLine("lcd " + Dts.Variables["User::DataFolder"].Value.ToString()); winscp.StandardInput.WriteLine("cd " + Dts.Variables["User::RemoteDir"].Value.ToString()); winscp.StandardInput.WriteLine("option transfer binary"); winscp.StandardInput.WriteLine("get " + Dts.Variables["User::SigDeletes"].Value.ToString()); winscp.StandardInput.WriteLine("get " + Dts.Variables["User::SigModules"].Value.ToString()); winscp.StandardInput.WriteLine("close"); winscp.StandardInput.WriteLine("exit"); winscp.StandardInput.Close();
Here is the obfuscated value of the variable WinSCPopen: "open sftp://login:password@IP_address:port". I have confirmed the values by copying and pasting them into the GUI and successfully connecting.
As you can see, I tried adding a CD command before I realized that the error was thrown just after the open command is passed. The server shows a successful connection at first, then it realizes my session is "trying" to visit the C: drive.