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

[jira] [Commented] (SOLR-16635) Bad PublicKeyHandler configuration when using MiniSolrCloudCluster

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

ASF subversion and git services commented on SOLR-16635:
--------------------------------------------------------

Commit be5ad010520a438f1274b995c844281d81bb8032 in solr's branch refs/heads/main from Tomas Eduardo Fernandez Lobbe
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=be5ad010520 ]

SOLR-16635: Resolve crypto keys file path in MiniSolrCloudCluster (#1312)

This eliminates the need to set the system properties `pkiHandlerPublicKeyPath` and `pkiHandlerPrivateKeyPath` before starting MiniSolrCloudCluster when using the Solr test framework.

> Bad PublicKeyHandler configuration when using MiniSolrCloudCluster
> ------------------------------------------------------------------
>
>                 Key: SOLR-16635
>                 URL: https://issues.apache.org/jira/browse/SOLR-16635
>             Project: Solr
>          Issue Type: Bug
>          Components: test-framework
>    Affects Versions: 9.0, 9.1, main (10.0)
>            Reporter: Tomas Eduardo Fernandez Lobbe
>            Assignee: Tomas Eduardo Fernandez Lobbe
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> I changed some external test code to use Solr 9.1 and I started getting this exception when using MiniSolrCloudCluster:

> {noformat}
> 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
> {noformat}
> I believe the issue may have been introduced by SOLR-14223, in particular, [this code|https://github.com/apache/lucene-solr/pull/1217/files#diff-c3ed2e54e8d8f256575f36532ab4eec6d9e7424e0a6fd237cdbfcefa5fcbaeb0R116-R117]. I believe we don't hit this in Solr because of [this code|https://github.com/apache/lucene-solr/pull/1217/files#diff-7cb8f3a46dbdb99ccfdcc1d07c4457167188e7366534a7e7e4a0b5aff93c1cc4R304-R305], so I'm forced to do something like this in my external code, or at least do something like:

> {code:java}
> System.setProperty("pkiHandlerPublicKeyPath", "");
> System.setProperty("pkiHandlerPrivateKeyPath", "");
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org