org.apache.lucene.store.LockObtainFailedException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 1) Unpack Nexus with default config and start it 2) Execute the attached JMeter binary using {{jmeter/bin/jmeter}} 3) open and run the attached plan file. The test plan creates a hosted repo, adds it to a group, removes it from a group and deletes the original repo repeatedly for 10 seconds. This can corrupt the search indexes and running repair index task will not recover it. If a keyword search is performed, it can return 500 status from Nexus. Selecting a node in browse storage for an existing artifact ( if you download one before running test ) can cause 500 error in UI. The only recovery for search seems to be to stop nexus, delete the indexer directory and run a publish indexes task on all repos to regenerate the indexes. In one case, I noticed an indexer/hosted-1-ctx directory failed to be created but the storage repo does. When publish indexes task is run in this case, it fails since hosted-1-ctx directory does not exist and lock cannot be obtained. Examples: {noformat} jvm 1 | 2013-04-14 22:06:08 ERROR [tp1113757163-71] - org.sonatype.nexus.events.IndexingRepositoryRegistryRepositoryEventInspector - Could not maintain indexing contexts! jvm 1 | org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/app/nexus-testing/2.3.1-01/nexus-professional-2.3.1-01-bundle-2/sonatype-work/nexus/indexer/hosted-1-ctx/write.lock jvm 1 | at org.apache.lucene.store.Lock.obtain(Lock.java:84) ~[lucene-core-3.6.1.jar:3.6.1 1362471 - thetaphi - 2012-07-17 12:40:12] jvm 1 | at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098) ~[lucene-core-3.6.1.jar:3.6.1 1362471 - thetaphi - 2012-07-17 12:40:12] jvm 1 | at org.apache.maven.index.context.NexusIndexWriter.<init>(NexusIndexWriter.java:53) ~[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] jvm 1 | at org.apache.maven.index.context.DefaultIndexingContext.openAndWarmup(DefaultIndexingContext.java:473) ~[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] jvm 1 | at org.apache.maven.index.context.DefaultIndexingContext.prepareCleanIndex(DefaultIndexingContext.java:238) ~[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] jvm 1 | at org.apache.maven.index.context.DefaultIndexingContext.prepareIndex(DefaultIndexingContext.java:216) ~[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] jvm 1 | at org.apache.maven.index.context.DefaultIndexingContext.<init>(DefaultIndexingContext.java:147) ~[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] jvm 1 | at org.apache.maven.index.context.DefaultIndexingContext.<init>(DefaultIndexingContext.java:167) ~[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] jvm 1 | at org.sonatype.nexus.index.NexusIndexingContext.<init>(NexusIndexingContext.java:45) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.addRepositoryIndexContext(DefaultIndexerManager.java:465) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.access$000(DefaultIndexerManager.java:186) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager$1.run(DefaultIndexerManager.java:430) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.exclusiveSingle(DefaultIndexerManager.java:2538) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.addRepositoryIndexContext(DefaultIndexerManager.java:424) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.addRepositoryIndexContext(DefaultIndexerManager.java:402) ~[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.events.IndexingRepositoryRegistryRepositoryEventInspector.inspectForIndexerManager(IndexingRepositoryRegistryRepositoryEventInspector.java:96) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.events.IndexingRepositoryRegistryRepositoryEventInspector.inspect(IndexingRepositoryRegistryRepositoryEventInspector.java:81) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.events.DefaultEventInspectorHost.processEvent(DefaultEventInspectorHost.java:131) [nexus-app-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.events.DefaultEventInspectorHost.onEvent(DefaultEventInspectorHost.java:104) [nexus-app-2.3.1-01.jar:2.3.1-01] jvm {noformat} {noformat} jvm 1 | 2013-04-14 22:08:34 WARN [ool-1-thread-20] - org.sonatype.nexus.index.DefaultIndexerManager - Could not perform index operation on repository hosted-1 jvm 1 | java.lang.Exception: null jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager$18.run(DefaultIndexerManager.java:2483) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.exclusiveSingle(DefaultIndexerManager.java:2538) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.temporary(DefaultIndexerManager.java:2466) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:1044) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.reindexAllRepositories(DefaultIndexerManager.java:915) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.tasks.ReindexTaskHandlerLegacy.reindexAllRepositories(ReindexTaskHandlerLegacy.java:41) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.tasks.AbstractIndexerTask.doRun(AbstractIndexerTask.java:73) [nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:166) [nexus-app-2.3.1-01.jar:2.3.1-01] jvm 1 | at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:459) [sisu-task-scheduler-1.7.jar:na] {noformat} State reproduced in 2.2.1, 2.3.1-01 and 2.4.0-09.
    via by Peter Lynch,
  • Initializing and locks
    via by Dan Fairs,
  • Crawl keeps locking itself
    via GitHub by robfromca
    ,
  • By Hibernate search we create a search engine in my application.Here same application running in two different JBoss and using two different folder for storing index data.Two folder and Two JBoss running in different system.But Some time showing bellow type of error.Please give me any resolution. 16:45:58,184 ERROR [org.hibernate.search.exception.impl.LogErrorHandler] (Hibernate Search: Index updates queue processor for index in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster-1) HSEARCH000058: Exception occurred org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Folder_Path/write.lock Primary Failure: Entity in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster Id 49621 Work Type org.hibernate.search.backend.UpdateLuceneWork : org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/home/ccblcbs/wisebankenterprise/globalsearch/index12/in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster/write.lock at org.apache.lucene.store.Lock.obtain(Lock.java:84) [lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40] at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098) [lucene-core-3.6.2.jar:3.6.2 1423725 - rmuir - 2012-12-18 19:45:40] at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:146) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:113) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:101) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67) [hibernate-search-engine-4.4.4.Final.jar:4.4.4.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_24] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_24] at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_24] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_24] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_24] at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_24] 16:45:58,187 ERROR [org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask] (Hibernate Search: Index updates queue processor for index in.issac.wisebank.systemadmin.customermanagement.entiry.WbSaCustomermaster-1) HSEARCH000072: Couldn't open the IndexWriter because of previous error: operation skipped, index ouf of sync!
    via by Atin,
  • Sunspot Solr core initialization failure
    via Stack Overflow by pthamm
    ,
    • org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/app
    • exus-testing/2.3.1-01
    • exus-professional-2.3.1-01-bundle-2/sonatype-work
    • exus/indexer/hosted-1-ctx/write.lock at org.apache.lucene.store.Lock.obtain(Lock.java:84)[lucene-core-3.6.1.jar:3.6.1 1362471 - thetaphi - 2012-07-17 12:40:12] at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)[lucene-core-3.6.1.jar:3.6.1 1362471 - thetaphi - 2012-07-17 12:40:12] at org.apache.maven.index.context.NexusIndexWriter.<init>(NexusIndexWriter.java:53)[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] at org.apache.maven.index.context.DefaultIndexingContext.openAndWarmup(DefaultIndexingContext.java:473)[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] at org.apache.maven.index.context.DefaultIndexingContext.prepareCleanIndex(DefaultIndexingContext.java:238)[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] at org.apache.maven.index.context.DefaultIndexingContext.prepareIndex(DefaultIndexingContext.java:216)[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] at org.apache.maven.index.context.DefaultIndexingContext.<init>(DefaultIndexingContext.java:147)[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] at org.apache.maven.index.context.DefaultIndexingContext.<init>(DefaultIndexingContext.java:167)[indexer-core-5.1.1-d928049c927da992071a6c6bba892568dbcf27a3.jar:5.1.1-d928049c927da992071a6c6bba892568dbcf27a3] at org.sonatype.nexus.index.NexusIndexingContext.<init>(NexusIndexingContext.java:45)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.index.DefaultIndexerManager.addRepositoryIndexContext(DefaultIndexerManager.java:465)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.index.DefaultIndexerManager.access$000(DefaultIndexerManager.java:186)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.index.DefaultIndexerManager$1.run(DefaultIndexerManager.java:430)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.index.DefaultIndexerManager.exclusiveSingle(DefaultIndexerManager.java:2538)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.index.DefaultIndexerManager.addRepositoryIndexContext(DefaultIndexerManager.java:424)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.index.DefaultIndexerManager.addRepositoryIndexContext(DefaultIndexerManager.java:402)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.events.IndexingRepositoryRegistryRepositoryEventInspector.inspectForIndexerManager(IndexingRepositoryRegistryRepositoryEventInspector.java:96)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.events.IndexingRepositoryRegistryRepositoryEventInspector.inspect(IndexingRepositoryRegistryRepositoryEventInspector.java:81)[nexus-indexer-lucene-plugin-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.events.DefaultEventInspectorHost.processEvent(DefaultEventInspectorHost.java:131)[nexus-app-2.3.1-01.jar:2.3.1-01] at org.sonatype.nexus.events.DefaultEventInspectorHost.onEvent(DefaultEventInspectorHost.java:104)[nexus-app-2.3.1-01.jar:2.3.1-01]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor2 times, last one,