com.atlassian.bonnie.LuceneException Couldn't open writer on directory
Symptoms
- Confluence dashboard is not updated.
- Spaces and pages cannot be created.
- Removing space took a long time to finished
- All the above symptoms still occurs even after rebuilding the content indices from scratch.
This issue can also cause Confluence to fail to startup entirely, so if Hercules points you to this document and Confluence is completely locked up this could be your issue.
Diagnosis
The following appears in the atlassian-confluence.log
:
2011-07-26 16:54:12,068 ERROR [pool-10-thread-1] [ext.usage.event.UsageTaskQueue] run Error indexing task: UsageEventWrapperTask: view:page(1376415) at Tue Jul 26 16:54:11 CEST 2011: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@D:\confluence-home\index\plugin\usage lockFactory=org.apache.lucene.store.SimpleFSLockFactory@14c0a13
-- url: /display/GL/Home | userName: aabvh05151 | action: viewpage | page: 1376415
com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@D:\confluence-home\index\plugin\usage lockFactory=org.apache.lucene.store.SimpleFSLockFactory@14c0a13
at com.atlassian.bonnie.LuceneConnection.withWriter(LuceneConnection.java:346)
at com.atlassian.confluence.ext.usage.index.UsageIndexManager.index(UsageIndexManager.java:219)
at com.atlassian.confluence.ext.usage.event.UsageTaskQueue$2.run(UsageTaskQueue.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@D:\confluence-home\index\plugin\usage\write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:85)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1562)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1118)
at com.atlassian.bonnie.LuceneConnection.withWriter(LuceneConnection.java:327)
... 8 more
Creating a space generates the following stack trace:
Cause
com.atlassian.bonnie.LuceneException: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@/data/confluence/home/index lockFactory=org.apache.lucene.store.SimpleFSLockFactory@d7bcfb8
at com.atlassian.bonnie.LuceneConnection.withBatchUpdate(LuceneConnection.java:409)
caused by: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@/data/confluence/home/index lockFactory=org.apache.lucene.store.SimpleFSLockFactory@d7bcfb8
at com.atlassian.bonnie.LuceneConnection.withWriter(LuceneConnection.java:346)
caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/data/confluence/home/index/write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:85)
Stack Trace:[hide]
com.atlassian.bonnie.LuceneException: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@/data/confluence/home/index lockFactory=org.apache.lucene.store.SimpleFSLockFactory@d7bcfb8
at com.atlassian.bonnie.LuceneConnection.withBatchUpdate(LuceneConnection.java:409)
at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager.processTasks(DefaultConfluenceIndexManager.java:161)
at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager.flushQueue(DefaultConfluenceIndexManager.java:128)
at sun.reflect.GeneratedMethodAccessor744.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
...
Caused by: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@/data/confluence/home/index lockFactory=org.apache.lucene.store.SimpleFSLockFactory@d7bcfb8
at com.atlassian.bonnie.LuceneConnection.withWriter(LuceneConnection.java:346)
at com.atlassian.confluence.search.lucene.tasks.LuceneConnectionBackedIndexTaskPerformer.perform(LuceneConnectionBackedIndexTaskPerformer.java:20)
at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager$BatchUpdateAction.perform(DefaultConfluenceIndexManager.java:361)
at com.atlassian.bonnie.LuceneConnection.withBatchUpdate(LuceneConnection.java:405)
... 208 more
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@/data/confluence/home/index/write.lock
at org.apache.lucene.store.Lock.obtain(Lock.java:85)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1562)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1118)
at com.atlassian.bonnie.LuceneConnection.withWriter(LuceneConnection.java:327)
... 211 more
Cause
Lucene fails to acquire a write lock a directory for writing its indices. Also, it may caused by insufficient disk space. One of the contributors to this is scheduled daily backup, which can turn out to be large.
Workaround
Delete write.lock from <confluence-home>/index/
. This issue is tracked here: CONF-22981. Also, check if your Confluence home directory has a sufficient disk space.