You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Layon (Jira)" <ji...@apache.org> on 2021/09/06 20:14:00 UTC

[jira] [Updated] (NIFI-9196) FetchFileTransfer erroneously alters Destination Directory when performing COMPLETION_STRATEGY

     [ https://issues.apache.org/jira/browse/NIFI-9196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Layon updated NIFI-9196:
------------------------
    Description: 
Scenario:

NiFi running on windows

 
 # FetchSFTP processor reads files from a remote SFTP server *(ok)*
 # FetchSFTP then is configured to perform a "completion strategy" of moving the fetched files to another remote directory *(fails)*

 

It was found that FetchSFTP (who extends FetchFileTransfer) alters the property "Move Destination Directory" 

 

Example: 
 * Source Remote file:                    /sftp/file1.txt
 * Move Destination Directory:      /sftp/done
 * Intended file after move:           /sftp/done/file1.txt
 * After execution, is is found that FetchSFTP sent the SFTP command to rename the file to: {color:#ff0000}C:\sftp\done\file1.txt{color}, so the SFTP server rejects the operation. The correct path to send is: {color:#0747a6}/sftp/done/file1.txt{color}

 

Error appears to be in the following code:
 * Class: org.apache.nifi.processors.standard.FetchFileTransfer
 * method: performCompletionStrategy
 * Line: transfer.rename(flowFile, filename, targetFile.get{color:#ff0000}Absolute{color}Path());
 ** Correct method to call appears to be targetFile.getPath()

 

 

 

 

 

  was:
Scenario:

NiFi running on windows

 
 # FetchSFTP processor reads files from a remote SFTP server *(ok)*
 # FetchSFTP then is configured to perform a "completion strategy" of moving the fetched files to another remote directory *(fails)*

 

It was found that FetchSFTP (who extends FetchFileTransfer) alters the property "Move Destination Directory" 

 

Example: 
 * Source Remote file:                    /sftp/file1.txt
 * Move Destination Directory:      /sftp/done
 * Intended file after move:           /sftp/done/file1.txt
 * After execution, is is found that FetchSFTP sent the SFTP to rename the file to: {color:#FF0000}C:\sftp\done\file1.txt{color}, so the SFTP server rejects the operation. The correct path to send is: /sftp/done/file1.txt

 

Error appears to be in the following code:
 * Class: org.apache.nifi.processors.standard.FetchFileTransfer
 * method: performCompletionStrategy
 * Line: transfer.rename(flowFile, filename, targetFile.get{color:#FF0000}Absolute{color}Path());
 ** Correct method to call appears to be targetFile.getPath()

 

 

 

 

 


> FetchFileTransfer erroneously alters Destination Directory when performing COMPLETION_STRATEGY
> ----------------------------------------------------------------------------------------------
>
>                 Key: NIFI-9196
>                 URL: https://issues.apache.org/jira/browse/NIFI-9196
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.14.0
>         Environment: MS Windows 10 Version 20H2 (compilation 19042.1165)
> Java SE Runtime Environment (build 16.0.1+9-24)
> Connecting to a remote SFTP server (OpenSSL)
>            Reporter: Layon
>            Priority: Minor
>              Labels: fetchsftp, ftp, transfer, windows
>         Attachments: Capture.PNG
>
>
> Scenario:
> NiFi running on windows
>  
>  # FetchSFTP processor reads files from a remote SFTP server *(ok)*
>  # FetchSFTP then is configured to perform a "completion strategy" of moving the fetched files to another remote directory *(fails)*
>  
> It was found that FetchSFTP (who extends FetchFileTransfer) alters the property "Move Destination Directory" 
>  
> Example: 
>  * Source Remote file:                    /sftp/file1.txt
>  * Move Destination Directory:      /sftp/done
>  * Intended file after move:           /sftp/done/file1.txt
>  * After execution, is is found that FetchSFTP sent the SFTP command to rename the file to: {color:#ff0000}C:\sftp\done\file1.txt{color}, so the SFTP server rejects the operation. The correct path to send is: {color:#0747a6}/sftp/done/file1.txt{color}
>  
> Error appears to be in the following code:
>  * Class: org.apache.nifi.processors.standard.FetchFileTransfer
>  * method: performCompletionStrategy
>  * Line: transfer.rename(flowFile, filename, targetFile.get{color:#ff0000}Absolute{color}Path());
>  ** Correct method to call appears to be targetFile.getPath()
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)