[
https://issues.apache.org/jira/browse/NIFI-10787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nathan Gough resolved NIFI-10787.
---------------------------------
Fix Version/s: 1.19.0
Resolution: Fixed
> Cannot commit flows to nifi registry after updating our nifi release to 1.18.0
> ------------------------------------------------------------------------------
>
> Key: NIFI-10787
> URL: https://issues.apache.org/jira/browse/NIFI-10787
> Project: Apache NiFi
> Issue Type: Bug
> Components: Flow Versioning
> Affects Versions: 1.18.0
> Reporter: Ahsan
> Assignee: Seda Dogan
> Priority: Blocker
> Fix For: 1.19.0
>
> Attachments: index.png, stacktrace_nifi.txt,
> stacktrace_nifi_registry.txt
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> 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.
> {code:java}
> private String getRegistryUrl(final FlowRegistryClientNode registry) {
> return
> registry.getComponentType().equals("org.apache.nifi.registry.flow.NifiRegistryFlowRegistryClient")
> ? registry.getRawPropertyValue(registry.getPropertyDescriptor("URL")) : "";
> } {code}
> 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
> {color:#6a8759}"NifiRegistryFlowRegistryClient", {color}the url property is
> described as following:
> {code:java}
> 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();{code}
> 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".
> {code:java}
> // hash def of
> nifi-api/src/main/java/org/apache/nifi/components/PropertyDescriptor.java
> @Override
> public int hashCode() {
> return 287 + this.name.hashCode() * 47;
> } {code}
> 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:
>
> !index.png!
>
> Regards
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)