Copied to clipboard

Flag this post as spam?

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


  • Gaurav Mathur 11 posts 101 karma points
    Aug 30, 2019 @ 13:05
    Gaurav Mathur
    0

    IndexOutOfRangeException in SamSaffron\MiniProfiler

    We have our website running on Umbraco(Version 7.13.1 assembly: 1.0.6949.28284), without any issues, for quite sometime now. Yesterday suddenly one of the 3 production servers started throwing 500 for every request -

    Exception information: Exception type: ModelBindingException Exception message: Cannot bind source content type Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent to model content type Umbraco.Web.PublishedContentModels.Landing. The view model is a ModelsBuilder type, but the source is not. The application is in an unstable state and should be restarted. at Umbraco.Web.Mvc.RenderModelBinder.ThrowModelBindingException(Boolean sourceContent, Boolean modelContent, Type sourceType, Type modelType)…

    When we drilled down the issue, we found that it started after following exception -

    Exception information: Exception type: IndexOutOfRangeException Exception message: Index was outside the bounds of the array. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at StackExchange.Profiling.MiniProfiler.AddSqlTiming(SqlTiming stats) in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\MiniProfiler.IDbProfiler.cs:line 94 at StackExchange.Profiling.SqlTiming..ctor(IDbCommand command, ExecuteType type, MiniProfiler profiler) in c:\Code\github\SamSaffron\MiniProfiler\StackExchange.Profiling\SqlTiming.cs:line 72

    Resetting AppPool fixed the issue, however, we were not able to figure out what caused it. There were no changes made on the server, no OS patches, updates or anything.

    Could anyone please shed some light on what might have caused it?

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 30, 2019 @ 13:24
    Shaishav Karnani from digitallymedia.com
    0

    Hi Gaurav,

    This issue generally happens when database tends to grow and SQL have timeouts. This sometimes causes umbracoconfig.xml to get corrupt.

    -- If plugin urlTracker installed
    Select count(*) From icurlTracker
    
    -- Create a temporary table for all documents which are published and not in the recycle bin
    CREATE TABLE #Nodes (id int)
    GO
    -- Delete all rows if the table exists before
    TRUNCATE TABLE #Nodes
    GO
    
    -- Insert all nodeIds from all documents which are published and not in the recycle bin
    INSERT INTO #Nodes 
        SELECT N.id 
        FROM umbracoNode N
            INNER JOIN cmsDocument D ON N.ID = D.NodeId
        WHERE nodeObjectType = 'C66BA18E-EAF3-4CFF-8A22-41B16D66A972'
            AND [path] NOT LIKE '%-20%'
            AND D.Published = 1
    GO
    
    -- Create a temporary table for all versionId's to delete
    CREATE TABLE #Versions (id UniqueIdentifier)
    GO
    -- Delete all rows if it exists before
    TRUNCATE TABLE #Versions
    GO
    
    -- Insert all versionId's from all nodeIds in the #Nodes table 
    -- and where published is set to false and newest is set to false
    INSERT INTO #Versions
        SELECT versionId 
        FROM cmsDocument 
        WHERE nodeId IN (SELECT id FROM #Nodes) AND published = 0 AND newest = 0
    GO
    
    Select count(*) FROM cmsPreviewXml WHERE versionId IN (SELECT id FROM #Versions)
    GO
    Select count(*) cmsPropertyData WHERE VersionId IN (SELECT id FROM #Versions)
    GO
    Select count(*) cmsContentVersion WHERE VersionId IN (SELECT id FROM #Versions)
    GO
    Select count(*) cmsDocument WHERE VersionId IN (SELECT id FROM #Versions)
    GO
    

    Please review and let me know how it goes.

    Cheers,

    Shaishav

  • Gaurav Mathur 11 posts 101 karma points
    Aug 30, 2019 @ 17:50
    Gaurav Mathur
    0

    Thanks Shaishav, however, I doubt this is the issue coz we have a load balanced environment (sharing single DB) and the issue happened in only one server rest two are working fine.

    Also we stripped all the versions before deployment so the DB size is pretty small.

  • Angelo 111 posts 260 karma points
    Feb 17, 2021 @ 12:03
    Angelo
    0

    Hello Gaurav

    is there any documentation about your plugin FileSync ? im getting some errors in sync files ! ...

    thank you

    Angelo

  • Gaurav Mathur 11 posts 101 karma points
    Feb 17, 2021 @ 15:03
    Gaurav Mathur
    0

    Hey Angelo,

    Thanks for using FileSync. I would love to help if you could share screenshot of errors you are receiving.

    Also, it'd be great if you could please create a new thread and tag me or post url here.

    Thanks, Gaurav

  • Angelo 111 posts 260 karma points
    Feb 20, 2021 @ 16:15
  • Angelo 111 posts 260 karma points
    Feb 20, 2021 @ 16:19
Please Sign in or register to post replies

Write your reply to:

Draft