How to fix: Error CREATEing SolrCore 'gettingstarted': Unable to create core

Since it might help anybody with the same issue, it's indeed caused by permission issues when using root. The script doesn't terminate quickly when executing the command as root and instead creates a piece of the core definition before failing.

So first cleanup the broken core:

bin/solr delete -c mycore

Make sure that no folder(s) linger under /var/solr/data for your mycore core.

Next create the core as the solr user

su -u solr -c "/opt/solr/bin/solr create_core -c mycore"

This time it should succeed


Don't run solr script as root user (it is not recommended). You should run as solr user, e.g.:

sudo -u solr ./bin/solr create -c mycore

I found this as the solution:

sudo su - solr -c "/opt/solr/bin/solr create -c mycore"

More information here: https://www.howtoforge.com/tutorial/how-to-install-and-configure-solr-on-ubuntu-1604/

Tags:

Lucene

Solr

Solr5