You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Geoff Greene (Jira)" <ji...@apache.org> on 2026/05/19 22:58:00 UTC

[jira] [Comment Edited] (NIFI-15955) Possible NiFi 2.9.0 bug: groovyx ExecuteGroovyScript fails when Failure Strategy = "transfer to failure"

    [ https://issues.apache.org/jira/browse/NIFI-15955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18082174#comment-18082174 ] 

Geoff Greene edited comment on NIFI-15955 at 5/19/26 10:57 PM:
---------------------------------------------------------------

{{a potential work around seems to be using rollback but then using this framework}}

 
{code:java}
flowFile = session.get()
if (!flowFile) return }}
def relationship = REL_FAILURE
try
{
    // work that can throw 
    relationship = REL_SUCCESS
}
catch (Throwable t) }}
{
    log.error("script failed", t) }}
}
finally
{
    session.transfer(flowFile, relationship)
}
{code}
 


was (Author: goofwithz3):
{{a potential work around seems to be using rollback but then using this framework}}

{{def flowFile = session.get()}}
{{if (!flowFile) return }}
{{def relationship = REL_FAILURE }}
{{try }}
{{{ }}
{{// work that can throw }}
{{    relationship = REL_SUCCESS }}
{{} catch (Throwable t) }}
{{{ }}{{    log.error("script failed", t) }}
{{}}}
{{finally }}
{{{ }}
{{    session.transfer(flowFile, relationship) }}
{{}}}

> Possible NiFi 2.9.0 bug: groovyx ExecuteGroovyScript fails when Failure Strategy = "transfer to failure"
> --------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-15955
>                 URL: https://issues.apache.org/jira/browse/NIFI-15955
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 2.9.0
>         Environment: - NiFi: 2.9.0
> - Processor: org.apache.nifi.processors.groovyx.ExecuteGroovyScript (nifi-groovyx-nar 2.9.0)
>            Reporter: Geoff Greene
>            Priority: Critical
>
> Subject:
>  
> Hi all,
>  
> We just upgraded to NiFi 2.9.0 and I believe we’ve identified a critical issue in the groovyx ExecuteGroovyScript processor. 
> Minimal reproduction:
> Flow:
> GenerateFlowFile -> ExecuteGroovyScript
>  
> simple ExecuteGroovyScript script:
> def ff = session.get()
> if (!ff) return
> session.transfer(ff, REL_SUCCESS)
>  
> Behavior:
>  - If Failure Strategy = "rollback": works as expected
>  - If Failure Strategy = "transfer to failure": commit fails even though the script transfers to REL_SUCCESS
>  
> Even on the transfer to failure setting, the flow file remains in the incoming queue, and  I get the bulletin:
>  
> ExecuteGroovyScript[id=4250f809-019e-1000-ba2b-dc7f5d729518] org.apache.nifi.processor.exception.FlowFileHandlingException:
> ... transfer relationship not specified. This FlowFile was not created in this session and was not transferred to any Relationship via ProcessSession.transfer()
>  
> Then a follow-on error:
> ExecuteGroovyScript[id=4250f809-019e-1000-ba2b-dc7f5d729518] ... is not known in this session (StandardProcessSession[id=])
>  
> I'd really like to see a fix in 2.9.1



--
This message was sent by Atlassian Jira
(v8.20.10#820010)