0

I have configured the Search API Drupal module with the Apache Solr search server. Locally I am using DDEV, with the DDEV extension and there everything does work.

I do have a VServer for testing purpose, where I do use a Docker compose setup. There is Solr configured. However, I can index my search index, but I do get this error on my Search API server configuration page:

File schema_extra_types.xml could not be fetched from Solr server for validation: Solr endpoint http://solr:8983/ internal Solr server error (code: 500, body: { "responseHeader":{ "status":500, "QTime":0}, "error":{ "msg":"Cannot invoke \"java.net.URL.toURI()\" because the return value of \"java.lang.ClassLoader.getResource(String)\" is null", "trace":"java.lang.NullPointerException: Cannot invoke \"java.net.URL.toURI()\" because the return value of \"java.lang.ClassLoader.getResource(String)\" is null\n\tat org.apache.solr.handler.admin.ShowFileRequestHandler.getAdminFileFromFileSystem(ShowFileRequestHandler.java:365)\n\tat org.apache.solr.handler.admin.ShowFileRequestHandler.showFromFileSystem(ShowFileRequestHandler.java:199)\n\tat org.apache.solr.handler.admin.ShowFileRequestHandler.handleRequestBody(ShowFileRequestHandler.java:141)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:226)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2886)\n\tat org.apache.solr.servlet.HttpSolrCall.executeCoreRequest(HttpSolrCall.java:910)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:596)\n\tat org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:262)\n\tat org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:219)\n\tat org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:249)\n\tat org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:215)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)\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.HttpConnection.onFillable(HttpConnection.java:287)\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.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)\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.run(AdaptiveExecutionStrategy.java:199)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)\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(Unknown Source)\n", "code":500}} , message: Solr HTTP error: OK (500) { "responseHeader":{ "status":500, "QTime":0}, "error":{ "msg":"Cannot invoke \"java.net.URL.toURI()\" because the return value of \"java.lang.ClassLoader.getResource(String)\" is null", "trace":"java.lang.NullPointerException: Cannot invoke \"java.net.URL.toURI()\" because the return value of \"java.lang.ClassLoader.getResource(String)\" is null\n\tat org.apache.solr.handler.admin.ShowFileRequestHandler.getAdminFileFromFileSystem(ShowFileRequestHandler.java:365)\n\tat org.apache.solr.handler.admin.ShowFileRequestHandler.showFromFileSystem(ShowFileRequestHandler.java:199)\n\tat org.apache.solr.handler.admin.ShowFileRequestHandler.handleRequestBody(ShowFileRequestHandler.java:141)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:226)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:2886)\n\tat org.apache.solr.servlet.HttpSolrCall.executeCoreRequest(HttpSolrCall.java:910)\n\tat org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:596)\n\tat org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:262)\n\tat org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:219)\n\tat org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:249)\n\tat org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:215)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)\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.HttpConnection.onFillable(HttpConnection.java:287)\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.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)\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.run(AdaptiveExecutionStrategy.java:199)\n\tat org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)\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(Unknown Source)\n", "code":500}} ). 

enter image description here

This is my Docker compose setup:

services: drupal: image: jepster/drupal-java:10.2.10 user: "${UID}:${GID}" container_name: ddd-drupal ports: - 80:80 volumes: - ../:/opt/drupal - ../web:/var/www/html - ./settings.local.php:/opt/drupal/web/sites/default/settings.local.php - ./php.ini:/usr/local/etc/php/php.ini restart: always depends_on: - mariadb - solr environment: - DRUPAL_DB_HOST=mariadb - DRUPAL_DB_NAME=drupal - DRUPAL_DB_USERNAME=root - DRUPAL_DB_PASSWORD=drupal mariadb: image: mariadb:10.11 container_name: ddd-mariadb environment: MARIADB_ROOT_PASSWORD: drupal MARIADB_DATABASE: drupal DB_HOST: localhost restart: always ports: - "3306:3306" volumes: - ../setup/db-dump-dev.sql.gz:/opt/db-dump-dev.sql.gz - ./import-dump.sh:/docker-entrypoint-initdb.d/import-dump.sh solr: image: solr:9.6 container_name: ddd-solr ports: - "8983:8983" volumes: - ./solr-conf:/ddd-core-config command: - solr-precreate - drupal - /ddd-core-config volumes: mariadb_data: solr_data: 

