cancel
Showing results for 
Search instead for 
Did you mean: 

Error creating SOLR core

cstifarol
Champ on-the-rise
Champ on-the-rise

Hi,

I performed a backup of Alfresco via tutorial: https://hub.alfresco.com/t5/alfresco-content-services-blog/creating-and-restoring-backups-for-alfres...

Until then, alright.

I restored it and the environment is working perfectly, but SOLR starts with an error and cannot create the Alfresco and Archive cores, showing the following message:

solr6_1                  | 2021-06-23 13:54:12.406 ERROR (Thread-12) [   x:alfresco] o.a.s.AlfrescoCoreAdminHandler Failed to create default alfresco cores (workspace/archive stores)
solr6_1                  | org.apache.solr.common.SolrException: Error CREATEing SolrCore 'alfresco': Unable to create core [alfresco] Caused by: /opt/alfresco-search-services/data/alfresco/index/write.lock
solr6_1                  |      at org.apache.solr.core.CoreContainer.create(CoreContainer.java:900)
solr6_1                  |      at org.alfresco.solr.AlfrescoCoreAdminHandler.createAndRegisterNewCore(AlfrescoCoreAdminHandler.java:803)
solr6_1                  |      at org.alfresco.solr.AlfrescoCoreAdminHandler.newCore(AlfrescoCoreAdminHandler.java:707)
solr6_1                  |      at org.alfresco.solr.AlfrescoCoreAdminHandler.lambda$setupNewDefaultCores$3(AlfrescoCoreAdminHandler.java:287)
solr6_1                  |      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
solr6_1                  |      at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
solr6_1                  |      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
solr6_1                  |      at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
solr6_1                  |      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
solr6_1                  |      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
solr6_1                  |      at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
solr6_1                  |      at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
solr6_1                  |      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
solr6_1                  |      at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
solr6_1                  |      at org.alfresco.solr.AlfrescoCoreAdminHandler.setupNewDefaultCores(AlfrescoCoreAdminHandler.java:280)
solr6_1                  |      at org.alfresco.solr.AlfrescoCoreAdminHandler.lambda$new$0(AlfrescoCoreAdminHandler.java:228)
solr6_1                  |      at java.base/java.lang.Thread.run(Thread.java:834)
solr6_1                  | Caused by: org.apache.solr.common.SolrException: Unable to create core [alfresco]
solr6_1                  |      at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:966)
solr6_1                  |      at org.apache.solr.core.CoreContainer.create(CoreContainer.java:863)
solr6_1                  |      ... 16 more
solr6_1                  | Caused by: org.apache.solr.common.SolrException: /opt/alfresco-search-services/data/alfresco/index/write.lock
solr6_1                  |      at org.apache.solr.core.SolrCore.<init>(SolrCore.java:977)
solr6_1                  |      at org.apache.solr.core.SolrCore.<init>(SolrCore.java:830)
solr6_1                  |      at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:950)
solr6_1                  |      ... 17 more
solr6_1                  | Caused by: java.nio.file.AccessDeniedException: /opt/alfresco-search-services/data/alfresco/index/write.lock
solr6_1                  |      at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
solr6_1                  |      at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
solr6_1                  |      at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
solr6_1                  |      at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:182)
solr6_1                  |      at java.base/java.nio.channels.FileChannel.open(FileChannel.java:292)
solr6_1                  |      at java.base/java.nio.channels.FileChannel.open(FileChannel.java:345)
solr6_1                  |      at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:113)
solr6_1                  |      at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41)
solr6_1                  |      at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45)
solr6_1                  |      at org.apache.lucene.store.FilterDirectory.obtainLock(FilterDirectory.java:104)
solr6_1                  |      at org.apache.lucene.index.IndexWriter.isLocked(IndexWriter.java:4776)
solr6_1                  |      at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:709)
solr6_1                  |      at org.apache.solr.core.SolrCore.<init>(SolrCore.java:923)
solr6_1                  |      ... 19 more

imageimage

Has anyone been through this situation that can help me?

Thanks!

6 REPLIES 6

angelborroy
Community Manager Community Manager
Community Manager

What OS are you using in the host? Linux?

Hyland Developer Evangelist

Hi,

Yes, CentOS 7.

It seems a permission issue then, with SOLR data folder.

That should be uid=33007

Hyland Developer Evangelist

Ok, thanks.
But I have already put the permission for that userid in the corresponding folder and even then error persists.
Any more ideas?

Kenon5553
Champ in-the-making
Champ in-the-making

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

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

cristinamr
World-Class Innovator
World-Class Innovator

Thank you for share your solution, for sure will help more community members in the future! 🙂

--
VenziaIT: helping companies since 2005! Our ECM products: AQuA & Seidoc