[
https://issues.apache.org/jira/browse/NIFI-15739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xinyu Wang updated NIFI-15739:
------------------------------
Description:
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. *_${myparam:isempty()}_*
# 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.
was:
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.
> 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. *_${myparam:isempty()}_*
> # 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)