[ 
https://issues.apache.org/jira/browse/NIFI-15683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18064704#comment-18064704
 ] 

David Handermann commented on NIFI-15683:
-----------------------------------------

Thanks for describing this issue [~cr4g5]. This highlights a fundamental 
challenge with attempting to combine multiple SFTP operations in a single 
Processor invocation. One potential path forward is to consider a separate 
Processor to perform the subsequent operations.  Fetching a file is a 
repeatable operation as long as the file exists, so perhaps failing the overall 
operation in the event of deletion and renaming could be considered, but 
requires careful orchestration within the Processor.

> "Moving" SFTP files via rename command fails on some servers
> ------------------------------------------------------------
>
>                 Key: NIFI-15683
>                 URL: https://issues.apache.org/jira/browse/NIFI-15683
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 2.7.0
>         Environment: All
>            Reporter: Craig Patrick
>            Priority: Major
>
> When running a FetchSFTP processor with the completion strategy set to 
> "Move", in certain servers an error is thrown:
> {code:java}
> FetchSFTP[id=8561c4bf-d472-3c0e-3eb5-25b311c85b79] Successfully fetched the 
> content for FlowFile[REDACTED] from [REDACTED] but failed to rename the 
> remote file due to Failed to rename [REDACTED] to [REDACTED]: 
> java.io.IOException: Failed to rename [REDACTED] to [REDACTED] - Caused by: 
> SFTP error (SSH_FX_FAILURE): Failure {code}
> Looking into it, this can be an issue when running in the standard OpenSSH 
> client and server as it throws it as a specific error. The only way around 
> this is to perform a 2 step strategy of remove and rename. The processor 
> should be updated for the "Move" completion strategy to take this into 
> account and instead of performing a rename command, should delete the 
> original and rename the current file, or should have options for replacement 
> strategy similar to other processors where the file can be renamed if exists 
> or ignored if exists - this would remove the errors and allow more 
> flexibility.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to