Confluence can't write to index directory
Symptoms
Confluence's indexer is unable to save after running, so the index does not get updated. Like other indexing issues, this affects RSS feeds, searching, Recently Updated, the People Directory, Space Activity. This may also affect other functions in Confluence not mentioned here.
The following appears in the atlassian-confluence.log
:
2012-10-25 14:27:01,593 ERROR [scheduler_Worker-3] [org.quartz.core.JobRunShell] run Job DEFAULT.IndexQueueFlusher threw an unhandled Exception:
com.atlassian.bonnie.LuceneException: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@<confluence-home>/index lockFactory=org.apache.lucene.store.SimpleFSLockFactory@6305b346
at com.atlassian.bonnie.LuceneConnection.withBatchUpdate(LuceneConnection.java:409)
at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager.processTasks(DefaultConfluenceIndexManager.java:191)
at com.atlassian.confluence.search.lucene.DefaultConfluenceIndexManager.flushQueue(DefaultConfluenceIndexManager.java:144)
at sun.reflect.GeneratedMethodAccessor281.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy41.flushQueue(Unknown Source)
at com.atlassian.confluence.search.lucene.IndexQueueFlusher.executeJob(IndexQueueFlusher.java:29)
at com.atlassian.confluence.setup.quartz.AbstractClusterAwareQuartzJobBean.surroundJobExecutionWithLogging(AbstractClusterAwareQuartzJobBean.java:63)
at com.atlassian.confluence.setup.quartz.AbstractClusterAwareQuartzJobBean.executeInternal(AbstractClusterAwareQuartzJobBean.java:46)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:15)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: com.atlassian.bonnie.LuceneException: Couldn't open writer on directory: org.apache.lucene.store.SimpleFSDirectory@<confluence-home>/index lockFactory=org.apache.lucene.store.SimpleFSLockFactory@6305b346
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:418)
at com.atlassian.bonnie.LuceneConnection.withBatchUpdate(LuceneConnection.java:405)
... 19 more
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: SimpleFSLock@<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)
... 22 more
Cause
Confluence is not able to save the index to hard disk as it's not able to write there. This is usually caused by insufficient permissions to write, but could also happen if that filesystem ran out of space.
Resolution
- Determine the user who runs Confluence
- Make sure that the index directory is owned by and has write permissions for this user
chown -R <user> <confluence-home>/index
chmod -R u+rwX <confluence-home>/index