Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-9196

FetchFileTransfer erroneously alters Destination Directory when performing COMPLETION_STRATEGY

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.14.0
    • 2.0.0-M1, 1.21.0
    • Core Framework
    • 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)

    Description

      Scenario:

      NiFi running on windows

       

      1. FetchSFTP processor reads files from a remote SFTP server (ok)
      2. 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: C:\sftp\done\file1.txt, 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.getAbsolutePath());
        • Correct method to call appears to be targetFile.getPath()

       

       

       

       

       

      Attachments

        1. Capture.PNG
          121 kB
          Layon

        Issue Links

          Activity

            People

              emilio.setiadarma Emilio Setiadarma
              Layon Layon
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m