SFTP Functions

Overview

Contains multiple Smart Services for interacting with a remote file server via SFTP, FTP, or SCP.  Using these services, an Appian application can be configured to send and receive files, folders, and metadata in a process.  Features support for zlib compression.

Key Features & Functionality

Smart Services included:

  • SFTP:
    • Send File Over SFTP
    • Receive File Over SFTP
    • Get Remote Folder Contents Over SFTP
    • Create Folder Over SFTP
    • Remove File Over SFTP
    • Receive Files In Folder Over
    • SFTP Rename File Over SFTP
  • SCP:
    • Send File Over SCP
    • Receive File Over SCP
  • FTP:
    • Send File Over FTP
    • Receive File Over FTP
    • Get Remote Folder Contents Over FTP
    • Receive Files In Folder Over FTP
    • Remove File Over FTP
    • Rename File Over FTP
  • FTPS
    • Get Remote Folder Contents Over FTPS
    • Receive File Over FTPS
    • Receive Files In Folder Over FTPS
    • Send File Over FTPS

Functions:

  • getfoldercontentsoverftp
  • getfoldercontentsoverftps
  • getfoldercontentsoversftp
  • All smart services in the package use Secure Credentials Store.
Anonymous
  • Hi Sourabh,

    This issue might happen when the provided path is not available or the path doesn't have any file within it. Kindly check with the input path provided and also the folder.

    Thanks.

  • Hi All,

    We are getting the Error while using Receive File Over SFTP (Basic Credentials)

    String index out of range: -1
    can you Please hep me with it
    Thanks in Advance! 
  • Hi,

    We are using 'Receive File Over SFTP' node as MNI and it is showing error intermittently as connection timeout, few files are getting transferred  but for one of file it fails, even though SFTP application is up and not having any connection issue.

    Below is the error:

     

    com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out (Connection timed out)
    	at com.jcraft.jsch.Util.createSocket(Util.java:349)
    	at com.jcraft.jsch.Session.connect(Session.java:215)
    	at com.jcraft.jsch.Session.connect(Session.java:183)
    	at com.appian.ps.plugins.sftpsmartservices.SFTPConfig.connect(SFTPConfig.java:179)
    	at com.appian.ps.plugins.sftpsmartservices.GetRemoteDirectoryContentsOverSFTP.run(GetRemoteDirectoryContentsOverSFTP.java:66)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:136)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:136)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:130)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:27)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:130)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:21)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:129)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
    	at java.net.PlainSocketImpl.socketConnect(Native Method)
    	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    	at java.net.VPNSocketImpl.connect(VPNSocketImpl.java:50)
    	at java.net.Socket.connect(Socket.java:607)
    	at java.net.Socket.connect(Socket.java:556)
    	at java.net.Socket.<init>(Socket.java:452)
    	at java.net.Socket.<init>(Socket.java:229)
    	at com.jcraft.jsch.Util.createSocket(Util.java:343)
    	... 23 more
    2022-12-08 15:42:12,240 [Appian Work Item - 21 - WorkID 62 - execution02 - process 53970 - model 226 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=536872158, classname=com.appian.ps.plugins.sftpsmartservices.GetRemoteDirectoryContentsOverSFTP
    com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.sftp_conn=Error establishing SFTP connection. Confirm your hostname, username and password. See application server log for more details. Error Message: java.net.ConnectException: Connection timed out (Connection timed out)]
  • Hello. 

    Have you had the opportunity to look into this issue? Seems to be a common item among many Plug-In users. Please advise if so, thank you. 

  • Hello Team - We are using "Send file over SFTP" node and it's returning following errors.. FYI, on same environment with different SFG gateway ID we are using "Receive file over SFTP" which is working fine.. however with sending file it's an error. Any help and pointer in right direction would be much appreciated.. Something changed with latest version?

    2022-10-20 05:15:26,584 [Appian Work Item - 148246 - WorkID 226 - execution01 - process 268492854 - model 10687 : UnattendedJavaActivityRequest] ERROR com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP - Error connecting to remote SFTP server
    com.jcraft.jsch.JSchException: java.io.IOException: channel is broken
    	at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:315)
    	at com.jcraft.jsch.Channel.connect(Channel.java:152)
    	at com.jcraft.jsch.Channel.connect(Channel.java:145)
    	at com.appian.ps.plugins.sftpsmartservices.SFTPConfig.connect(SFTPConfig.java:182)
    	at com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP.run(SendFileOverSFTP.java:141)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:136)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:136)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:130)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:27)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:130)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:21)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:129)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: java.io.IOException: channel is broken
    	at com.jcraft.jsch.Session.write(Session.java:1289)
    	at com.jcraft.jsch.ChannelSftp.sendINIT(ChannelSftp.java:2499)
    	at com.jcraft.jsch.ChannelSftp.start(ChannelSftp.java:258)
    	... 23 more
    2022-10-20 05:15:26,585 [Appian Work Item - 148246 - WorkID 226 - execution01 - process 268492854 - model 10687 : UnattendedJavaActivityRequest] ERROR com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP - Error transferring file to SFTP server
    4: java.io.IOException: Pipe closed
    	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:551)
    	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:492)
    	at com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP.run(SendFileOverSFTP.java:151)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:136)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:52)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:136)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:130)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:27)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:130)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:88)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:21)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:55)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:129)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:239)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:750)
    Caused by: java.io.IOException: Pipe closed
    	at java.io.PipedInputStream.read(PipedInputStream.java:307)
    	at com.jcraft.jsch.Channel$MyPipedInputStream.updateReadSide(Channel.java:362)
    	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:515)
    	... 21 more

  • Hi Ivan, 

    We have been experiencing similar issues regarding small files being transferred, and if we have larger files, long wait times before "input stream is closed" errors being returned. Did you happen to find a solution to this? 

    Thank you kindly for your help in advanced. 

  • Hi - we are experiencing this issue as well where files are being copied over at "0" size when there is actual data in appian. We are being returned with "Input stream is closed" error. Your issue seems to be similar with out findings. Can you confirm if you were able to find a solution to this? We are currently on 2.2.1 version of SFTP Functions

  • Hi Author,

    Has recently there been changes to the 'Send File Over SFTP' smart service with the latest version of the plugin?

    When I upgraded the plugin from 1.6.2 to 2.2.2 then the 'Send File Over SFTP' smart service started failing for no reason. And the interesting thing is smart service node passes without any error and the file is not placed onto the SFTP location.

    And when I check logs the following is the error:

    [Appian Work Item - 16520 - WorkID 208 - execution00 - process 169537 - model 10914 : UnattendedJavaActivityRequest] ERROR com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP - Error transferring file to SFTP server 2: The system cannot find the path specified.     at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)


  • This seems to be a common issue.
    When I upgraded the plugin from 1.6.2 to 2.2.2 then the 'Send File Over SFTP' smart service started failing for no reason.
    So, I'm now rolling back to the old version.

  • Hi,

    We use a smart service named - 'Send File Over SFTP (Basic Credentials)' to transfer files/documents from Appian to the SFTP location.


    Is there any limit on file size that can be transferred via a smart service named - 'Send File Over SFTP (Basic Credentials)'?