My Solr server config looks like this: enter image description here

Instead of solr as Solr host I also tried localhost. But then I am not able to index the search index. If I specify solr, then I am able to run the indexing process:

enter image description here

I guess that my docker-compose.yml file is wrong. Do you have any idea? Is there any recommended docker-compose.yml file for testing servers (not DDEV)?

4
  • Did you use the the "Upload Configset" button, excute search-api-solr:upload-configset, or place the Drupal-specific configset manually into the Solr container via one of those volume mounts or scripts? You have to do one of those probably. Commented Oct 2, 2024 at 16:43
  • Thanks for your reply. I did this already via the volume mount in my docker-compose.yml file: ''' volumes: - ./solr-conf:/ddd-core-config command: - solr-precreate - drupal - /ddd-core-config ''' Do you have any other ideas? Commented Oct 3, 2024 at 7:42
  • You must show the contents of the volume and the code in the scripts. Otherwise we would have to just guess at answers. The overwhelming likelihood is that a schema file is missing. Commented Oct 3, 2024 at 10:57
  • If I check whats mounted in the Solr Docker container, then the exptected file is definitely there: solr@eb27f04a2193:/ddd-core-config$ ls accents_de.txt elevate.xml protwords_de.txt schema_extra_fields.xml schema.xml solrconfig_index.xml solrconfig_requestdispatcher.xml solrcore.properties stopwords_und.txt synonyms_und.txt accents_und.txt nouns_de.txt protwords_und.txt schema_extra_types.xml solrconfig_extra.xml solrconfig_query.xml solrconfig.xml stopwords_de.txt synonyms_de.txt solr@eb27f04a2193:/ddd-core-config$ Commented Oct 4, 2024 at 8:18

1 Answer 1

0

I ended up at defining a network for my Docker services, so the services can communicate with each other. I still get the error on my search api admin page (File schema_extra_types.xml could not be fetched from Solr server), after cache flush. But the search functionality works as expected. So the current config is OK for my purpose.

See my final config with the networks definition below:

services: drupal: image: jepster/drupal-java:10.2.10 user: "${UID}:${GID}" container_name: ddd-drupal ports: - 80:80 volumes: - ../:/opt/drupal - ../web:/var/www/html - ./settings.local.php:/opt/drupal/web/sites/default/settings.local.php - ./php.ini:/usr/local/etc/php/php.ini restart: always depends_on: - mariadb - solr environment: - DRUPAL_DB_HOST=mariadb - DRUPAL_DB_NAME=drupal - DRUPAL_DB_USERNAME=root - DRUPAL_DB_PASSWORD=drupal - SOLR_HOST=ddd-solr - SOLR_PORT=8983 - SOLR_USERNAME=solr - SOLR_PASSWORD=SolrRocks networks: application: aliases: - ddd.local mariadb: image: mariadb:10.11 container_name: ddd-mariadb environment: MARIADB_ROOT_PASSWORD: drupal MARIADB_DATABASE: drupal DB_HOST: ddd.local restart: always ports: - "3306:3306" volumes: - ../setup/db-dump-dev.sql.gz:/opt/db-dump-dev.sql.gz - ./import-dump.sh:/docker-entrypoint-initdb.d/import-dump.sh networks: - application solr: image: solr:9.6 container_name: ddd-solr ports: - "8983:8983" volumes: - ./solr-conf:/ddd-core-config command: - solr-precreate - drupal - /ddd-core-config networks: - application volumes: mariadb_data: solr_data: networks: application: driver: bridge 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.