SFTP Smart Services

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:
    • Remove Directory Over SFTP (Basic Credentials)
    • Send File Over SFTP
    • Send File Over SFTP (Basic Credentials)
    • Receive File Over SFTP
    • Receive File Over SFTP (Basic Credentials)
    • Rename File Over SFTP
    • Get Remote Directory Contents Over SFTP
    • Get Remote Directory Contents Over SFTP (Basic Credentials)
    • Create Directory Over SFTP
    • Create Directory Over SFTP (Basic Credentials)
  • SCP:
    • Send File Over SCP
    • Receive File Over SCP
  • FTP:
    • Send File Over FTP
    • Receive File Over FTP
    • Receive Folder Over FTP
  • FTPS
    • Receive Folder Over FTPS
    • Send File Over FTPS (Basic Credentials)

All smart services in the package use Secure Credentials Store.

Anonymous
  • Reproduce the issue by using 3-4 instances of the same process to load from different folders simultaneously, where each folder has more than 6 files, using the same account for all file transfers. If you are unable to reproduce, we can check about giving sandbox or dev access and/or having a conference call to show how it works on our system. Perhaps you can guide us in formulating a solution to this issue. Thanks in advance!

  • Hello good!


    Can you tell us how you solved it?

    We had a route such that:

    /user1/d/test/mytest.txt

    Until we updated the version of the plugin, this worked correctly for us, but since we updated it, it returns this error:

    Error transferring file to SFTP server
    2: No such file

    Any solution?

    A greeting and thanks in advance

  • Hi,

    I will have to use "Retrieve Files in Folders over FTPS" to get documents from a share folder.

    With this smart service, have documents (retrieved) been removed from the original share folder?

    Thanks

  • Hello , I am facing an issue with new version of SFTP  plugin . with Previously version , I was using Send File Over SFTP smart service to send my file to destination  location , under smart service in remote file path : I was giving destination path /file name and upload the file . File was going with file name without any extension as file name mentioned remote file path doesn't contain any extension . But with new version , in remote file path : it is accepting only path , and filename what is been upload is begin taken . problem now is file which been upload is adding the extension also to it . As i want to strip of the extension and send only filename to the destination . but extension is automatically attached when it is sent . Does n't ayone can suggest what is possible way to strip of file extension .

    At destination location , expecting only file name without extension . 

  • Hello, I have a question - is there any limitation in terms which kind of private keys are supported? I have tried to use ppk format from putty keygen, 4096 bit encryption, with passphrase. however constantly getting an error - Invalid private key. Did somebody have similar experience?

    BR, Aleksandrs

  • It will copy the files to Appian. The source file won't be deleted.

  • Hello, I am kindly requesting assistance with SFTP (Basic Credentials) plug-in. 

    Over the course of several months, our application's success rate with this plug-in has decreased to less than 5%. We are on a cloud based application with different environment levels. In our TEST environment, we have never had issues connecting to the intended TEST server utilizing this plug-in. We have also tested connecting from our TEST environment to our PRODUCTION intended server file path, with success. However, when we try to connect to this PRODUCTION Server from our PRODUCTION environment utilizing this smart service, we are experiencing a very, very high failure rate. Note: This SFTP smart service is executed in a Process after a user has submitted a form. 

    When the Send File SFTP (Basic Credentials) node is executed, we are able to establish a connection with the server (the username and password are accepted), a session is established and is open for ~10 minutes; however, the file gets sent over as blank with the error below. 

    I have attached a screenshot of a log of a failed attempt. The PM error we always receive is the same: 

    Error transferring file 4: java.io.IOException: inputstream is closed

    Note: we have also attempted to send files that were generated hours / days prior to ensure that the document is in the Knowledge Center and that it does, in fact, contain data. 

    I also want to inform that we are utilizing another smart service from this plug-in, Receive file from SFTP (Basic Credentials), and this is executed nightly. We have no failure rate with this plug-in component, in any environment. 

    Other points to note regarding our troubleshooting efforts: 

    1. We have implemented a timer that executes after the creation of the files to further ensure document(s) are generated.

    2. Files are generated in a sub-process; thus, the smart service(s) creating the files must execute before the process finishes and moves forward in the parent. Files are also generated independently (one at a time) utilizing a smart service (Text Doc from Template), then these files are merged into an array of documents before exiting the sub-process. After sub-process has completed, the timer is executed ensuring delay in order to make sure generation is complete, which is beyond in the flow of the process. 

    3. The size of these text files are also very very small (avg. size is 5Kb). Never a file has been over 30Kb. The server being connected to has no file size limitations in place. All files being sent are always same extension (.txt)

    4. Our IP addresses are ensured that they're being accepted by the target server's firewall. 

    Assistance to what logs to activate regarding further troubleshooting or other troubleshooting assistance is very much requested and appreciated. Thank you very much. 

  • Also would like to mention that we're on the latest version of this Plug-In 2.2.1

  • 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

  • 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