Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 28, 2018 @ 14:09
    Ismail Mayat
    0

    Examine site start up error

    I am running umbraco 7.7.2 with a site that has about 4k nodes. On all environments after a deploy if the indexes folder is empty then it does an index rebuild as expected when you request a page.

    When the page finally loads I get a ysod namely:

    [KeyNotFoundException: The given key was not present in the dictionary.] System.ThrowHelper.ThrowKeyNotFoundException() +36 System.Collections.Generic.Dictionary2.get_Item(TKey key) +52 UmbracoExamine.UmbracoContentIndexer.ReindexWithXmlEntries(String type, Int32 parentId, Func1 getContentTypes, Func4 getPagedXmlEntries, Func2 getContent) +1770 UmbracoExamine.UmbracoContentIndexer.PerformIndexAll(String type) +1838 UmbracoExamine.BaseUmbracoIndexer.IndexAll(String type) +76 UmbracoExamine.BaseUmbracoIndexer.PerformIndexRebuild() +111 UmbracoExamine.BaseUmbracoIndexer.RebuildIndex() +69 Umbraco.Web.WebBootManager.Complete(Action`1 afterComplete) +382 Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +381

    If you refresh the page a couple of times it finally loads. Has anyone seen this before?

    Regards

    Ismail

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 28, 2018 @ 14:34
    Ismail Mayat
    0

    Update on this so in the stack trace we have call to UmbracoContentIndexer.ReindexWithXmlEntries however when I look at source of examine I cannot find this method. I am using examine 0.1.89 and I have looked at source for that branch.

    This is really weird.

    Regards

    Ismail

  • Nik 1611 posts 7237 karma points MVP 7x c-trib
    Feb 28, 2018 @ 15:23
    Nik
    0

    Hi Ismail,

    Had a quick search of the Umbraco github, looks like ReindexWithXmlEntries is an internal method https://github.com/umbraco/Umbraco-CMS/blob/7ee510ed386495120666a78c61497f58ff05de8f/src/UmbracoExamine/UmbracoContentIndexer.cs#L580

    Don't know if that will help, but thought I'd flag it to you :-)

    Nik

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 28, 2018 @ 15:26
    Ismail Mayat
    0

    Nik,

    Yup found it, looks like the XML is referencing and icon that is not in the dictionary, although why after a while it starts to work I'm not sure

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 28, 2018 @ 18:52
    Ismail Mayat
    100

    So figured and fixed my issue

    This is erroring on media xml the item in question is id 10593 which is folder in media section

    select * from cmsContentXml where nodeid=10593

    If you run query above and look at xml you can see its type is 10592 however run query below and you get nothing.

    select * from cmsContentType where nodeid =10592

    If you run query below you can see the problem xml

    SELECT * FROM cmscontentxml WHERE CAST([xml] AS NVARCHAR(MAX)) LIKE '%nodeType="10592"%';

    This is causing error in umbraco examine indexer on line

    https://github.com/umbraco/Umbraco-CMS/blob/7ee510ed386495120666a78c61497f58ff05de8f/src/UmbracoExamine/UmbracoContentIndexer.cs

    element.Add(new XAttribute("icon", icons[element.AttributeValue

    icons is a dictionary that is populated by

    _contentTypeService.GetAllMediaTypes().ToArray() var icons = contentTypes.ToDictionary(x => x.Id, y => y.Icon);

    We have in site media types only file, image and folder nothing with id 10592.

    I am not sure how this xml has mashed up. So i saved just that folder that regenerated the xml with correct id i then did rebuild and that has solved it.

    One thing to note currently on this site there is no media stub information in the index so when on front end we get images instead of getting from examine it gets from db so we are taking a performance hit.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft