Hi,

Please see the discussion on https://issues.apache.org/jira/browse/NIFI-15955

Thanks,
Pierre

Le jeu. 21 mai 2026 à 18:23, DesRoches, Jody J CIV STRATCOM JWAC (USA)
via users <[email protected]> a écrit :
>
> Hi everyone,
>
>
> I wanted to reach out to the list to see if anyone else has run into this 
> issue, or if this is a known bug in Apache NiFi 2.9.0's ExecuteGroovyScript 
> processor.  I verified on a Nifi 2.7.2 cluster, the issue does not exist.
>
> It appears that configuring the Failure Strategy property to "transfer to 
> failure" completely breaks session commits—even for trivial, perfectly valid 
> scripts that complete successfully with no errors.
>
> ________________________________
>
> 🚨 The Symptoms
>
> Whenever Failure Strategy is set to "transfer to failure", any script running 
> in the processor yields and throws the following dual session exceptions 
> back-to-back:
>
> org.apache.nifi.processor.exception.FlowFileHandlingException: 
> StandardFlowFileRecord[...] transfer relationship not specified. This 
> FlowFile was not created in this session and was not transferred to any 
> Relationship via ProcessSession.transfer()
> org.apache.nifi.processor.exception.FlowFileHandlingException: 
> StandardFlowFileRecord[...] is not known in this session 
> (StandardProcessSession[id=...])
>
> ________________________________
>
> 🛠️ How to Reproduce
>
> You can easily reproduce this behavior with a single queue and a basic, 
> error-free script:
>
> Add an ExecuteGroovyScript processor to your canvas.
> Set the Failure Strategy property to transfer to failure.
> Set the Script Body to:
>
> def flowfile = session.get()
>
> if (!flowfile) return
>
> REL_SUCCESS << flowfile
>
> Pass a single FlowFile into the processor.
>
> Even though the script successfully grabs the FlowFile and routes it to 
> success, the processor will fail to commit, log both of the errors above, 
> yield, and leave the FlowFile unprocessed.
>
> Switching the Failure Strategy back to "rollback" immediately resolves the 
> issue and allows the same script to run perfectly.
>
> ________________________________
>
> 💡 Temporary Workaround
>
> If you are facing this, the current workaround is to keep the Failure 
> Strategy set to "rollback" and handle routing manually inside your Groovy 
> script using a try-catch block:
>
> groovy
>
> def flowfile = session.get()
>
> if (!flowfile) return
>
>
>
> try {
>
>     // Your processing logic here...
>
>     session.transfer(flowfile, REL_SUCCESS)
>
> } catch (Exception e) {
>
>     log.error("Script failed", e)
>
>     session.transfer(flowfile, REL_FAILURE)
>
> }
>
>
>
> Is anyone else seeing this behavior on NiFi 2.x, or is there an active JIRA 
> issue tracking this?
>
> Thanks!
>
>
>
> Jody Des Roches
>
> [email protected]
>
>

Reply via email to