[Umbraco] Item has already been added. Key in dictionary: '??' Key being added: '??'

Error description:

Server Error in '/' Application.


Item has already been added. Key in dictionary: '??'  Key being added: '??'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Item has already been added. Key in dictionary: '??'  Key being added: '??'
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

DB Log:

At /umbraco/editContent.aspx?id=???? (Referred by: http://localhost/umbraco/umbraco.aspx): System.ArgumentException: Item has already been added. Key in dictionary: '??'  Key being added: '82'     at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)     at umbraco.controls.ContentControl.CreateChildControls()     at System.Web.UI.Control.EnsureChildControls()     at umbraco.controls.ContentControl.OnInit(EventArgs e)     at System.Web.UI.Control.InitRecursive(Control namingContainer)     at System.Web.UI.Control.AddedControl(Control control, Int32 index)     at umbraco.cms.presentation.editContent.OnInit(EventArgs e)     at System.Web.UI.Control.InitRecursive(Control namingContainer)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

How to reproduce the problem in my environments.(NOT 100%) : 

1. Create a document type with multiple tabs and inherited other tabs from parents document type.

2. Create a node and get {nodeId}.

3. Open edit page URL http://localhost/umbraco/editContent.aspx?id={nodeId}. on multiple browser (Here I used three difference browsers in the same time. )

3. Run command iisreset

4. Repeated step 2 & 3.

 

Temporary Solution:

1. Recycle Application pool.

2.Type:http://localhost/umbraco/cacheBrowser.aspx?clearByType=umbraco.cms.businesslogic.ContentType

 

Update : 2014.04.23

This is Umbraco bug will affected versions 4.7.0 & 4.8.0 , already fixed in changeset 18d853003c17 in 4.9.0 , the root cause is :
// This class can be cached and potentially shared between multiple threads.
// Two or more threads can attempt to lazyily-load its virtual tabs at the same time.
// If that happens, the m_VirtualTabs will contain duplicates.
// We must prevent two threads from running InitializeVirtualTabs at the same time.
// We must also prevent m_VirtualTabs from being modified while it is being populated.
// optimize, lazy load the data only one time

The issue may occur on every 30 min once the ContentType Cache refresh.

Permanent Solution:

  1. Update source code at /src/umbraco.cms/businesslogic/ContentType.cs , and rebuild source code to get businesslogic.dll
    http://umbraco.codeplex.com/SourceControl/changeset/18d853003c17#src/umbraco.cms/businesslogic/ContentType.cs
  2. Upgrade Umbraco version to v4.9.0

 

More Information :

沒有留言:

張貼留言