[
https://issues.apache.org/jira/browse/NIFI-15739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18068100#comment-18068100
]
Daniel Stieglitz edited comment on NIFI-15739 at 3/24/26 6:31 PM:
------------------------------------------------------------------
[~xwang2026] I do not think there is an error regarding the invalid expression
language. I believe the FlowFile keeps on being processed since the Groovy
script does not direct the FlowFile to the correct relationship. I mimicked
your steps with the Generate FlowFile, the invalid Expression Language
statement in the dynamic property, Failure Strategy set to "transfer to
failure" and my Groovy script handled the FlowFile and it got transferred to
the SUCCESS relationship. Below is the Groovy script I used
{code:java}
flowFile = session.get()
if (!flowFile) {
log.warn("Flow file was empty")
return
}
try {
log.warn("Calling simple assert")
assert true
log.warn("After calling assert")
session.transfer(flowFile, REL_SUCCESS)
} catch (Exception e) {
log.error("Error occurred, details:", e)
session.transfer(flowFile, REL_FAILURE)
} {code}
was (Author: JIRAUSER294662):
[~xwang2026] I do not think there is an error regarding the invalid expression
language. I believe the FlowFile keeps on being processed since the Groovy
script does not direct the FlowFile to the correct relationship. I mimicked
your steps with the Generate FlowFile, the invalid Expression Language
statement in the dynamic property, Failure Strategy set to "transfer to
failure" and my Groovy script handled the FlowFile and it got transferred to
the SUCCESS relationship. Below is the Groovy script I used
{code:java}
flowFile = session.get()if (!flowFile) {
log.warn("Flow file was empty")
return
}try {
log.warn("Calling simple assert")
assert true
log.warn("After calling assert")
session.transfer(flowFile, REL_SUCCESS)
} catch (Exception e) {
log.error("Error occurred, details:", e)
session.transfer(flowFile, REL_FAILURE)
} {code}
> ExecuteGroovyScript: FlowFile not transferred to failure when dynamic
> property contains Expression Language syntax error
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-15739
> URL: https://issues.apache.org/jira/browse/NIFI-15739
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 2.5.0
> Reporter: Xinyu Wang
> Priority: Major
>
> When an ExecuteGroovyScript processor has a dynamic property whose value
> contains an Expression Language syntax error, and the Failure Strategy is set
> to "transfer to failure", the FlowFile in the upstream queue is not
> transferred to the failure relationship. Instead, the FlowFile remains stuck
> in the incoming queue, and the processor enters an infinite error loop —
> logging the same error on every scheduling trigger.
> *Root Cause*
> In ExecuteGroovyScript.onTrigger(), the execution order is:
> # Evaluate dynamic properties — iterates context.getProperties() and calls
> evaluateAttributeExpressions() on each dynamic property value
> # Execute script — where session.get() is typically called by user code to
> dequeue a FlowFile
> The GroovyProcessSessionWrap maintains a toFail list that is only populated
> when session.get() is called.
> When a dynamic property has an EL syntax error:
> * The exception is thrown at step 1
> * script.run() (step 2) is never reached
> * session.get() is never called
> * toFail list remains empty
> * The catch block calls session.revertReceivedTo(REL_FAILURE, t), which
> iterates over the empty toFail list — effectively a no-op
> * The FlowFile was never dequeued, so it stays in the incoming connection
> *Steps to Reproduce*
> # Create a flow: GenerateFlowFile → ExecuteGroovyScript
> # In ExecuteGroovyScript, set Failure Strategy to "Transfer to failure"
> # Add a dynamic property (e.g. myProp) with an invalid EL expression as
> value, e.g. $\{invalid::
> # Add a simple script body
> # Connect the failure relationship to a downstream processor (e.g.
> LogAttribute)
> # Start the flow
> {*}Expected{*}: FlowFile is transferred to the failure relationship with
> ERROR_MESSAGE and ERROR_STACKTRACE attributes.
> {*}Actual{*}: FlowFile remains stuck in the incoming queue. The processor
> logs the expression language error repeatedly on every trigger. Nothing is
> ever routed to failure.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)