Possibly similar to
NIFI-7177 as they're not able to delete files with the GetSFTP processor, but they're getting a different error than I am.
I'm using the FetchSFTP processor to get data from a third party SFTP server, I don't have a lot of details on version or configuration on their end. I have noticed that neither the "Move File" or "Delete File" Completion Strategy options work.
When using "Delete File" as the Completion Strategy I get no alert/bulletin from NiFi to show that anything went wrong, however, the original file has not been deleted. I can manually delete the file using an SFTP client with the same username/password that NiFi connects as.
When using "Move File" as the Completion Strategy I get this warning message when NiFi tries to move the file after completion:
As with deletion, I am able manually move (rename) the file using an SFTP client with the same username/password that NiFi connects as.
However, I will add that I'm only able to delete or move the file PRIOR to NiFi fetching the file. If I try to do it immediately after NiFi has fetched the file, I'll get the exact same "no such file or directory" error from the SFTP server when using my local client. If I wait some arbitrary amount of time after NiFi has fetched the file, I am then able to delete or move the file.
I've also noticed the below sequence of events:
- NiFi lists the files on the SFTP server
- NiFi fetches the files on the SFTP server
- NiFi attempts to delete or move the files on the SFTP server and fails
- I immediately attempt to delete or move the files on the SFTP server and fail
- I stop the FetchSFTP processor in NiFi
- I immediately attempt to delete or move the files on the SFTP server and it succeeds
This leads me to believe that there is some sort of locking behavior happening where the fetch operation keeps the file locked for some arbitrary amount of time or until the fetch processor is stopped, which is preventing any other operation from taking place on the file.
Interestingly enough, I was able to get both the "Delete File" and "Move File" Completion Strategies to work when I spun up a basic SFTP server on my own. It sounds like there is something specific with how locks are handled with this third part SFTP server I'm connecting to and how NiFi uses (or re-uses) SFTP clients/connections.
As mentioned above, I unfortunately don't have a lot of information about this SFTP server I'm connecting to, the vendor has been very tight-lipped about their configuration for some reason.
If there's anything else you need me to provide, please let me know.