Copied to clipboard

Flag this post as spam?

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


  • MuirisOG 382 posts 1283 karma points
    Jul 04, 2017 @ 15:15
    MuirisOG
    0

    Intermittent Server error

    Hi Nicholas

    we get the error below intermittently. The only solution I know of has been to uninstall and reinstall formulate.

    Any help would be appreciated.

    Server Error in '/' Application.
    
    Current has already been initialized on formulate.app.Resolvers.Configuration. It is not possible to re-initialize Current once it has been initialized. 
      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: Current has already been initialized on formulate.app.Resolvers.Configuration. It is not possible to re-initialize Current once it has been initialized.
    
    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: Current has already been initialized on formulate.app.Resolvers.Configuration. It is not possible to re-initialize Current once it has been initialized.]
       Umbraco.Core.ObjectResolution.ResolverBase`1.set_Current(TResolver value) +283
       formulate.app.Handlers.ApplicationStartingHandler.InitializeResolvers() in C:\r\formulate\src\formulate.app\Handlers\ApplicationStartingHandler.cs:39
       formulate.app.Handlers.ApplicationStartingHandler.ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) in C:\r\formulate\src\formulate.app\Handlers\ApplicationStartingHandler.cs:27
       Umbraco.Core.ApplicationEventHandler.OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) +36
       Umbraco.Core.CoreBootManager.<Startup>b__8(IApplicationEventHandler x) +219
       Umbraco.Core.EnumerableExtensions.ForEach(IEnumerable`1 items, Action`1 action) +141
       Umbraco.Core.CoreBootManager.Startup(Action`1 afterStartup) +201
       Umbraco.Core.UmbracoApplicationBase.StartApplication(Object sender, EventArgs e) +271
       Umbraco.Core.UmbracoApplicationBase.Application_Start(Object sender, EventArgs e) +34
    
    [HttpException (0x80004005): Current has already been initialized on formulate.app.Resolvers.Configuration. It is not possible to re-initialize Current once it has been initialized.]
       System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9934477
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
    
    [HttpException (0x80004005): Current has already been initialized on formulate.app.Resolvers.Configuration. It is not possible to re-initialize Current once it has been initialized.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9948312
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
    
    
    
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36366 
    
  • MuirisOG 382 posts 1283 karma points
    Jul 04, 2017 @ 15:40
    MuirisOG
    1

    Again, I think I've screwed something up by creating my own startup control, which when the site does a reboot, has a knock-on effect on every other app.

    Sorry Nicholas, we are looking into this, and it may not be a call for you...

  • MuirisOG 382 posts 1283 karma points
    Jul 12, 2017 @ 11:16
    MuirisOG
    0

    Sorry Nicholas

    we still get this error, if we restart one of the sites in IIS (we have a number that all sit in the same Umbraco instance).

    Any help would be appreciated.

    Thanks

    Muiris

  • MuirisOG 382 posts 1283 karma points
    Jul 12, 2017 @ 13:18
    MuirisOG
    0

    I'm not sure if this is a coincidence, but I noticed when I deleted the two files (below) in <myInstallationFolder>\App_Data\TEMP that it reloads without any problems.

    umbraco-plugins.UMBRACO.hash
    umbraco-plugins.UMBRACO.list
    
  • Nicholas Westby 2045 posts 7032 karma points c-trib
    Jul 13, 2017 @ 15:19
    Nicholas Westby
    0

    I haven't seen this anywhere else, so my guess is you somehow have code that is causing Umbraco's startup code to run multiple times.

    Do you have a custom class implementing UmbracoApplication that you have your Global.asax pointing to?

    Also, does this error affect the site in any way, or is it just an entry in the log file that you happened to notice?

  • MuirisOG 382 posts 1283 karma points
    Jul 13, 2017 @ 15:26
    MuirisOG
    0

    Hi Nicholas,

    Yours is the only package installed.

    I do call ApplicationStarting for a content finder and URL provider.

    We also have several domains from one instance of Umbraco.

    And we end up with a YSOD if we edit the web.config or do something that may force the site to recompile.

  • Nicholas Westby 2045 posts 7032 karma points c-trib
    Jul 13, 2017 @ 15:43
    Nicholas Westby
    0

    Yours is the only package installed.

    That leads me to believe this could happen to any package that happens to have a startup event that is initializing resolvers. I strongly suspect there is something in your code base that is causing the startup handlers to run twice. I can give you some tips on how to confirm that if you like.

    In the meantime, what version of Umbraco and what version of Formulate are you using?

    Can you reproduce this issue with a clean install of Umbraco with Formulate installed and no customizations otherwise?

    We also have several domains from one instance of Umbraco.

    FYI, I don't expect that to be an issue. Both of these sites are on the same install and they're using Formulate:

  • MuirisOG 382 posts 1283 karma points
    Jul 13, 2017 @ 15:52
    MuirisOG
    0

    I suspect it must be my URL Provider / ContentFinder causing the problem. If you do have any tips I would be very grateful.

    As my site is WebForms (for the moment) I have some C# code in the App_Code folder running a URLProvider.

    It starts like this:

    namespace MyNamespace
    {
        public class StartUpApplication : ApplicationEventHandler
        {
            protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
            {
                ... code goes here
    
            }
        }
    
  • Nicholas Westby 2045 posts 7032 karma points c-trib
    Jul 13, 2017 @ 16:22
    Nicholas Westby
    0

    If you do have any tips I would be very grateful.

    My idea is basically to do a check in your ApplicationStarting to see if it gets run twice. You can create a static variable and increment it anytime your ApplicationStarting gets called, then log that to the Umbraco log file. If you see that it gets called more than once, that points to a global issue.

    Of course, not getting a log entry does not disprove that this is a global issue (e.g., by chance the Formulate handler may get called first, which may cause the website to bomb out before it gets to call your handler a second time). Worth a try though.

    By the way, is your Global.asax custom in any way?

  • MuirisOG 382 posts 1283 karma points
    Jul 13, 2017 @ 20:19
    MuirisOG
    0

    No, I'm pretty sure the Global.asax file is a one-liner which I haven't touched (but I did have a peek when the site was first installed).

    That's a great idea - I've been logging AppliationStarting to a file to try to figure out which server variables I can use. I will add a static variable and increment it.

    It's curious that the problem rights itself after removing the two files I mentioned earlier.

    Again, many thanks for you help, Nicholas.

    I'm coming to the end of a project that has lasted almost two years and am desperate to get our sites live.

Please Sign in or register to post replies

Write your reply to:

Draft