torsdag den 18. december 2014

The case with the ASP.NET worker process being terminated from time to time

So, the other day we ran into an interresting issue, where a customers solution was crashing the entire worker proces.

Every time this happened, a few seconds before the Sitecore log file ended - this error showed up:

5784 10:41:07 ERROR Unhandled exception detected. The ASP.NET worker process will be terminated.
Exception: System.UnauthorizedAccessException
Message: The current user does not have write access to this item. User: sitecore/Anonymous, Item: Home ({71B4ACD7-226F-47A6-913D-86A40C0F9EBC})
Source: Sitecore.Kernel
at Sitecore.Data.Items.ItemEditing.BeginEdit()
at Sitecore.Data.Engines.TemplateEngine.<>c__DisplayClass3.b__0()
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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

It seem to be related to publishing some item based on a certain template.
After a while, with the help from Sitecore Support, we found the issue - it seemed one of the templates (the one the items being published was based on) was inheriting the same template twice.

This is not normally possible (you cannot select the same item multiple times in a multilist field in Sitecore) - so the field's raw value had to have been manipulated somehow.

After removing the double inheritance, it started working without any issues.
So if you run into this issue, take a look at your template inheritance - the problem might be hidden there :-)

Ingen kommentarer:

Send en kommentar