Thursday, August 31, 2017

Sitecore an unhanded exception has occured

While browsing my Sitecore content editor, a Visual Studio popup kept appearing saying that an unhanded exception had occurred and would I like to debug it.

Looking into the event viewer I noticed three errors, with the first one being:
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/2/ROOT
Process ID: 9520
Exception: Lucene.Net.Index.MergePolicy+MergeException
Message: Exception of type 'Lucene.Net.Index.MergePolicy+MergeException' was thrown.
StackTrace:    at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(Exception exc) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\ConcurrentMergeScheduler.cs:line 430
   at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run() in d:\Lucene.Net\FullRepo\trunk\src\core\Index\ConcurrentMergeScheduler.cs:line 394
   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()
InnerException: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
StackTrace:    at Lucene.Net.Index.IndexWriter.HandleMergeException(Exception t, OneMerge merge) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\IndexWriter.cs:line 4641
   at Lucene.Net.Index.IndexWriter.Merge(OneMerge merge) in d:\Lucene.Net\FullRepo\trunk\src\core\Index\IndexWriter.cs:line 4674
   at Lucene.Net.Index.ConcurrentMergeScheduler.MergeThread.Run() in d:\Lucene.Net\FullRepo\trunk\src\core\Index\ConcurrentMergeScheduler.cs:line 370
Then
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IndexOutOfRangeException
   at Lucene.Net.Index.IndexWriter.HandleMergeException(System.Exception, OneMerge)
   at Lucene.Net.Index.IndexWriter.Merge(OneMerge)
   at Lucene.Net.Index.ConcurrentMergeScheduler+MergeThread.Run()
Exception Info: Lucene.Net.Index.MergePolicy+MergeException
   at Lucene.Net.Index.ConcurrentMergeScheduler.HandleMergeException(System.Exception)
   at Lucene.Net.Index.ConcurrentMergeScheduler+MergeThread.Run()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()
Followed by:
Faulting application name: w3wp.exe, version: 10.0.15063.0, time stamp: 0xf0e19ef5
Faulting module name: KERNELBASE.dll, version: 10.0.15063.502, time stamp: 0x005405b5
Exception code: 0xe0434352
Fault offset: 0x0000000000069e08
Faulting process id: 0x2530
Faulting application start time: 0x01d3221d4375eea5
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\windows\System32\KERNELBASE.dll
Report Id: 2a60b7f0-f807-4204-bbe4-8ec07f8974f4
Faulting package full name: 
Faulting package-relative application ID: 
This was an issue with the Lucene search indexes and it appeared for me after installing a package. To resolve this issue you will need to delete all of the indexes inside the Sitecore site's data folder and then rebuild all of these indexes via the control panel.

Wednesday, August 30, 2017

Sitecore Email Chilkat MailMain unlock code has expired

On version 8.1 of Sitecore, the following error was being raised when trying to send an asynchronous email message using the Sitecore email module:
Chilkat MailMan unlock code has expired. Please obtain a new unlock code.
This was tracking back to the Sitecore.EDS.Core DLL code which references the ChilkatDotNet45 DLL. Somehow this third party DLL had been updated to a slightly newer version, and when replaced with the original that shipped with Sitecore the error no longer appeared.