Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16635

Bad PublicKeyHandler configuration when using MiniSolrCloudCluster

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 9.0, 9.1, main (10.0)
    • main (10.0), 9.2
    • test-framework
    • None

    Description

      I changed some external test code to use Solr 9.1 and I started getting this exception when using MiniSolrCloudCluster:


      14:55:25.477 [jetty-launcher-7-thread-1] ERROR org.apache.solr.servlet.CoreContainerProvider - Could not start Solr. Check solr/home property and the logs
      14:55:25.498 [jetty-launcher-7-thread-1] ERROR org.apache.solr.core.SolrCore - null
      java.lang.RuntimeException: Bad PublicKeyHandler configuration.
      	at org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:386)
      	at org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:363)
      	at org.apache.solr.servlet.CoreContainerProvider.createCoreContainer(CoreContainerProvider.java:376)
      	at org.apache.solr.servlet.CoreContainerProvider.init(CoreContainerProvider.java:226)
      	at org.apache.solr.client.solrj.embedded.JettySolrRunner$1.lifeCycleStarted(JettySolrRunner.java:402)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.setStarted(AbstractLifeCycle.java:194)
      	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:74)
      	at org.apache.solr.client.solrj.embedded.JettySolrRunner.retryOnPortBindFailure(JettySolrRunner.java:614)
      	at org.apache.solr.client.solrj.embedded.JettySolrRunner.start(JettySolrRunner.java:552)
      	at org.apache.solr.client.solrj.embedded.JettySolrRunner.start(JettySolrRunner.java:523)
      	at org.apache.solr.cloud.MiniSolrCloudCluster.startJettySolrRunner(MiniSolrCloudCluster.java:550)
      	at org.apache.solr.cloud.MiniSolrCloudCluster.lambda$new$0(MiniSolrCloudCluster.java:355)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:271)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:829)
      Caused by: java.net.MalformedURLException: no protocol: cryptokeys/priv_key512_pkcs8.pem
      	at java.base/java.net.URL.<init>(URL.java:645)
      	at java.base/java.net.URL.<init>(URL.java:541)
      	at java.base/java.net.URL.<init>(URL.java:488)
      	at org.apache.solr.security.PublicKeyHandler.createKeyPair(PublicKeyHandler.java:59)
      	at org.apache.solr.security.PublicKeyHandler.<init>(PublicKeyHandler.java:42)
      	at org.apache.solr.core.CoreContainer.<init>(CoreContainer.java:384)
      	... 16 common frames omitted
      

      I believe the issue may have been introduced by SOLR-14223, in particular, this code. I believe we don't hit this in Solr because of this code, so I'm forced to do something like this in my external code, or at least do something like:


      System.setProperty("pkiHandlerPublicKeyPath", "");
      System.setProperty("pkiHandlerPrivateKeyPath", "");
      

      which I doubt it's the intention. We can have MiniSolrCloudCluster resolve the location of the crypto keys and use that in the default solr.xml string that it includes.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tflobbe Tomas Eduardo Fernandez Lobbe
            tflobbe Tomas Eduardo Fernandez Lobbe
            Votes:
            0 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 - 40m
                40m

                Slack

                  Issue deployment