[
https://issues.apache.org/jira/browse/NIFI-15345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18045246#comment-18045246
]
David Handermann commented on NIFI-15345:
-----------------------------------------
Thanks for raising this issue [~pkelly.nifi]. I concur with your evaluation,
this did change as a result of refactoring to the SFTP client library changes.
In earlier implementations, the various operations such as setting permissions,
setting last modified time, setting remote owner, and setting remote group
occurred independently. The new library handles all of those changes in a
single attributes call, which requires having the initial set of remote file
attributes.
Reviewing the implementation, it looks like it should be possible to make the
get and set stat calls dependent on whether any of those modification
properties are configured.
I can take a look at the changes required.
> PutSFTP fails for servers that automatically move the file immediately after
> upload
> -----------------------------------------------------------------------------------
>
> Key: NIFI-15345
> URL: https://issues.apache.org/jira/browse/NIFI-15345
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 2.6.0, 2.7.0, 2.7.1
> Reporter: Paul Kelly
> Priority: Major
> Labels: SFTP
>
> Since NIFI-14720, NiFi now calls .stat() on the uploaded file after the
> upload completes. For SFTP servers that are configured to automatically move
> a file immediately after the upload completes, this move can happen fast
> enough that NiFi's stat call throws an error because the file no longer
> exists. This error causes NiFi to fail with "Failed to transfer content to
> [remote_file_name]", and to transfer the flowfile to the failure
> relationship, even though the file was successfully uploaded.
> The stat call should be moved to its own try/catch block away from the
> upload, in order to handle those errors separately. Ideally stat should only
> be called if any attributes are going to be set, or it should be configurable.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)