You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/11/17 00:10:00 UTC

[jira] [Commented] (NIFI-10787) Cannot commit flows to nifi registry after updating our nifi release to 1.18.0

    [ https://issues.apache.org/jira/browse/NIFI-10787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17635043#comment-17635043 ] 

ASF subversion and git services commented on NIFI-10787:
--------------------------------------------------------

Commit 009d641576499c5cdfb940a422996bbdce7dfda3 in nifi's branch refs/heads/main from sedadgn
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=009d641576 ]

NIFI-10787 - Cannot commit flows to nifi registry after updating our nifi release to 1.18.0
 NifiRegistryFlowRegistryClient defines the PropertyDescriptor PROPERTY_URL  name as small case "url". The map bases on the name property of the PropertyDescriptor object. Here searching with uppercase value of "URL" causes the map lookup to fail and cause a NPE later on. Therefore, it is changed as "url"

NIFI-10787 - Added constant for property descriptor "url" in NiFiRegistryFlowMapper to make it more clear.

NIFI-10787 - Added change to unit test.

NIFI-10787 - Updated unit test to validate that NiFi registry url is being set and retrieved.

Signed-off-by: Nathan Gough <th...@gmail.com>

This closes #6655.


> 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
>         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)