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 Team, 

    I am trying to get a file using "Receive File Over SFTP (Basic Credentials)"  and it gives me the below error. 

    Error copying the remote file to disk. See application server log for more details. Error Message: File not found

     

    LOG: 

    2022-06-14 07:43:25,147 [Appian Work Item - 103466 - execution02 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=536875384, classname=com.appian.ps.plugins.sftpsmartservices.ReceiveFileOverSFTPBasic
    com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.file_transfer=Error copying the remote file to disk. See application server log for more details. Error Message: File not found]
    	at com.appiancorp.suiteapi.process.exceptions.SmartServiceException$Builder.build(SmartServiceException.java:145)
    	at com.appian.ps.plugins.sftpsmartservices.ReceiveFileOverSFTPBasic.createException(ReceiveFileOverSFTPBasic.java:257)
    	at com.appian.ps.plugins.sftpsmartservices.ReceiveFileOverSFTPBasic.run(ReceiveFileOverSFTPBasic.java:172)
    	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:135)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:124)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:103)
    	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: 2: File not found

    But if I verify the Appian Folder (Destination Folder) the document already appears. How I could control this issues?

  • Good morning,

    Any update about this?

  • Hi Ivan Garcia,

    Sorry for the delay. We were analysing this issue but in between we got stuck with other priority work items. We will look into this issue once we complete them and we will reply you by early next week

  • Hi,

    Did you manage to reproduce the error? Any updates?

  • Hi,

    We are getting that error when trying to upload files with size of 8kb or more to an external SFTP server. Other uploading methods against that server (for example, via sftp utilities or cmd) work fine. Sent attached an example of a file that shows the problem when uploading through the plugin, but with the command line tool it is uploaded succesfully.

    exceltest.xlsx

  • Hi,
    Please share us with the steps to reproduce the issue because we cannot reproduce the issue from our side. Thanks.

  • Good morning,

    Any updates about this? We need to deploy this functionality as soon as possible and this is blocking the deployment. Thank you.

  • Hi Iván García, 

    We will analyse the issue and get back to you.

  • Hi,

    We are getting an unexpected error when using the Send File Over SFTP smart service (using a private key). We have a requirement to send some files to an external SFTP server and for some of them it works fine and almost instantly (small files), but when using bigger files (the file size can vary from some KB to even MB in some cases) the node will take way more time to complete (some minutes, regardless of the file size) and report the FAILED flag with the following error: "java.io.IOException: inputstream is closed". This is not something that happens randomly, it always fails for those files. The external SFTP server is not managed by us, but their IT team told us logs show that the connection is being closed abruptly.

     This issue only happens with this smart service, the rest of them works fine against that server.

    Log trace:

    2022-04-27 14:47:42 INFO [Appian Work Item - 510542 - execution01 : UnattendedJavaActivityRequest] com.appiancorp.a2.vpn.VPNTunnelNameService.lookupAllHostAddr VPN dns lookup result (private server IP)
    2022-04-27 14:52:46,850 [Appian Work Item - 510542 - execution01 : UnattendedJavaActivityRequest] ERROR com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP - Error transferring file to SFTP server
    4: java.io.IOException: inputstream is closed
    	at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:697)
    	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:540)
    	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:492)
    	at com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTP.run(SendFileOverSFTP.java:150)
    	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:116)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:124)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:94)
    	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: inputstream is closed
    	at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2911)
    	at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2935)
    	at com.jcraft.jsch.ChannelSftp.checkStatus(ChannelSftp.java:2473)
    	at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:686)
    	... 22 more
  • Hi team,

    for receive and send file over sftp does the plugin support also authentication with the public key? The requirements is to set in the Create Third-Party Credentials and add as credential not username and password, as usual, but directly the public key

    Regards