KB Article #180583

S3: Receiving SETSTAT ERROR when trying to upload a file to AWS SFTP server

Problem

When attempting to upload a file via S3 connector to an AWS SFTP server, the upload is successful but the transfer is marked as failed, and a SETSAT ERROR is logged.


Cause

The AWS Transfer for SFTP (AWS SFTP) is a fully managed service hosted in AWS that enables the transfer of files over SFTP directly in and out of Amazon S3. It is possible to configure the S3 connector for SecureTransport to connect to this server, however, it is not a supported configuration, as the S3 connector is meant to be used for AWS buckets only.


The above error is due to an incompatibility between the SFTP command sequence used by SecureTransport and the commands permitted by the AWS SFTP server. The SETSTAT is used by ST to set the file attributes after upload, modifying the timestamp of the file. Since this specific command is not permitted by the AWS SFTP, ST logs an error, even though the transfer has been successful and the file has been uploaded.


Referencing the FAQ of the AWS SFTP server:


Q: What file operations are supported by AWS SFTP? What operations are not supported?
A: Common SFTP commands to create, read, update, and delete, files and directories are supported. Files are stored as individual objects in your Amazon S3 bucket. Directories are managed as folder objects in S3, using the same syntax as the S3 console. Directory rename operations, symbolic links and hard links are currently not supported. Source


This limitation is also mentioned in the following article at the Infra Engineer blog.