[SFTP] Auth Fail Exception

Forge Component
Published on 2018-12-03 by Tiago Bernardo
10 votes
Published on 2018-12-03 by Tiago Bernardo

We are getting java.lang.RuntimeException: com.jcraft.jsch.JSchException: Auth fail exception when try to connect to FTP Servers and upload the file /extract.

We have developed a workflow which uploads the file at the end to FTS Server and we are using put action of the SFTP extension provided by Outsystems bypassing all the required parameters to this action.

We checked the implementation of the SFTP extension - Actput.java action and found that the exception is thrown from mosput method from below line :

c = JschHelper.getChannelSftp(inParamhostname, inParamport, inParamusername,inParampassword);

We need to understand what this method 'getChannelSftp' does and why it throws Auth fail exceptions sometimes - please be informed that we submit 100applications a day and each time this action is called but Auth exception is thrown only sometimes.

We checked with our FTS Team and they confirmed that the request itself did not reach to FTS Server for the authentication and they do not see any login failure message at their end.

The stack trace for your reference is as below :

[1] java.lang.RuntimeException: com.jcraft.jsch.JSchException: Auth fail

   at outsystems.nossftp.actions.JschHelper.getChannelSftp(UnknownSource)

   at outsystems.nossftp.actions.Actput.mosput(Unknown Source)


   at osom_apm_consumer.actions.Actput.executeput(Unknown Source)

 at osom_apm_consumer.actions.ActFTSExtractDocuments.executeFTSExtractDocuments(UnknownSource)

at osom_apm_consumer.processes.ProcExcRevolvingWorkflow$ActExecFTSData.executeActivity(UnknownSource)

at osom_apm_consumer.processes.ProcExcRevolvingWorkflow$ActExecFTSData.executeMethod(UnknownSource)

More screen shots attached for your reference.

We have implemented re-try mechanism as well but it fails for each re-try as well.

We checked with OS Team and they asked us to raise this concern here as SFTP is the forge component which is not directly supported by OutSystems.

Please help us resolve this.

Screen Shots Attached for reference.


Since you're using the Java stack, the underlying library is JSch for Java - http://www.jcraft.com/jsch/, which may have some more useful information.

Searching for the error, I also found a few details that may be relevant in your case (here and here), I'd suggest investigating these.

i have observed the same issue while connecting with sftp.

i managed to tweak the code a bit and got success in connecting. 

More over i am using .net stack.


Because auth failed sometimes. so you'd better 

 1. Check the log file of jsch,  here is an example of how to set logger 


 2. Try the latest version of jsch

     The bundled version is 0.1.53, and the latest is 0.1.54

3. Try add following config, because the default value is "gssapi-with-mic,publickey,keyboard-interactive,password"

    session.setConfig("PreferredAuthentications", "password");


BTW, I had checked the extension code, but could not find JschHelper.getChannelSftp

Thanks everyone for the reply.

Important thing to note here is the Auth Fail Error does not always come. It is very intermittent which makes it difficult to resolve.