0

I used to create my solr instance for drupal like this:

docker run -v $PWD/solrconf:/asdentcore  -e SOLR_JAVA_MEM="-Xms2G -Xmx2G" --restart unless-stopped  -p 8984:8983 -t --name asdentDevSolr -d solr:8.11
docker exec -it --user=solr asdentDevSolr  bin/solr create_core -c asdentcore -d /asdentcore

Where ./solrconf contains the files from modules/contrib/search_api_solr/solr-conf-templates/7.x.

With the new 4.x branch of search_api_solr (and 8.x contents) I get

ERROR: Error CREATEing SolrCore 'asdentcore': Unable to create core [asdentcore] Caused by: solr.ICUCollationField

I've already tried https://stackoverflow.com/questions/53161034/solr-error-unable-to-create-core-mycore-caused-by-solr-icucollationfield - didn't help.

Container logs shows the following errors:

Caused by: org.apache.solr.common.SolrException: Unable to create core [asdentcore]
Caused by: org.apache.solr.common.SolrException: Could not load conf for core asdentcore: Can't load schema /var/solr/data/asdentcore/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "collated_de": Error loading class 'solr.ICUCollationField'
Caused by: org.apache.solr.common.SolrException: Can't load schema /var/solr/data/asdentcore/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "collated_de": Error loading class 'solr.ICUCollationField'
Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "collated_de": Error loading class 'solr.ICUCollationField'
Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.ICUCollationField'
Caused by: java.lang.ClassNotFoundException: solr.ICUCollationField
6
  • Never had an issue like this. Can you actually verify the container directory is mounted and accessible to the container user at that location?
    – Kevin
    Nov 23, 2021 at 14:16
  • Yes, I did, it's accessible. I'll add the java errors to my question. Nov 23, 2021 at 16:46
  • Also, if I set up the solr as usual with the 7.x templates till it works, then bash into the container and copy over the new conf/* files downloaded via search-api UI to /var/solr/data/asdentcore/conf - the server breaks with java.lang.ClassNotFoundException: solr.ICUCollationField - bah that's sooo bad... Nov 23, 2021 at 17:14
  • Is that container missing those files?
    – Kevin
    Nov 23, 2021 at 17:16
  • Which one? Yes, the classes I'd suppose. Nov 23, 2021 at 17:16

1 Answer 1

1

Kudos to Kevin. The solution is

here https://stackoverflow.com/questions/62652640/error-when-initializing-solr-core-error-loading-class-solr-icucollationfield

and here https://www.drupal.org/project/search_api_solr/issues/3181819#comment-13899895

I had to replace in the downloaded solrcore.properties the line solr.install.dir=../../.. with solr.install.dir=/opt/solr.

One day of my live ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.