Support Questions

Find answers, ask questions, and share your expertise

Error "File used" on the "FetchFile"

avatar
New Contributor

through the process "EcexecuteProcess" interrogate within a directory. I get the file paths. Then the path to the files are transferred to the process "FetchFile". The process "FetchFile" produces an error that the file is in use by another application, if the file is still being written. How to exclude this error with the process? It is possible to advance the opportunity to check the file to transfer before the transfer process "FetchFile"?

2 REPLIES 2

avatar
Master Guru

FetchFile employs the following outgoing relationships:

successAny FlowFile that is successfully fetched from the file system will be transferred to this Relationship.
not.foundAny FlowFile that could not be fetched from the file system because the file could not be found will be transferred to this Relationship.
permission.deniedAny FlowFile that could not be fetched from the file system due to the user running NiFi not having sufficient permissions will be transferred to this Relationship.
failureAny FlowFile that could not be fetched from the file system for any reason other than insufficient permissions or the file not existing will be transferred to this Relationship.

You could handle the non-success cases by routing the other relationship(s) back to FetchFile. Each non-success flow file will be penalized (the default is 30 seconds but is configurable). Then when processing the file no longer causes an error, it should be successfully processed and transferred to the success relationship.

avatar
New Contributor

I understand. The files fall into the channel. But the error is displayed on the process "FetchFile". Because of the very large number, you can miss important errors. I would like to somehow not eliminate errors. Is there not a process that would scan the file for possible to transfer