Copied to clipboard

Flag this post as spam?

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


  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 05, 2014 @ 14:33
    Anthony Dang
    0

    Crash on multiple doctype defs

    Umbraco 6.1.6, usync 1.5.7

    So basically, I created a doctype in attach mode. Then I deleted the doctype and created it as a child of another one.

    This causes a massive crash when the app starts. .net doesnt even give a meaningful error message. Below is my even error log. So basically I think what you could do is: if the doctype was already synched, then skip it, and log it.

     

     

    Exception information: 

        Exception type: HttpException 

        Exception message: An item with the same key has already been added.

       at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)

       at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)

       at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)

       at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)

       at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

     

    An item with the same key has already been added.

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

       at jumps.umbraco.usync.SyncDocType.ReadFromDisk(String path)

       at jumps.umbraco.usync.SyncDocType.ReadFromDisk(String path)

       at jumps.umbraco.usync.SyncDocType.ReadAllFromDisk()

       at jumps.umbraco.usync.uSync.ReadAllFromDisk()

       at jumps.umbraco.usync.uSync.RunSync()

       at jumps.umbraco.usync.uSync.DoOnStart()

       at Umbraco.Core.EnumerableExtensions.ForEach[TItem](IEnumerable`1 items, Action`1 action)

       at Umbraco.Core.CoreBootManager.Complete(Action`1 afterComplete)

       at Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete)

     

     

  • Kevin Jump 2328 posts 14814 karma points MVP 8x c-trib
    Jan 07, 2014 @ 12:54
    Kevin Jump
    0

    So did the usync folder end up with two .config files for the same doctype in different places? it should delete one of them when you delete the doctype - if it does that moves should work, because it just changes the parent type during the import.

    The error is from usync not checking before it adds the doctype to its internal dictionary object that is used for a second pass during the import - (i should fix that, so it only syncs the first one it finds)

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 07, 2014 @ 16:18
    Anthony Dang
    0

    I dont know how it ended up with 2 files but yes.

     

  • Kevin Jump 2328 posts 14814 karma points MVP 8x c-trib
    Jan 08, 2014 @ 11:13
    Kevin Jump
    0

    If added better (e.g some) error checking for multiple doctypes, so that shouldn't happen again.

    I can't replicate uSync leaving a rouge .config file on disk but I've added a bit more debugging around the delete to see if I can trap it next time it happens.

    v1.5.8 updated on our and nuget now.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 09, 2014 @ 13:08
    Anthony Dang
    0

    i think if you just check to see if it's already added the doctype, that should be fine.

    Should probably also do that for templates, datatypes etc 

  • Kevin Jump 2328 posts 14814 karma points MVP 8x c-trib
    Jan 09, 2014 @ 14:56
    Kevin Jump
    0

    yes that's basically what it now does, because of the structure elements uSync does a two pass install for doctypes, first putting them in, then making sure the structure and any removed properties are property sorted. So now it doesn't add the type to the second pass details if it's already been done.

    templates and datatypes are added in one pass, so it doesn't actually sort what's been added, if something appears twice on disk then the last one should always win ? (in theory)

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jan 09, 2014 @ 16:58
    Anthony Dang
    0

    Sounds good!

    Thanks for the good work!

     

  • Matt 8 posts 28 karma points
    Apr 17, 2015 @ 13:01
    Matt
    0

    Hi,

    I have the same issue, I removed all references, folders/dll's config file from the solution and installed your latest NuGet package and on first creation of items it runs into this issue. Can you help me out please? This is a production site we want to merge doctypes on

    Best,

    Matt.

Please Sign in or register to post replies

Write your reply to:

Draft