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

Flows with SolrProcessor configured to use SSLContextService is failing

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.12.0
    • Fix Version/s: 1.12.0
    • Component/s: Extensions
    • Labels:
      None

      Description

      After applying the fix in NIFI-7269, flows using SolrProcessors that are configured to use SSLContextService are failing with exception: 

      java.lang.UnsupportedOperationException: null
              at org.apache.http.impl.client.InternalHttpClient$1.getSchemeRegistry(InternalHttpClient.java:239)
              at org.apache.nifi.processors.solr.SolrUtils.createSolrClient(SolrUtils.java:236)
              at org.apache.nifi.processors.solr.SolrProcessor.createSolrClient(SolrProcessor.java:147)
              at org.apache.nifi.processors.solr.SolrProcessor.onScheduled(SolrProcessor.java:77)
              at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142)
              at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130)
              at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:75)
              at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:52)
              at org.apache.nifi.controller.StandardProcessorNode.lambda$initiateStart$4(StandardProcessorNode.java:1515)
              at org.apache.nifi.engine.FlowEngine$3.call(FlowEngine.java:123)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)

      This is because of the new httpclient version that was pulled as a dependency as part of the solrj upgrade in NIFI-7269. The getConnectionManager method in HttpClient is deprecated and the way to set the schema registry has changed in the new version of HttpClient. The problematic code is

      httpClient.getConnectionManager().getSchemeRegistry().register(httpsScheme);
      

      in function createSolrClient. There is no test coverage for this function which is why it was not detected in the code changes for NIFI-7269.
       

        Attachments

          Activity

            People

            • Assignee:
              bbende Bryan Bende
              Reporter:
              mkazia Mubashir Kazia
            • Votes:
              0 Vote for this issue
              Watchers:
              3 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