KB-1113 SFTP smart service transfers a blank file to its destination

Symptoms

The SFTP plug-in transfers a blank file to the destination and the following error is seen in the application server log:

INFO [stdout] (Appian Work Item - 1001118 - ProcessExec01 : UnattendedJavaActivityRequest)  [Appian Work Item - 1001118 - ProcessExec01 : UnattendedJavaActivityRequest] ERROR com.appiancorp.process.engine.UnattendedJavaActivityRequest - An error occurred while executing activity: id=##some number##, classname=com.appian.ps.plugins.sftpsmartservices.SendFileOverSFTPV1
INFO [stdout] (Appian Work Item - 1001118 - ProcessExec01 : UnattendedJavaActivityRequest) com.appiancorp.suiteapi.process.exceptions.SmartServiceException: userMsg[error.file_transfer=Error copying the Appian document to remote server. See application server log for more details.]
INFO [stdout] (Appian Work Item - 1001118 - ProcessExec01 : UnattendedJavaActivityRequest) Caused by: 4: java.io.IOException: inputstream is closed

Cause

This happens to freshly generated documents, which are being transferred immediately after generation (i.e., if the document generation node is linked to the SFTP node). The document hasn't finished being created yet before the SFTP node is triggered.

Action

Insert a timer between the two nodes with a small value (a minute should be more than enough) and this will make sure that the document is available for transfer before attempting to transfer it.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: February 2017

Related
Recommended