[
https://issues.apache.org/jira/browse/NIFI-15748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bryan Bende updated NIFI-15748:
-------------------------------
Status: Patch Available (was: In Progress)
> Parameter Context update fails when removing inherited context that has
> asset-referencing parameters
> ----------------------------------------------------------------------------------------------------
>
> Key: NIFI-15748
> URL: https://issues.apache.org/jira/browse/NIFI-15748
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Bryan Bende
> Assignee: Bryan Bende
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When updating a Parameter Context to remove an inherited Parameter Context
> that contains a parameter referencing an Asset, the update request fails with:
> {code:java}
> Request contains a reference to an Asset (AssetReferenceDTO[id=...,
> name=...]) that does not exist in Parameter Context (...) {code}
>
> The root cause is in
> {{{}ParameterContextResource.validateAssetReferences(){}}}.
> When the UI submits a parameter context update, the request body includes the
> full merged parameter list (including inherited parameters marked with
> {{{}inherited=true{}}}). The validation iterates over all parameters and
> checks that each referenced asset belongs to the parameter context being
> updated. However, assets belonging to inherited parameters are owned by their
> originating child context, not the parent. The validation fails because it
> does not skip inherited parameters, even though downstream persistence logic
> ({{{}StandardParameterContextDAO.getParameters(){}}}) already correctly
> ignores them.
> Steps to Reproduce
> # Create two Parameter Contexts — "ChildA" and "ChildB"
> # Upload an Asset to ChildA (e.g., a text file)
> # Add a parameter to ChildA (e.g., "fileToIngest") and set it to reference
> the uploaded Asset
> # Create a third Parameter Context ("Parent") that inherits both ChildA and
> ChildB
> # Edit the Parent context and remove ChildA from the inherited contexts list
> # Click Apply
--
This message was sent by Atlassian Jira
(v8.20.10#820010)