Breaking change in Solr 9.8: solr.config.lib.enabled

Created on 20 February 2025, 4 months ago

Just stumbled over this:

directives have been made into an "opt-in" feature in Solr 9.8 and must be explicitly enabled if desired (using a system property or environment variable like -Dsolr.config.lib.enabled=true) If not explicitly enabled, Solr will log a warning but otherwise quietly ignore any
tags in configsets. This is a breaking change, and we apologize for the disruption, but it’s a necessary response to a number of security gaps that have come to light around this feature.
directives should be considered deprecated and will be removed entirely in Solr 10.0. Current users of
have a number of options to ensure their libraries remain on Solr’s classpath, including: SOLR_MODULES, core "lib" directories, the solr.xml tag, Solr’s package manager, etc.

Source

I think this will most likely break the jump-start configurations for 9.x

πŸ“Œ Task
Status

Active

Version

4.3

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland das-peter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @das-peter
  • πŸ‡¨πŸ‡­Switzerland das-peter

    If I'm not completely mistaken -Dsolr.config.lib.enabled=true would have to be set via environment variables / startup parameters.
    E.g. something like this
    SOLR_OPTS="$SOLR_OPTS -Dsolr.config.lib.enabled=true"

    However, the only location in the jump start template that would allow that is docker-compose.yml
    And there we might as well switch to use the env var SOLR_MODULES:
    SOLR_MODULES="extraction,langid,ltr,analysis-extras"

  • πŸ‡¨πŸ‡­Switzerland das-peter

    Created a PR with a possible approach how to tackle this.
    Related PR: https://github.com/mkalkbrenner/search_api_solr/pull/105
    Patch: https://github.com/mkalkbrenner/search_api_solr/pull/105.patch & as attachment

    I'm not sure if we the module can or should provide further assistance with fixing the breaking change.
    It hit me off guard when our solr image was re-built and it took me quite a while to dig through everything to sort out what had gone wrong.
    I wonder if there's a way to check the available modules / the set config via API and show a clear message in the Search API Overview if this is off.

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    Within the Solarium library tests, we also went for SOLR_MODULES=extraction

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed 18 days ago
  • πŸ‡¦πŸ‡ΉAustria maxilein

    I would like to add this error in case someone else falls into this "trap". And by searching for this error the solution might come up faster for someone else ... than it did for me.

    The solution was to add
    SOLR_OPTS="$SOLR_OPTS -Dsolr.config.lib.enabled=true"
    in /etc/default/solr.in.sh

    After installing a new SOLR 9.8.1 I received the following error right after upload of the Drupal config.xml

    org.apache.solr.core.SolrCoreInitializationException: SolrCore 'corename' is not available due to init failure: Could not load conf for core fuez2025: Can't load schema /var/solr/data/fuez2025/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_en\"

    "error":{
        "metadata":["error-class","org.apache.solr.core.SolrCoreInitializationException","root-error-class","java.lang.ClassNotFoundException"],
        "msg":"SolrCore 'corename' is not available due to init failure: Could not load conf for core corename: Can't load schema /var/solr/data/corename/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_en\":  Error loading class 'solr.ICUCollationField'",
        "trace":"org.apache.solr.core.SolrCoreInitializationException: SolrCore 'corename' is not available due to init failure: Could not load conf for core corename: Can't load schema /var/solr/data/corename/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_en\":  Error loading class 'solr.ICUCollationField'\n\tat org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:2298)\n\tat org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:2267)\n\tat org.apache.solr.servlet.HttpSolrCall.init(HttpSolrCall.java:239)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:523)\n\tat org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:241)\n\tat org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilterRetry$0(SolrDispatchFilter.java:198)\n\tat org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:227)\n\tat org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:197)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilterRetry(SolrDispatchFilter.java:192)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:181)\n\tat javax.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)\n\tat org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)\n\tat org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:598)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1580)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1553)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)\n\tat org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:228)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:301)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:563)\n\tat org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)\n\tat org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)\n\tat org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:461)\n\tat org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)\n\tat org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)\n\tat org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)\n\tat org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:193)\n\tat org.eclipse.jetty.http2.HTTP2Connection.produce(HTTP2Connection.java:208)\n\tat org.eclipse.jetty.http2.server.HTTP2ServerConnection.onOpen(HTTP2ServerConnection.java:116)\n\tat org.eclipse.jetty.io.AbstractEndPoint.upgrade(AbstractEndPoint.java:451)\n\tat org.eclipse.jetty.server.NegotiatingServerConnection.onFillable(NegotiatingServerConnection.java:125)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)\n\tat org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:558)\n\tat org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:379)\n\tat org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:146)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)\n\tat org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)\n\tat java.base/java.lang.Thread.run(Thread.java:1583)\nCaused by: org.apache.solr.common.SolrException: Could not load conf for core corename: Can't load schema /var/solr/data/corename/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_en\":  Error loading class 'solr.ICUCollationField'\n\tat org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:291)\n\tat org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1735)\n\tat org.apache.solr.core.CoreContainer.lambda$loadInternal$12(CoreContainer.java:1080)\n\tat com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:212)\n\tat org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:380)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\t... 1 more\nCaused by: org.apache.solr.common.SolrException: Can't load schema /var/solr/data/corename/conf/schema.xml: Plugin init failure for [schema.xml] fieldType \"collated_en\":  Error loading class 'solr.ICUCollationField'\n\tat org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:663)\n\tat org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:193)\n\tat org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:109)\n\tat org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:370)\n\tat org.apache.solr.core.ConfigSetService.lambda$loadConfigSet$0(ConfigSetService.java:281)\n\tat org.apache.solr.core.ConfigSet.<init>(ConfigSet.java:49)\n\tat org.apache.solr.core.ConfigSetService.loadConfigSet(ConfigSetService.java:277)\n\t... 7 more\nCaused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType \"collated_en\":  Error loading class 'solr.ICUCollationField'\n\tat org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:179)\n\tat org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:538)\n\t... 13 more\nCaused by: org.apache.solr.common.SolrException:  Error loading class 'solr.ICUCollationField'\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:553)\n\tat org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:615)\n\tat org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:609)\n\tat org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:74)\n\tat org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)\n\tat org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:144)\n\t... 14 more\nCaused by: java.lang.ClassNotFoundException: solr.ICUCollationField\n\tat java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)\n\tat java.base/java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:872)\n\tat java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)\n\tat java.base/java.lang.Class.forName0(Native Method)\n\tat java.base/java.lang.Class.forName(Class.java:534)\n\tat java.base/java.lang.Class.forName(Class.java:513)\n\tat org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:537)\n\t... 19 more\n",
    
        "code":500
    
  • πŸ‡¨πŸ‡ΏCzech Republic Bohus Ulrych Pilsen (Czechia)

    FYI I was facing exactly same issue after Solr upgrade (9.4.0 => 9.8.1). I'm not using docker.

    After upgrade I was not able to connect to the solr server; I was able to find in the solr logs something about
    Caused by: org.apache.solr.common.SolrException: Could not load conf for core myesi: Can't load schema /var/solr/data/myesi/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "collated_en": Error loading class 'solr.ICUCollationField'

    Fortunately found this thread. Trick mentioned above (add Dsolr.config.lib.enabled=true) didn't work for me.
    But after updating the config file /etc/default/solr.in.sh it started to work.
    SOLR_MODULES="extraction,langid,ltr,analysis-extras"

    IMHO message
    "lib" directives in solrconfig.xml are deprecated and will be removed in Solr 10.0. Ensure to load the required modules in your Solr 9.8 or higher server. One way is to set the SOLR_MODULES environment variable to include the modules required by Search API Solr per default: SOLR_MODULES="extraction,langid,ltr,analysis-extras".
    should be updated with information where to put it, with path to the file:
    "lib" directives in solrconfig.xml are deprecated and will be removed in Solr 10.0. Ensure to load the required modules in your Solr 9.8 or higher server. One way is to set the SOLR_MODULES environment variable in the file /etc/default/solr.in.sh to include the modules required by Search API Solr per default: SOLR_MODULES="extraction,langid,ltr,analysis-extras".

    Then after solr service restart everything started to work again.

Production build 0.71.5 2024