Sitecore 7 | Exception of type ‘Lucene.Net.Index.MergePolicy+MergeException’ was thrown.

We started getting this error, Exception of type ‘Lucene.Net.Index.MergePolicy+MergeException’ was thrown, in our log files right before the application pool would completely die.  This was a Sitecore 7 site, rev. 130810.  I opened a ticket with Sitecore Support and they suggested deleting the files in the indexes folder and rebuilding the index.  My colleague simply rebuilt the indexes and the issue went away.

Here’s the whole log entry for reference:

ManagedPoolThread #12 14:16:15 INFO Starting update of index for the database 'master' (4753 pending).
Lucene Merge Thread #0 14:16:15 ERROR Unhandled exception detected. The ASP.NET worker process will be terminated. 
Exception: Lucene.Net.Index.MergePolicy+MergeException
Message: Exception of type 'Lucene.Net.Index.MergePolicy+MergeException' was thrown.
Source: Lucene.Net
 at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(Exception exc)
 at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run()
 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
 at System.Threading.ThreadHelper.ThreadStart()

The issue happened specifically when we tried to upload something to the Media Library.  The app pool would recycle 5 times and after the 5th time, IIS would just kill it.  This is standard IIS behavior.  It is configured in the App Pool > Advanced Settings > Maximum Failures.

Leave a Reply