hello folks,
we’re in process of upgrading our Solr from 8.11 to 9.0. While upgrading the 
image for CI tests (meaning solr runs in standalone mode), we’ve spotted that 
Solr fails to create cores with a “NullPointerException" error when 
“shardHandlerFactory” is defined for any handlers in the solrconfig.xml file.

Snippet from solrconfig.xml:

<requestHandler name="/select" class="solr.SearchHandler" default="true”>
…..
        <shardHandlerFactory name="shardHandlerFactory" 
class="HttpShardHandlerFactory">
            <int name="socketTimeout">${socketTimeout:800}</int>
            <int name="connTimeout">${connTimeout:500}</int>
        </shardHandlerFactory>
</requestHandler>

Snippet of NullPointerException (full text here: https://justpaste.it/5lntq 
<https://justpaste.it/5lntq> ):

olxeu-atlas-web-dist-solr-1  | Caused by: java.lang.NullPointerException
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.handler.component.HttpShardHandlerFactory.setSecurityBuilder(HttpShardHandlerFactory.java:299)
 ~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.handler.component.SearchHandler.inform(SearchHandler.java:185) 
~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:722) 
~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:1155) ~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.core.SolrCore.<init>(SolrCore.java:1048) ~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1560)
 ~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
org.apache.solr.core.CoreContainer.lambda$load$10(CoreContainer.java:950) ~[?:?]
olxeu-atlas-web-dist-solr-1  |  at 
com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:202)
 ~[metrics-core-4.1.5.jar:4.1.5]

Steps:
1. Run library/solr:9.0.0 in docker (default config, no tunings); mount a 
volume with solrconfig.xml that contains shardHandlerFactory and schema.xml;
2. Create a core using the solrconfig.xml: 
http://localhost:8983/solr/admin/cores?action=CREATE&name=test&instanceDir=/var/solr/data/test&config=solrconfig.xml&dataDir=data/
 
<http://localhost:8983/solr/admin/cores?action=CREATE&name=test&instanceDir=/var/solr/data/test&config=solrconfig.xml&dataDir=data/>
3. Failure with nullPointerException;
4. Remove the shardHandlerFactory block;
5. Repeat step 2;
6. Success.

Works fine when running Solr in SolrCloud mode.

It’s understandable that shardHandlerFactory might not have any effect when 
running Solr in Standalone mode, since there is not inter-nodes requests 
routing, however, there are scenarios when we need to test and apply exactly 
the same solrconfig.xml in Standalone mode (i.e. during CI tests) and in Cloud 
mode (i.e. production clusters). What should be the expected behaviour, 
ignoring irrelevant configuration as it used to be in previous version of Solr?

Did anyone else face this issue? What would be the approach to solve it? 
Perhaps, there is a bug reported already? Thanks

Best regards,
Nick Vladiceanu

Reply via email to