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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to