Created on 12-21-2016 06:16 PM - edited 08-18-2019 04:12 AM
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
FetchSFTP
Created 12-21-2016 06:24 PM
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...
Created 12-21-2016 06:24 PM
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...
Created 12-21-2016 06:38 PM
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?
Created 12-21-2016 06:49 PM
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.
Created 12-21-2016 08:01 PM
Shouldn't the FetchSFTP Remote File be set to ${path}/${filename} which are the attributes produced by ListSFTP?
Created 12-23-2016 05:38 AM
@Andrew Grande & @Bryan Bende, you guys ROCK!!! It was actually a permissions issue which I fixed. Thank you, appreciate it.
Created 03-09-2018 08:02 AM
I have the same issue but for the GETSFTP processor .Filenotfound exception.