Exception of type 'Tamir.SharpSsh.jsch.SftpException'

Jul 13, 2012 at 11:32 AM

 

I am trying to get the files using GETFile from SFTP to local path.

Here i am getting error:

[SSISSFTTask] Error: Error : Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown. 

Could  you please help me, how to come out of this issue

 

Aug 3, 2012 at 3:46 PM

NBiyanka...did you get past this error?  I'm getting it as well.

[SSISSFTTask] Error: Error : Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown.

Feb 8, 2013 at 3:25 PM
Edited Feb 8, 2013 at 3:26 PM
Yep. Me too.

I receive this non-descript error message after the SFTP session is connected but before the first file is downloaded. All the parameters seem to be correct.

[SSISSFTTask] Information: START SFTP Task
[SSISSFTTask] Information: The rendered local path is: \myserver\file_drop\CLT130207.txt
[SSISSFTTask] Information: SFTP Server: "ftp.mysite.com", User "myuser"
[SSISSFTTask] Information: SFTP port: 22
[SSISSFTTask] Information: Preparing to copy the file /CLT130207.txt to \myserver\file_drop\CLT130207.txt
[SSISSFTTask] Error: Error : Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown.

Any clues as to how to resolve this?
Thanks
Coordinator
Feb 8, 2013 at 3:35 PM
Hi,
 Can you send me please a screenshot of the component in design time? 
 Where is located the file /CLT130207.txt? the destination is the correct one?
 Can you provide me more information concerning this issue?
Thank you,
Cosmin
Feb 9, 2013 at 6:56 PM
Edited Feb 9, 2013 at 7:03 PM
Thanks for getting back to me so quickly. I am desperately trying to debug this problem so that I can get this code into Prod before the end of the Sprint next week.
I created a simple WinForms app to test the SSIS dll. I also put in a lot more componentEvents.SendInformation statements to see the parameters as they flow through the process. Lastly, added some exception handling that preserves the original stacktrace.
However, I am left with this problem:
If I call:
SSISSFTPTask100.SSIS.Communication.GetFileBySFtp("site", "uid", "pwrd","/file.txt", "\\destsvr\destfolder\file.txt", true);
from the winforms app, it works flawlessly. I get all the messages and the file is transferred correctly.

If I make that call through the SSIS Task, I get a "No such file." error in the _stat method:
[SSISSFTTask] Error: Error: Tamir.SharpSsh.java.Exception: Path:/CLT-130209.txt - No such file
at Tamir.SharpSsh.jsch.ChannelSftp.throwStatusError(Buffer buf, Int32 i)
at Tamir.SharpSsh.jsch.ChannelSftp._stat(String path) ---> No such file
--- End of inner exception stack trace ---
at Tamir.SharpSsh.jsch.ChannelSftp._stat(String path)
at Tamir.SharpSsh.jsch.ChannelSftp.get(String src, String dst, SftpProgressMonitor monitor, Int32 mode)
--- End of inner exception stack trace ---
at Tamir.SharpSsh.jsch.ChannelSftp.get(String src, String dst, SftpProgressMonitor monitor, Int32 mode)
at Tamir.SharpSsh.Sftp.Get(String fromFilePath, String toFilePath)
at SSISSFTPTask100.SSIS.Communication.GetFileBySFtp(String url, String login, String password, String sourceFileName, String outputFileName, Boolean overwrite)

Any ideas why this would occur?
Thanks,
Simon
Feb 9, 2013 at 7:18 PM
The _stat method uses a path that is CASE SENSITIVE! My two methods above differed by case and when the case did not match the file to download exactly, it failed.
Feb 9, 2013 at 8:03 PM
I have changed this method to show a more useful error message:
private void throwStatusError(Buffer buf, int i)
        { //throws SftpException{
            if (server_version >= 3)
            {
                byte[] str = buf.getString();
                //byte[] tag=buf.getString();
                var msg = new String(str);
                if (msg=="No such file")
                {
                    i = SSH_FX_NO_SUCH_FILE;
                    msg += "\r\n" + "(Check the case of the file to be downloaded.  It must match exactly.)";
                }
                throw new SftpException(i, msg);
            }
            else
            {
                throw new SftpException(i, "Failure");
            }
        }
Jun 27 at 1:16 PM
Edited Jun 27 at 1:16 PM
2 years later and I'm getting that error too "[SSISSFTTask] Error: Error : Exception of type 'Tamir.SharpSsh.jsch.SftpException' was thrown."