Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stephen Kiers 41 posts 62 karma points
    Mar 19, 2013 @ 19:49
    Stephen Kiers
    0

    An item with the same key has already been added, error

    I am getting an error after upgrading from 4.7 to 6.0.2. 

     

    Server Error in '/' Application.

    An item with the same key has already been 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: An item with the same key has already been 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.

    Stack Trace: 

    [ArgumentException: An item with the same key has already been added.]

       System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +52

       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +265

       System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +36

       umbraco.cms.businesslogic.ContentType.GetDataType(String contentTypeAlias, String propertyTypeAlias) +274

       Umbraco.Core.PublishedContentHelper.GetDataType(String docTypeAlias, String propertyAlias) +22

       Umbraco.Web.PublishedContentExtensions.GetPropertyValue(IPublishedContent prop, String alias, Boolean recursive, T ifCannotConvert) +76

       Umbraco.Web.PublishedContentExtensions.GetPropertyValue(IPublishedContent prop, String alias, T ifCannotConvert) +11

       Umbraco.Web.Routing.PublishedContentRequestBuilder.FollowRedirect() +47

       Umbraco.Web.Routing.PublishedContentRequestBuilder.LookupDocument() +190

       Umbraco.Web.Routing.PublishedContentRequest.ProcessRequest(HttpContextBase httpContext, UmbracoContext umbracoContext, Action`1 onSuccess) +171

       Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +356

       Umbraco.Web.UmbracoModule.<Init>b__7(Object sender, EventArgs e) +79

       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +135

       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137

     

    If you need any other information, please let me know. :)

  • Stephen Kiers 41 posts 62 karma points
    Mar 19, 2013 @ 20:19
    Stephen Kiers
    0

    Also getting the error :

    2013-03-19 12:50:25,609 [34] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 22] An unhandled exception occurred

     

    System.NullReferenceException: The UmbracoContext.Current is null, ProcessRequest cannot proceed unless there is a current UmbracoContext

       at Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext)

       at Umbraco.Web.UmbracoModule.<Init>b__7(Object sender, EventArgs e)

       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

     

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 21, 2013 @ 06:00
    Shannon Deminick
    0

    Can you give steps to reproduce how you are getting this issue? What code is causing this ?

  • Stephen Kiers 41 posts 62 karma points
    Mar 21, 2013 @ 16:56
    Stephen Kiers
    0

    It seems to be happening quite randomly. Any pageload/ajax event on the site in frontend or backend randomly throws this error. It is quite frustrating.

    If you have any tips to debug it better, I am more than willing. :)

  • Matt Jones 30 posts 141 karma points
    Mar 29, 2013 @ 18:03
    Matt Jones
    0

    I'm also getting this error on a new install of Umbraco v6.0.3 (Assembly version: 1.0.4834.18854)

     

    Just when I add any new content.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 29, 2013 @ 18:05
    Shannon Deminick
    0

    @Matt, does that happen every time you add new content ? Is it only one type of content or all types?

  • Matt Jones 30 posts 141 karma points
    Mar 29, 2013 @ 18:10
    Matt Jones
    0

    Hi Shannon,

     

    It's just 2 content types, I'd created them by making copies of an existing doc type. I wanted to do that because they have similar properties.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 29, 2013 @ 18:13
    Shannon Deminick
    0

    @Matt ok, but are you getting this error every single time you are creating content of these types ? And what property types do you have assigned to this content type?  I need to have a way to reproduce this error as i cannot locally at the moment.

  • Matt Jones 30 posts 141 karma points
    Mar 29, 2013 @ 18:22
    Matt Jones
    0

    Hi Shannon

    The whole process I went through is:

    I installed the Standard Website MVC Starter Kit, I copied the 'Standard' doc type positioned under 'Standard' (named 'Chapter'), removed the panels tab and picker for the panels. In the Structure for 'Standard' I allowed Chapter to be a child.

    I hadn't added any additional properties to the Chapter type yet. Every time i tried to add a chapter under a s Standard doc i got the error.

     

    I have now deleted the copied Doc Type and just added it using Create instead of copy and that's ok, but I guess copy should be ok too?

     

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 29, 2013 @ 18:33
    Shannon Deminick
    0

    @Matt, ok thanks, i'll create an issue with these details and see if we can replicate.

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Mar 29, 2013 @ 18:35
    Shannon Deminick
    0

    Also note that the issue @Matt is having is different from the one that @Stephen is having since his appears to be on the front-end. @Matt can you please post the full stack trace you are getting ?

  • Matt Jones 30 posts 141 karma points
    Mar 29, 2013 @ 18:38
    Matt Jones
    0

    sure:

     

    Server Error in '/' Application.


    An item with the same key has already been 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: An item with the same key has already been 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.


    Stack Trace: 

    [ArgumentException: An item with the same key has already been added.]
       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14169316
       umbraco.controls.ContentControl.AddControlNew(Property p, TabPage tp, String Caption) +285
       umbraco.controls.ContentControl.LoadPropertyTypes(IContentTypeComposition contentType, TabPage tabPage, Hashtable inTab, Int32 tabId, String tabCaption) +360
       umbraco.controls.ContentControl.CreateChildControls() +804
       System.Web.UI.Control.EnsureChildControls() +189
       umbraco.controls.ContentControl.OnInit(EventArgs e) +51
       System.Web.UI.Control.InitRecursive(Control namingContainer) +186
       System.Web.UI.Control.AddedControl(Control control, Int32 index) +189
       umbraco.cms.presentation.editContent.OnInit(EventArgs e) +1231
       System.Web.UI.Control.InitRecursive(Control namingContainer) +186
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2098
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034

  • Razvan 36 posts 67 karma points
    Apr 11, 2013 @ 16:50
    Razvan
    0

    I had a simmilar problem, but the source of my problem was that I've used incorectly the "Mixin" option in uSiteBuilder

  • Stephen Kiers 41 posts 62 karma points
    Apr 25, 2013 @ 22:00
    Stephen Kiers
    0

    Just checking in again. It seems that the problem hasn't 'gone away' (I didn't think it would magically, but you never know).

    Is there any way to get better debug information from the system?

     

    [NullReferenceException: The UmbracoContext.Current is null, ProcessRequest cannot proceed unless there is a current UmbracoContext] Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +408 Umbraco.Web.UmbracoModule.<Init>b__7(Object sender, EventArgs e) +79 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +135 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137

  • Stephen Kiers 41 posts 62 karma points
    Apr 25, 2013 @ 22:00
    Stephen Kiers
    0

    Also, for hte record, we don't use uSiteBuilder. 

     

    The site is an upgrade from 4.7 though.

  • Stephen Kiers 41 posts 62 karma points
    May 13, 2013 @ 22:43
    Stephen Kiers
    0

    We ended up disabling log4net and it works now.

  • Mike Bridge 1 post 21 karma points
    May 13, 2013 @ 23:36
    Mike Bridge
    0

    ... and for the record, Stephen's (and my) server is running New Relic, which may be what's in conflict.

  • Eric Herlitz 97 posts 129 karma points
    Jul 10, 2013 @ 21:27
    Eric Herlitz
    1

    I had the exact same issue and it was resolved by removing duplicate properties from child document types.

    In example, my "root" document type had a property called Title and a child to this document type had also implemented that property in a previous version. This was probably allowed since the relations in my database wasn't intact at the moment.

    • The benefit from removing the property from the child is that you can edit the pages again
    • The downside of removing it is that all data is also removed.

     

  • Ashley Andersen 45 posts 88 karma points
    Aug 13, 2013 @ 17:43
    Ashley Andersen
    0

    I resolved my same error similarly to Eric above.

    When I copied the Doctype it created two Content tabs, one inherited from the parent and one for the new Doctype, removing duplicate fields corrected the error.

Please Sign in or register to post replies

Write your reply to:

Draft