Search code examples
apache-nifiibm-midrange

Apache Nifi put file on iSeries FTP


At this time, it isn't possible to interact with an iSeries IFS using Nifi. If this is something that you need, I recommend heading over and voting/commenting.

Opened an enhancement with ASF

Edit: I created a dynamic property pre.cmd._____ per a suggestion below and seem to still be having the same issue. Perhaps I'm not creating this correctly? I've tried quoting and a few other variations with no success: enter image description here

Looking to use Apache Nifi (1.11.4) for some near real time file movements and one requirement of mine is to FTP a file to an FTP hosted on an iSeries.

An iSeries has two formats when utilizing FTP, NAMEFMT 0 when accessing libraries, physical files, and members, and NAMEFMT 1 when accessing the IFS. More on that if you're interested...

I set up what I thought was a very simple process to get acquainted, detect when a file is placed on an SFTP, and simply move it on over to our iSeries: Nifi flow

The problem I'm having is that I'm simply trying to place the file on the IFS in my home directory /home/dkorinke. However, the PutFTP is erroring as it seems to be using NAMEFMT 0 and when changing directory to /home/dkorinke.

From the logs:

2020-06-10 21:09:36,924 ERROR [Timer-Driven Process Thread-6] o.apache.nifi.processors.standard.PutFTP PutFTP[id=a084128f-0172-1000-49e1-fdd7b9d8d129] Unable to transfer StandardFlowFileRecord[uuid=72600f74-2678-4c33-870a-f2648aac034b,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1591830969408-1, container=default, section=1], offset=463787, length=104801],offset=0,name=My_File.csv,size=104801] to remote host DEVQA01 due to org.apache.nifi.processor.exception.ProcessException: Unable to change working directory to /HOME/DKORINKE/: null; routing to failure

I began playing around with the Remote Path property on the PutFTP and was able to get a different error when using "/HOME/DKORINKE/". I noticed QGPL/ in front of "/HOME/DKORINKE":

2020-06-10 21:53:35,710 ERROR [Timer-Driven Process Thread-5] o.apache.nifi.processors.standard.PutFTP PutFTP[id=a084128f-0172-1000-49e1-fdd7b9d8d129] Unable to transfer StandardFlowFileRecord[uuid=14303c7c-babb-4cbf-9728-346e0afaafba,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1591830969408-1, container=default, section=1], offset=882991, length=104801],offset=0,name=My_File.csv,size=104801] to remote host DEVQA01 due to org.apache.nifi.processor.exception.ProcessException: Unable to change working directory to QGPL/"/HOME/DKORINKE/": null; routing to failure

So far, the only solution I can think of is to update my user profile to default to NAMEFMT 1 which I'm not entirely sure is possible. I've hit the Google pretty hard this evening but I haven't been able to find anyone having a similar use case or issue like this.


Solution

  • Wanting to close the loop on this for anyone looking to get this working.

    Using Nifi v1.22.0 and an iSeries on V7R5M0, I was able to get a simple text file to be processed via FTP onto the iSeries.

    enter image description here

    enter image description here

    This now seems to work pretty out of the box with Nifi now.