Copied to clipboard

Flag this post as spam?

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


  • Martin Griffiths 826 posts 1269 karma points c-trib
    Oct 04, 2018 @ 09:34
    Martin Griffiths
    0

    An item with the same key has already been added. Umbraco.Web.Editors.EntityController

    Hi all

    I'm getting a really strange error when trying to use the search in the umbraco backoffice in one of our builds (happening on the dev and uat build). It's on 7.12.2. I've tried fixing it with the following...

    1. republish entire site.
    2. emptying recycle bins
    3. re-indexing examine

    Umbraco.Web.Editors.EntityController

    Unhandled controller exception occurred

    System.ArgumentException: An item with the same key has already been added. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.ObjectModel.KeyedCollection2.AddKey(TKey key, TItem item) at System.Collections.ObjectModel.KeyedCollection2.InsertItem(Int32 index, TItem item) at Umbraco.Web.Search.SearchableTreeResolver.GetSearchableTrees() at Umbraco.Web.Editors.EntityController.SearchAll(String query) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_1.<GetExecutor>b__3(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.

  • Lars Heesakkers 38 posts 194 karma points
    Oct 08, 2018 @ 13:57
    Lars Heesakkers
    0

    Are there perhaps any duplicate properties in any of your doctypes (with maybe different casing)? I've seen similar errors with that being the problem.

  • Martin Griffiths 826 posts 1269 karma points c-trib
    Oct 09, 2018 @ 08:36
    Martin Griffiths
    0

    Hi Lars

    Yes I'm suspecting its something along those lines. I have been using uSync successfully for some time on builds, but I think something has gone wrong in the export/import process that has caused a duplicate somewhere.

    Kind regards Martin

  • Lars Heesakkers 38 posts 194 karma points
    Oct 09, 2018 @ 08:48
    Lars Heesakkers
    0

    You could try below SQL-query on your database. It creates a list of all properties on each document type. You can go trough this list to maybe find any duplicates. I couldn't test if the query works, as I am not experiencing any problems.

    select distinct 
    pd.contentNodeId,
        pt.Alias COLLATE sql_latin1_general_cp1_cs_as as PropertyTypeAlias  from cmsPropertyData as pd  
    inner join cmsPropertyType as pt on pd.propertytypeid = pt.id
    order by pd.contentNodeId
    

    If you run the query once with and once without the "COLLATE"-part, you can see if the rows returned by the query are the same for both. if that's the case, you know it's something with duplicate aliases

  • Martin Griffiths 826 posts 1269 karma points c-trib
    Oct 09, 2018 @ 09:42
    Martin Griffiths
    0

    Hi Lars

    Thanks for the query, but to keep things simple I re-imported all of the types into an empty (new) database with uSync to see if I could locate the issue more easily without having to be concerned with content.

    Still have the problem, but so far cannot locate any offending property types

Please Sign in or register to post replies

Write your reply to:

Draft