Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Urgent need for ListSFTP & FetchSFTP working example

Solved Go to solution

Urgent need for ListSFTP & FetchSFTP working example

Contributor

I have been struggling with ListSFTP and FetchSFTP (PFA) as none of them seem to be working and ending up with error below -

java.io.FileNotFoundException: Could not perform listing on /home/temp/ because could not find the file on the remote server

ListSFTP

10642-listsftp.png

FetchSFTP

10643-fetchsftp.png

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Urgent need for ListSFTP & FetchSFTP working example

Setting a remote file to /home/temp/ is wrong. It expects a filename, not a directory. A combination of ListSFTP and FetchSFTP will ensure the filenames are passed to the FestSFTP via a known attribute name.

Here's an example template from the gallery: https://github.com/hortonworks-gallery/nifi-templates/blob/master/templates/List_and_Fetch_SFTP_temp...

6 REPLIES 6

Re: Urgent need for ListSFTP & FetchSFTP working example

Setting a remote file to /home/temp/ is wrong. It expects a filename, not a directory. A combination of ListSFTP and FetchSFTP will ensure the filenames are passed to the FestSFTP via a known attribute name.

Here's an example template from the gallery: https://github.com/hortonworks-gallery/nifi-templates/blob/master/templates/List_and_Fetch_SFTP_temp...

Re: Urgent need for ListSFTP & FetchSFTP working example

Contributor

Thanks @Andrew Grande for the quick response. The problem however is with ListFile above, as you can see I have specified the path /home/temp to the 'Remote Path', should that not first enlist all the files in that directory, which then I believe will be sent over to FetchFile as flowfile, right?

Re: Urgent need for ListSFTP & FetchSFTP working example

You removed all details from the configuration. Do you have the 'temp' user? Which user do you use for SFTP login? Normally you wouldn't have access to other users' home directories. Try using a directory outside of /home and set correct permissions on it.

Re: Urgent need for ListSFTP & FetchSFTP working example

Shouldn't the FetchSFTP Remote File be set to ${path}/${filename} which are the attributes produced by ListSFTP?

Re: Urgent need for ListSFTP & FetchSFTP working example

Contributor

@Andrew Grande & @Bryan Bende, you guys ROCK!!! It was actually a permissions issue which I fixed. Thank you, appreciate it.

Re: Urgent need for ListSFTP & FetchSFTP working example

New Contributor
@Andrew Grande

I have the same issue but for the GETSFTP processor .Filenotfound exception.

screenshot-from-2018-03-09-13-24-26.png