Score:0

Create solr_core for search_api_solr 4.x with docker solr 8

in flag

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
Kevin avatar
in flag
Never had an issue like this. Can you actually verify the container directory is mounted and accessible to the container user at that location?
Rainer Feike avatar
in flag
Yes, I did, it's accessible. I'll add the java errors to my question.
Rainer Feike avatar
in flag
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...
Kevin avatar
in flag
Is that container missing those files?
Rainer Feike avatar
in flag
Which one? Yes, the classes I'd suppose.
Kevin avatar
in flag
https://www.drupal.org/project/search_api_solr/issues/3181819#comment-13899895
Score:0
in flag

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 ...

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.