Unanswered .NET unhandled exceptions - then web role stops working

  • 16 April 2012 18:58
     
     

    Hi, I have a recurrent issue with my web roles.  I have two instances of the web role.  Everything is written in C# ASP.NET 4.0.

    Issue:

    1.  My site goes down permanently - trying to navigate to the web site results in nothing

    2.  When I go to the Management Portal, both web roles (I have 2 instances) are reporting Healthy.  However, eventually these show up as unhealthy. (this is a confirmed bug in Azure - web roles do not accurately reflect their true health)

    3.  RDPing to the web role works fine, and looking at the event viewer, there are always Errors prior to this occurrence.  The error in this case says:

    Application: WaIISHost.exe

    Framework Version: v4.0.30319

    Description: The process was terminated due to an unhandled exception.

    Exception Info: exception code e0455858, exception address 000007FEFDB7CACD

    I have also seen "OutOfMemoryExceptions"

    4.  I am able to resolve this by rebooting the server via the Management Portal.

    My questions is:

    1.  How can an unhandled exception occur in IIS, and what should I be doing to handle them? I have the correct code in the Application_Error area of global.asax.cs.  My web site is quite simple.  If there are many answers to this question, the most basic answer would be appreciated. 

    Thanks,

    Matt



Semua Balasan

  • 17 April 2012 5:11
    Moderator
     
     

    Hi,

    The exception code e0455858 here mean StackOverflowException here, do you ever make some complex caculation in your applicatin? Or this exception may cause OutOfMemory exception (GDI may also cause this exception), in general, these errors can hardly caused by specifical exception handler, so you will see WaIISHost.exe throw this exption.

    Also, you can refer to the following links to see if helps:

    http://thechroniclesofvinh.com/2011/02/06/azure-cloud-service-role-instance-wont-start/

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

  • 21 April 2012 6:17
     
     

    Check you app code whether it has any recursive calls, or has any memory leaks.. Looks like this has to do something related to your app logic.

    Regards,

    Laxmikant

  • 02 Mei 2012 10:39
     
     

    Does your App works fine in the Compute SImulator?

    Regards,

    Brij

  • 06 Juli 2012 3:24
     
     

    Hi Arwind,

    thanks for the reply.  I actually did not have any complex computations, and no use of GDI.  This issue has not resurfaced.  However, if a web role is at capacity (100% CPU) - could this particular stack overflow exception be thrown? 

    Thanks,

    Matt

  • 06 Juli 2012 3:27
     
     
    Thanks Laxmikant.  No recursive calls or memory leaks - I stay far away from those!  I think the issue was transient in the end - hard to tell what the cause was.