You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "jrsteinebrey (via GitHub)" <gi...@apache.org> on 2025/10/03 19:04:22 UTC
[PR] NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster [nifi]
jrsteinebrey opened a new pull request, #10384:
URL: https://github.com/apache/nifi/pull/10384
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
# Summary
[NIFI-15043](https://issues.apache.org/jira/browse/NIFI-15043)
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI-15043) issue created
### Pull Request Tracking
- [X] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [X] Pull Request based on current revision of the `main` branch
- [X] Pull Request refers to a feature branch with one commit containing changes
# Verification
I created a NiFi flow on a NiFi cluster which calls the nifi-api rest endpoint affected by this bug.
Before the code change, the nifi-api call failed and I stepped through the debugger to determine the cause.
After the code change, the nifi-api endpoint works in both cluster and standalone modes.
### Build
- [X] Build completed using `./mvnw clean install -P contrib-check`
- [X] JDK 21
- [X] JDK 25
### Licensing
- [X] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [X] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
No dependency changes.
### Documentation
- [X] Documentation formatting appears as expected in rendered files
No documentation changes needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 commented on PR #10384:
URL: https://github.com/apache/nifi/pull/10384#issuecomment-3366933729
Could a system test be added to reproduce the issue? In ClusteredParameterContextIT for example? Or we don't have a way to reproduce it easily?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster [nifi]
Posted by "jrsteinebrey (via GitHub)" <gi...@apache.org>.
jrsteinebrey commented on PR #10384:
URL: https://github.com/apache/nifi/pull/10384#issuecomment-3366950005
Thanks, @pvillard31. I will look into ClusteredParameterContextIT.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster [nifi]
Posted by "jrsteinebrey (via GitHub)" <gi...@apache.org>.
jrsteinebrey commented on PR #10384:
URL: https://github.com/apache/nifi/pull/10384#issuecomment-3366889172
The problem occurs on a clustered NiFi node because it generates a uri to replicate the request to the other Nifi nodes in the cluster. The uri gets looks like this:[ *https://redacted:8443/nifi-api/parameter-contexts/null*|https://redacted:8443/nifi-api/parameter-contexts/null] and gets created on this line:
https://github.com/jrsteinebrey/nifi/blob/423381d4c53e5765d9a92bebf72804f36294bfa7/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/util/ParameterUpdateManager.java#L217
updateUri = new URI(exampleUri.getScheme(), exampleUri.getUserInfo(), exampleUri.getHost(),
exampleUri.getPort(), "/nifi-api/parameter-contexts/" + updatedContext.getId(), null, exampleUri.getFragment());
The uri has "null" in it because ParameterContextEntity updatedContext has a null value for its id instance variable because it never gets set. ParameterContextEntity which extends ComponentEntity has an instance variable called parameterContextDTO which stores the actual id. Other ComponentEntity subclasses store the id directly in their id instance variable.
A robust solution is to make ParameterContextEntity behave consistently with its siblings (other ContextEntity subclasses) by setting the ParameterContextEntity id to equal the parameterContextDTO's id which it holds.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster [nifi]
Posted by "pvillard31 (via GitHub)" <gi...@apache.org>.
pvillard31 closed pull request #10384: NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster
URL: https://github.com/apache/nifi/pull/10384
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-15043: Update Parameter Context Rest API endpoint fails on NiFi cluster [nifi]
Posted by "jrsteinebrey (via GitHub)" <gi...@apache.org>.
jrsteinebrey commented on PR #10384:
URL: https://github.com/apache/nifi/pull/10384#issuecomment-3377886512
@pvillard31 I changed a piece of test code in the second commit. Now my first code change is tested and needed for a successful result by over a dozen integration tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org