Error CREATEing SolrCore: Unable to create core Caused by: /var/solr/data/searchfin/data/snapshot_metadata - solr

I am trying to add a new solr core but it's giving me the following error:
Error CREATEing SolrCore 'searchfin': Unable to create core [searchfin] Caused by: /var/solr/data/searchfin/data/snapshot_metadata
I have already created the folder "searchfin" with subfolder conf and data in it. Also I have tried creating the core with both solr UI and command line.

Related

Can't create new Solr core caused by can't find resource 'solrconfig.xml'

I just installed Solr and want to create a new core, but getting this error:
org.apache.solr.common.SolrException: Error CREATEing SolrCore 'new_core': Unable to create core [new_core] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/var/solr/data/new_core'
I was trying to add it using the interface:
I hope somebody can help me out.
The option to create a new core in the Admin web page that you are using is a bit misleading, that option assumes you already have folders with some of the required data.
If you have access to the terminal on the machine where Solr is running you can easily create a core with a command like this:
$ cd ~/solr-8.4.1/bin
$ ./solr create -c name-of-your-new-core

How to add solr core in windows?

Downloaded (Apache solr 8.8.1) [https://archive.apache.org/dist/lucene/solr/8.1.1/]
In path \solr-8.8.1\bin
Opened command prompt, and executed following command
solr start
command prompt screen after starting solr core
Accessed http://localhost:8983/solr/#/ in the browser
clicked on -> Core Admin -> new core
*filled core name, instanceDir, dataDir- data, config- (by default) solrconfig.xml , schema- (by default) schema.xml *
When i click on Add core,
I get following error:
Error CREATEing SolrCore 'new_core': Unable to create core [new_core] Caused by: Can't find resource 'solrconfig.xml' in classpath or 'C:\Users\AnanyaStitipragyan\Desktop\CollabAI\solr-8.8.1\server\solr\new_core'
you can add core using following command
solr-8.8.1\bin>
solr create -c <core_name>
Check out this link https://www.tutorialspoint.com/apache_solr/apache_solr_core.htm

Failed to create collection 'techproducts' due to: Underlying core creation failed while creating collection: techproducts

I just started to learn solr with official documentation and during the first exercise "Index Techproducts Example Data" I failed due to following error: " Failed to create collection 'techproducts' due to: Underlying core creation failed while creating collection: techproducts".
I tried to change java version from 13 to 8 but it didn't helped.
Here is link to the documentation: https://lucene.apache.org/solr/guide/8_5/solr-tutorial.html#exercise-1
Stacktrace from solr Admin console
Collection: techproducts operation: create failed:org.apache.solr.common.SolrException: Underlying core creation failed while creating collection: techproducts
at org.apache.solr.cloud.api.collections.CreateCollectionCmd.call(CreateCollectionCmd.java:304)
at org.apache.solr.cloud.api.collections.OverseerCollectionMessageHandler.processMessage(OverseerCollectionMessageHandler.java:263)
at org.apache.solr.cloud.OverseerTaskProcessor$Runner.run(OverseerTaskProcessor.java:504)
at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:210)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
I had run into similar situation while following Solr
's official tutorial as following
➜ solr-8.7.0 ERROR: Failed to create collection 'techproducts' due to: Underlying core creation failed while creating collection: techproducts
And problem solved my turning off my vpn. I guess the vpn routing probably messed up with solr's localhost setting somehow.
I had the same Underlying core creation failed... error too. Using Java 11, Windows 10.
The log file was ${solr-home}\example\cloud\node1\logs\solr.log. Inside it had:
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://192.168.1.16:7574/solr: Error CREATEing SolrCore 'techproducts_shard1_replica_n1': Unable to create core [techproducts_shard1_replica_n1] Caused by: no segments* file found in LockValidatingDirectoryWrapper(NRTCachingDirectory(MMapDirectory#{solr_home}\example\cloud\node2\solr\techproducts_shard1_replica_n1\data\index lockFactory=org.apache.lucene.store.NativeFSLockFactory#16326253; maxCacheMB=48.0 maxMergeSizeMB=4.0)): files: [write.lock] at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:681) ~[?:?]
at (etc. etc.)e
But this was the second time I launched solr. The first time it timed out trying to contact one of the nodes and the tutorial script aborted. But the nodes were still running. I killed them off using the windows task manager and not by using solr stop. So I suspect I left an instable mess behind and the second time the tutorial ran it crashed into this mess.
I erased everything and started over from unzipping and this third time there were no timeouts and the tutorial completed without error.
File: /opt/solr/server/etc/jetty.xml
(1) Name="requestHeaderSize" set Property name "solr.jetty.request.header.size" default="81920"
(2) Name="responseHeaderSize"> set Property name="solr.jetty.response.header.size" default="81920"
(3) Restart Solr
Hm, tried this, still getting the exact same error.
After Change:
[Set name="requestHeaderSize"][Property name="solr.jetty.request.header.size" default="81920" /][/Set]
[Set name="responseHeaderSize"][Property name="solr.jetty.response.header.size" default="81920" /][/Set]
I stopped everything and retried, then I had Windows Firewall prompt me for 'SAP Machine' authorization for java 11 message, I accepted it, and retried. Then it worked. Seems Windows Firewall related.

