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

Improve error handling during auto-loading of NARs

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.9.0
    • 1.10.0, 1.9.1
    • None
    • None

    Description

      If you copy in several NARs where one of them has a framework level extension like an authorizers, repository, or state manager, it will produce an exception like the following:

      2019-02-19 10:37:20,397 ERROR [NAR Auto-Loader] org.apache.nifi.nar.NarAutoLoaderTask Error loading NARs due to: Attempt was made to load org.apache.nifi.provenance.PersistentProvenanceRepository from org.apache.nifi:nifi-provenance-repository-nar:1.9.0-SNAPSHOT but that class name is already loaded/registered from org.apache.nifi:nifi-provenance-repository-nar:1.9.0 and multiple versions are not supported for this type
      java.lang.IllegalStateException: Attempt was made to load org.apache.nifi.provenance.PersistentProvenanceRepository from org.apache.nifi:nifi-provenance-repository-nar:1.9.0-SNAPSHOT but that class name is already loaded/registered from org.apache.nifi:nifi-provenance-repository-nar:1.9.0 and multiple versions are not supported for this type
              at org.apache.nifi.nar.StandardExtensionDiscoveringManager.registerServiceClass(StandardExtensionDiscoveringManager.java:289)
              at org.apache.nifi.nar.StandardExtensionDiscoveringManager.loadExtensions(StandardExtensionDiscoveringManager.java:181)
              at org.apache.nifi.nar.StandardExtensionDiscoveringManager.discoverExtensions(StandardExtensionDiscoveringManager.java:127)
              at org.apache.nifi.nar.StandardNarLoader.load(StandardNarLoader.java:110)
              at org.apache.nifi.nar.NarAutoLoaderTask.run(NarAutoLoaderTask.java:128)
              at java.lang.Thread.run(Thread.java:748)

      The exception itself is not an issue because it is correct that we don't support multiple versions of these types of extensions.

      The issue is that during the auto-loading process we call discoverExtensions on a set of bundles:

      extensionManager.discoverExtensions(loadedBundles);

      If the above exception happens during this call, it will bounce out and not discover any other extensions that may still be available for loading.

       

      Attachments

        Issue Links

          Activity

            People

              bbende Bryan Bende
              bbende Bryan Bende
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 0.5h
                  0.5h