How do I get Solr back up when indexes are locked and <unlockOnStartup>true doesn't work? - solr

I have a Solr slave that is running in Tomcat. I added a core, so I changed solr.xml. To reload it I decided to simply restart Tomcat using the Windows Services managament console.
After restarting Tomcat I keep getting the following exception:
org.apache.lucene.store.LockObtainFailedException: Index locked for
write for core
I decided to temporarily change the solrconfig.xml for each core to add:
<unlockOnStartup>true</unlockOnStartup>
But no luck. Locking is set to native, so I can't go and remove lock files.
How do I get Solr up and running again?
How should I restart Solr to prevent this from happening?

Delete only write.log in data/index . Where is data directory is specified in conf/solrconfig.xml.

Clear the index directory and restart solr. It will work

Delete file write.log in folder /data/index/ for your core then restart tomcat. It worked for me.

In case the other answers don't work, check your file permissions. In my case, I had to do a
chown -R tomcat6:tomcat6 /opt/solr/corename

Just deleted write.lock file under Solr > My Core > data > Index > write.lock file and restart solr server and it's worked.

Related

Sitecore 9.1 Installation errors

Install-SitecoreConfiguration : Cannot remove item C:\solr-7.6.0\server\solr\mhp_xdb\data\index\write.lock: Access to
the path 'write.lock' is denied.
enter image description here
Try stopping the Java process, this will cause the write.lock file to be removed and solr will be able to create new cores
remove the core from solr , (first unload it from solr instance and then remove the core folder ) , and then try to run the script again

Solr Error: Unable to create core [mycore] Caused by solr.ICUCollationField

