Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-10787

Cannot commit flows to nifi registry after updating our nifi release to 1.18.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.18.0
    • 1.19.0
    • Flow Versioning
    • 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

        1. stacktrace_nifi_registry.txt
          13 kB
          Ahsan
        2. stacktrace_nifi.txt
          16 kB
          Ahsan
        3. index.png
          408 kB
          Ahsan

        Issue Links

          Activity

            People

              sedad Seda Dogan
              ahsan.fayyaz Ahsan
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h