Copied to clipboard

Flag this post as spam?

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


  • Jordan 24 posts 182 karma points
    May 03, 2017 @ 10:52
    Jordan
    0

    Lucene Internal Index Error after upgrade

    Hi All,

    I have been looking around for a while to what could possibly cuase this issue but can't seem to find anything. I have recently upgraded an umbraco site from version 7.3.5 to version 7.5.13, which for the most part has gone very smoothly.

    However I seem to have one issue where it will randomly Error on startup: The Given key was not present in the dictionary.

    I have now realized it is the internal index that is causing this issue, and currently there is no way to rebuild the internal index. Full error message from the umbraco logs below:

     2017-05-03 11:23:51,887 [P25316/D3/T38] INFO  Umbraco.Web.WebServices.ExamineManagementApiController - Rebuilding index 'InternalIndexer'
     2017-05-03 11:23:51,889 [P25316/D3/T38] INFO  UmbracoExamine.DataServices.UmbracoLogService - Rebuilding index, Provider=InternalIndexer, NodeId=-1
     2017-05-03 11:23:51,925 [P25316/D3/T38] INFO  UmbracoExamine.DataServices.UmbracoLogService - PerformIndexAll - Start data queries - content, Provider=InternalIndexer, NodeId=-1
     2017-05-03 11:23:52,343 [P25316/D3/T38] ERROR Umbraco.Web.WebServices.ExamineManagementApiController - An error occurred rebuilding index
    System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.ProcessQuery(Sql sqlFull, PagingSqlQuery pagingSqlQuery, Boolean withCache, Boolean includeAllVersions)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.<GetPagedResultsByQuery>b__54(Sql sqlFull, PagingSqlQuery`1 pagingSqlQuery)
       at Umbraco.Core.Persistence.Repositories.VersionableRepositoryBase`2.GetPagedResultsByQuery[TDto](IQuery`1 query, Int64 pageIndex, Int32 pageSize, Int64& totalRecords, Tuple`2 nodeIdSelect, Func`3 processQuery, String orderBy, Direction orderDirection, Boolean orderBySystemField, Func`1 defaultFilter)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.GetPagedResultsByQuery(IQuery`1 query, Int64 pageIndex, Int32 pageSize, Int64& totalRecords, String orderBy, Direction orderDirection, Boolean orderBySystemField, IQuery`1 filter)
       at Umbraco.Core.Services.ContentService.GetPagedDescendants(Int32 id, Int64 pageIndex, Int32 pageSize, Int64& totalChildren, String orderBy, Direction orderDirection, Boolean orderBySystemField, String filter)
       at Umbraco.Core.Services.ContentService.GetPagedDescendants(Int32 id, Int64 pageIndex, Int32 pageSize, Int64& totalChildren, String orderBy, Direction orderDirection, String filter)
       at UmbracoExamine.UmbracoContentIndexer.PerformIndexAll(String type)
       at Examine.LuceneEngine.Providers.LuceneIndexer.IndexAll(String type) in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 797
       at UmbracoExamine.BaseUmbracoIndexer.IndexAll(String type)
       at UmbracoExamine.BaseUmbracoIndexer.PerformIndexRebuild()
       at Examine.LuceneEngine.Providers.LuceneIndexer.RebuildIndex() in X:\Projects\Examine\Examine\src\Examine\LuceneEngine\Providers\LuceneIndexer.cs:line 752
       at UmbracoExamine.UmbracoContentIndexer.RebuildIndex()
       at Umbraco.Web.WebServices.ExamineManagementApiController.PostRebuildIndex(String indexerName)
    

    Does anyone have any Ideas on, what could petentionally be causing this issue? The ExamineIndex.config and ExamineSettings.Config, are left as the default settings, that came with the build.

  • Alex Skrypnyk 5730 posts 21691 karma points MVP 3x admin c-trib
    May 09, 2017 @ 21:00
    Alex Skrypnyk
    0

    Hi Jordan

    Why you can't rebuild an internal index?

    /Alex

  • Alex Skrypnyk 5730 posts 21691 karma points MVP 3x admin c-trib
    May 12, 2017 @ 10:55
    Alex Skrypnyk
    1

    Hi Jordan

    Did you solve your issue? Can I help you?

    Alex

  • Jordan 24 posts 182 karma points
    May 12, 2017 @ 10:58
    Jordan
    1

    Hi Alex,

    Sorry missed your last reply, Thanks for replying. Unfortantly not at the moment. Not sure what is causing the issue, seems very strange. I have noticed that the Internal Indexer does create new Items as you save content fine, but fails when trying to rebuild the whole index.

    Could it potentionally be a corrupted content node, thats is causing the failure?

    Haven't really been able to tell much from the log. Let me know if you need any extra information.

    Thanks, Jordan

  • Jordan 24 posts 182 karma points
    Jun 08, 2017 @ 16:03
    Jordan
    103

    I have managed to fix this issue, After putting some additional logging into the core project to give me some extra information. I managed to deduce it was an issue within the cmsDocument table.

    Turns out there duplicated nodes, with both published and newest flags set to true.

    I found a query that manages to return all duplicated values in the table, on an old bug ticket: http://issues.umbraco.org/issue/U4-2361

    select [nodeId], [versionId], [newest], [updateDate] from [cmsDocument] where newest=1 and nodeId in (
    SELECT [nodeId] FROM [cmsDocument] where newest = 1 group by nodeId having COUNT(*) > 1) order by nodeId, updateDate
    

    From there you can work out which nodes are the most recent and should be kept, and delete the older nodes.

    After deleting all the duplicates in this table, the index rebuilt as expected.

    Hope this helps someone!

  • Andrew Lansdowne 39 posts 120 karma points
    Feb 17, 2020 @ 16:32
    Andrew Lansdowne
    0

    Thanks for this, Just to add all I had to do to 'fix' these nodes was browse to them in content tree and save & publish.

Please Sign in or register to post replies

Write your reply to:

Draft