I am trying to create a solr core, I am using drupalvm with vagrant and virtual box.
When setting up solr with this command:
sudo su - solr -c "/opt/solr/bin/solr create -c m4m -d /tmp/search_api_solr/solr-conf/7.x/"
I am getting this error:
INFO - 2018-11-05 19:21:45.804; org.apache.solr.util.configuration.SSLCredentialProviderFactory; Processing SSL Credential Provider chain: env;sysprop
ERROR: Error CREATEing SolrCore 'mycore': Unable to create core [mycore] Caused by: solr.ICUCollationField
Creating a core without specifying the -d <confdir> option is successful but gives me some really weird errors in the solr dashboard and Drupal UI which research indicates has something to do with a corrupted core.
Any help with why I am getting this error would be much appreciated. Other developers using the same vagrant installation is running without issue.
If you create the core without the config directory, solr will use it's default configurations.
Which in turn, will have none of the drupal needed field definitions, and so forth.
What you need to do, if you know a little bit about the solr's structure, and if you use solr > version 7 is:
go to where your solr installation is
cd /PATH_TO_SOLR/server/solr-webapp/webapp/WEB-INF/lib
Copy all jars from the analysis-extras folder to your wEB-INF/lib folder
cp /PATH_TO_SOLR/contrib/analysis-extras/lib/*.jar ./
restart solr the way you normally do, specifying your -d config directory. That's important.
Hope this helps.
OR...
Save your hassle and let the pros handle all this for you with a SaaS such as the likes of https://opensolr.com
You can create your solr index with 1 click, and you need 2 more clicks to upload your config files and you're done.
I need jars from 2 directories:
cd /PATH_TO_SOLR
cp solr/contrib/analysis-extras/lib/*.jar solr/server/solr-webapp/webapp/WEB-INF/lib/
cp solr/contrib/analysis-extras/lucene-libs/*.jar solr/server/solr-webapp/webapp/WEB-INF/lib/
see solr/contrib/analysis-extras/README.txt

solr multiple server dataimport handler throws exception - Properties is not writable

Thanks in advanced,
am tried to setup two solr servers in tomcat7 (ubuntu). Below here is the steps i followed,
create to context file inside tomcat7 localhost directory
/tomcat7/Catalina/localhost/solr.xml
/tomcat7/Catalina/localhost/solr-cc.xml
create two seperate solr instances
/etc/solr-4.6.a/solr.war & index directories
/etc/solr-4.6.b/solr.war & index directories
Server started fine and am able to see both solr admin pages, but when i tried to index data, am using dataimport handler (put separate configuration entries in two servers), first instance /solr is running fine, but the second one /solr-cc throws below exception:
Full Import failed:
org.apache.solr.handler.dataimport.DataImportHandlerException: Properties is not writable. Delta imports are supported by data config but will not work. Processing Document # 1
at org.apache.solr.handler.dataimport.DataImporter.checkWritablePersistFile(DataImporter.java:426)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:410)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:476)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:457)
I tried more then an hour to fix but failed, I gave all the file permission as 777 to index and solr config files directories.
Any help would be appreciated!!
Please make sure your dataimport.properties file is writable by tomcat user(I assume tomcat7), you could change the owner on all the files from conf folder to tomcat.
Let me know if it worked.

Unable to create a new core Solr 3.5. Error in default implementation of CREATE

I am running Solr 3.5 and already have two cores set up by my senior. I need to add a new core. The Solr home is /runtime/local/solr/. This directory contains the Solr.xml. So I create a new directory here with my core's name and then run the following
http://localhost:7658/solr/admin/cores?action=CREATE&name=core0&instanceDir=/runtime/local/solr/core0/
And Apache tomcat keeps returning a 400 error with the message
Error executing default implementation of CREATE
and the description says
The request sent by the client was syntactically incorrect (Error executing default implementation of CREATE).
What is going wrong here. The syntax seems to be correct from what I've searched on the web.
Found a fix. Not sure if it's the right approach. I created a directory for my core in the Solr Home folder and within it added a folder called conf. To this folder, I copied all the files which were there in the conf folder of the other core and after that ran the CREATE command. Booyah ! It worked.
Each core requires its own configuration, so you do need to have the conf folder set-up but it does not need to be the same as the configuration for your first core

SOLR replication failure on one of the slaves

We have a 4 slaves on Windows 2008 environment on tomacat and replication was working fine for some time and it started failing on one of the nodes i see following errors at first look it looks like permission issue but i compared two nodes and they seem to be same and nothing changed on this node.
SEVERE: SnapPull failed
org.apache.solr.common.SolrException: Unable to rename: D:\solr\core0\conf\compoundwords-de.txt to: D:\solr\core0\conf\compoundwords-de.txt.20120703165100
SEVERE: SnapPull failed
org.apache.solr.common.SolrException: Failed to create temporary config folder: conf.20120705004320
I even tried restarting the node to remove any pending locks but it did not resolve the issue anything i can do to troubleshoot the issue and find the real cause.
I was facing the same issue:
SEVERE: SnapPull failed
org.apache.solr.common.SolrException: Failed to create temporary config folder: conf.20120705004320
I happened to notice this error in tomcat's catalina.out after trying to figure out why the Solr admin UI is showing files being transferred during replication, but the index version and gen on the slave do not get updated after replication. In fact, in my case, the slave's version and gen were higher than what were on master (Solr 4.2.1)!
The trouble was the owner of the parent dir of solr conf dir (the one containing schema.xml, solrconfig.xml. etc.,). Solr wants to create a temporary conf dir named like conf.20120705004320 exactly at the same place where conf dir is located.
Once I changed the owner of the parent folder to tomcat6 replication started working fine. I used the command chown -R tomcat6:tomcat6 /var/solr where /var/solr is my ${solr.home}. The slave's version and gen started following the masters' after this fix.
I finally go this resolved after some troubleshooting we found that there was a failed java update since then the replication started failing. Here is what we did to resolve this
Reinstall JRE again
Tried restarting Solr, and removed all index files but it did not work
We went ahead deleted the core and setup the core again and it started working like before

Resources