Search code examples
c#.netftpsftpsharpssh

Tamir SharpSSH sometimes constantly fails to download a file that is regularly pulled down by Filezilla


I am downloading files from a client's SFTP. When I do it from Filezilla it always succeeds in the standard way.

On the other side, when I do it from our app, that uses Tamir SharpSSH library for SFTP communication, periods constantly emerge when our all download attempts for a file fail.

I know the app works as that code has not been changes for several months and it worked much more often then it did not, but the periods keep reemerging when for the whole day or more all file downloads fail only for the app.

The exception I get is Tamir.SharpSsh.jsch.SftpException . Obviously not very helpful.

My guess is the client is doing modifications on their side, or changing permissions, as their side is not live yet, but with the exception message I do not know.

Does anybody has some suggestion? Where could I look for the solution? What should I test/try?

Thank you for the time!


Solution

  • The real message was 'No such file'. The reason was, a slash has been omitted for the root folder path, in one of our config files. When you open the exception variable in VS Watch you will see all info properties from standard exception are null or simply set to 'Tamir.SharpSsh.jsch.SftpException'.

    But, an additional property was apparently added to Tamir.SharpSsh.jsch.SftpException class - "message" and that is where the real message is stored, while Exception.Message is pretty often set to just "Tamir.SharpSsh.jsch.SftpException" . The issue is the additional property is private and is only visible by VS Watch or similar.

    Since our exception propagation mechanism is based on logging Exception.Message I was most of the time getting "Tamir.SharpSsh.jsch.SftpException"