How to create solr core on centos

I installed a Solr 8.1.1 on a centos 7, openJdk11 and want to create a new core. But on creating i get an error message:
ERROR: Error CREATEing SolrCore 'myCore': Unable to create core [myCore] Caused by: null
org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Bad or unsupported pattern: java.time.format.DateTimeFormatter$ClassicFormat#53ea7249"
Sample API to create a core is as mentioned below.
http://localhost:8983/solr/admin/cores?action=CREATE&name=coreName&instanceDir=path/to/dir
&config=config_file_name.xml&dataDir=data
Using SolrJ API it would be someting like as below.
String solrUrl = "http://localhost:8983/solr";
HttpSolrClient client = new HttpSolrClient.Builder(solrUrl).build();
CoreAdminRequest.Create createCore = new CoreAdminRequest.Create();
createCore.setCoreName(core);
createCore.setConfigSet( coreName);
createCore.process(client);
I had the same issue, somehow it is related to openJDK. I installed oracleJDK and set it as default java using
update-alternatives --config java
and selected oracleJDK home as default then used
solr create -c myCore
It worked for me.
enter image description here

Error when creating a core by specifying a config directory

I am attempting to create a core in SolrCloud using the following command:
sudo /opt/solr/bin/solr create -c Collection1 -d /home/callmekatootie/Desktop/conf
However, I get the following error:
Connecting to ZooKeeper at localhost:9983 ...
Uploading /home/callmekatootie/Desktop/vm/configs for config Collection1
to ZooKeeper at localhost:9983
Creating new collection 'Collection1' using command:
http://localhost:8983/solr/admin/collections?action=CREATE&name=Collection1
&numShards=1&replicationFactor=1&maxShardsPerNode=1
&collection.configName=Collection1
ERROR: Failed to create collection 'Collection1' due to: org.apache.solr.client.
solrj.impl.HttpSolrClient$RemoteSolrException:Error from server at
http://127.0.1.1:8983/solr: Error CREATEing SolrCore 'Collection1_shard1_replica1':
Unable to create core [Collection1_shard1_replica1]
Caused by: solr.SynonymExpandingExtendedDismaxQParserPlugin
What is the SynonymExpandingExtendedDismaxQParserPlugin and why am I getting the above error
Found the cause of the issue.
Turns out that SynonymExpandingExtendedDismaxQParserPlugin is an actual plugin that was being used in the SolrConfig.xml present in the configuration files that I was uploading.
This plugin was available through https://github.com/healthonnet/hon-lucene-synonyms which I had to copy to /opt/solr/server/solr-webapp/webapp/WEB-INF/lib/ folder - I had to paste that jar file in this folder. I restarted Solr and then managed to execute the mentioned command successfully.

Resources