Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
1.18.0
-
None
Description
Hi,
So we recently updated to Nifi 1.18.0 and registry to 1.18.0.
Some portions of our flows were for no reason not "Commitable" any more. Attached are the stacktraces from nifi and nifi-registry, when we click the commit local changes button in nifi.
Thinking this is a problem on our end, we debugged the issue and found out the following:
The method in "src/main/java/org/apache/nifi/registry/flow/mapping/NiFiRegistryFlowMapper.java" below is where things trip and we get a NPE.
private String getRegistryUrl(final FlowRegistryClientNode registry) { return registry.getComponentType().equals("org.apache.nifi.registry.flow.NifiRegistryFlowRegistryClient") ? registry.getRawPropertyValue(registry.getPropertyDescriptor("URL")) : ""; }
If you note the call "registry.getPropertyDescriptor("URL")" with the hard-coded string "URL", this is failing although the property is there BUT with the name in small case "url".
I say this is because if we look at the class "NifiRegistryFlowRegistryClient", the url property is described as following:
public final static PropertyDescriptor PROPERTY_URL = new PropertyDescriptor.Builder() .name("url") .displayName("URL") .description("URL of the NiFi Registry") .addValidator(StandardValidators.URL_VALIDATOR) .required(true) .build();
And if you note the property name is described with small case "url". Hence PropertyDescriptor which bases its hash on the "name" property fails when we search with uppercase "URL".
// hash def of nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java @Override public int hashCode() { return 287 + this.name.hashCode() * 47; }
Hope I have helped here. Can someone fix this issue. We cannot commit in our registry currently because of the NPE.
Just in case the debug stacktrace is important showing the src PropertyDescription being used to search for in the map, I attach it here:
Regards
Attachments
Attachments
Issue Links
- is related to
-
NIFI-10816 Nested versioning not working after upgrading to 1.18.0
- Resolved
- links to