Copied to clipboard

Flag this post as spam?

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


  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 28, 2013 @ 22:09
    Nik Wahlberg
    0

    Collection was modified - Issue with 6.1.4 on server

    Hi all, we have upgraded a 4.11.10 install to 6.1.4 and everything is running fine locally. When deploying the upgraded application to the staging server (where the current 4.11.10 is running), we can't run the application. The following error is shown:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------
    
    Collection was modified; enumeration operation may not execute. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Stack Trace: 
    
    
    [InvalidOperationException: Collection was modified; enumeration operation may not execute.]
       System.Collections.HashtableEnumerator.MoveNext() +222
       Umbraco.Web.UmbracoModule.DisposeHttpContextItems(HttpContext http) +264
       Umbraco.Web.UmbracoModule.<Init>b__9(Object sender, EventArgs args) +360
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +163
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +417
    

    So, we tried a clean install of 6.1.4 (manual and webPI) and the problem happens there too. Anyone seen this before? Greatly appreciate any ideas.

    Thanks!

  • Paul Sterling 718 posts 1534 karma points MVP 8x admin c-trib
    Aug 29, 2013 @ 00:34
    Paul Sterling
    0

    Nik -

    Is this with a vanilla install, or did you deploy with your bits in place already?  If so, any chance you can provide relavant custom code?

    -Paul

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 29, 2013 @ 01:41
    Nik Wahlberg
    0

    Hi Paul, this is vanilla bean. Nothing custom. We put a try/catch around the relevant code (derived from stack trace) in the source, recompiled, and the problem went away. Of course, we'll need to figure out the root cause.

    Original code:

     private static void DisposeHttpContextItems(HttpContext http)
     {
          foreach (DictionaryEntry i in http.Items)
          {
             i.Value.DisposeIfDisposable();
             i.Key.DisposeIfDisposable();
          }
     }
    

    Altered code:

    private static void DisposeHttpContextItems(HttpContext http)
    {
        try
        {
           foreach (DictionaryEntry i in http.Items)
           {
              i.Value.DisposeIfDisposable();
              i.Key.DisposeIfDisposable();
           }
         }
         catch(Exception ex){ } 
    }
    

    Thanks, Nik

  • Paul Sterling 718 posts 1534 karma points MVP 8x admin c-trib
    Aug 29, 2013 @ 01:47
    Paul Sterling
    0

    Ah...looks like this from what you sent:

    http://stackoverflow.com/questions/604831/collection-was-modified-enumeration-operation-may-not-execute

    Care to log an issue? :-)

    -Paul

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 29, 2013 @ 01:48
    Nik Wahlberg
    0

    Yeah, found that little gem on Stackoverflow as well. Of course, will log it!

    Cheers, Nik

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Aug 29, 2013 @ 19:25
    Nik Wahlberg
    0

    Issue logged here: http://issues.umbraco.org/issue/U4-2738

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft