[ 
https://issues.apache.org/jira/browse/NIFI-16616?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joe Witt updated NIFI-16616:
----------------------------
    Status: Patch Available  (was: Open)

https://github.com/apache/nifi/pull/11955

> Canvas search does not resolve Parameter Context values for Searchable 
> processors (ExecuteScript Script File)
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-16616
>                 URL: https://issues.apache.org/jira/browse/NIFI-16616
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 2.12.0
>            Reporter: Joe Witt
>            Assignee: Joe Witt
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Canvas search (GET /nifi-api/flow/search-results) logs FileNotFoundException 
> for every ExecuteScript (and other Searchable scripting processors) whose 
> Script File is parameterized, e.g. #{scripts.dir}/file.groovy.
> The processor runs correctly. FlowFiles are unaffected. Search resolves the 
> path without the Parameter Context, so it tries to read /file.groovy.
> SearchableMatcher builds a StandardSearchContext. getProperty() wraps the raw 
> configured value with ParameterLookup.EMPTY. ScriptingComponentUtils.search 
> then calls evaluateAttributeExpressions() and opens that path. Runtime 
> evaluation uses ProcessorNode.getParameterLookup(), which is the process 
> group's Parameter Context.
> This is present on 2.7.2 and still present on main. It is a framework 
> search-context bug, not a script-execution bug.
> Expected: Search substitutes Parameter Context values the same way 
> scheduling/runtime does, then searches the script contents (or skips quietly 
> if the file is absent).
> Actual: #{param} is stripped, the remaining path is opened, and each search 
> logs an error.
> Fix: StandardSearchContext.getProperty should use 
> processorNode.getParameterLookup() instead of ParameterLookup.EMPTY.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to