14

Our web app process is restarting regularly and we are unable to determine the reason.

When looking into Application Events (using the 'Diagnostics and solve problems' blade in the Azure Portal), there exists a bunch of the following Info logs by 'IIS AspNetCore Module'

Event ID 1005:

Failed to gracefully shutdown process '14040'.

Event ID 1001:

Application 'MACHINE/WEBROOT/APPHOST/myapplication__xxxx' started process '31628' successfully and is listening on port '17663'.

There is nothing fishy with general resource usage and nothing in our application logs.

What is the best way to troubleshoot the reason behind these process restarts?

EDIT 1:

After fiddling around with web logging in the Web App's Diagnostic Logs, I now get an error logged from W3SVC-WP after each restart, but the message is nonsense:

1<br/>5<br/>50000780

Application Events

EDIT 2:

Event Id 2284 refers to this:

FailedRequestTracing module failed to write buffered events to log file for the request that matched failure definition. No logs will be generated until this condition is corrected. The problem happened at least %1 times in the last %2 minutes. The data is the error.

I'm not sure if this could be related to our Diagnostic Logs configuration, but seems unlikely.

EDIT 3:

As per Brando Zhang's suggestion, I've used the Web App Crash Diagnoser extension and tried monitoring 2nd Chance Unhandled Exceptions on both my application process AND on w3wp, but nothing is dumped.

From how I understand it, 1st Chance Exceptions will not crash the process, so no need to monitor these.

Dave New
  • 38,496
  • 59
  • 215
  • 394
  • I suggest you could try to use Crash Diagnoser site extension to capture Dump for Intermittent Exception issues. More details you about how to use it could refer to this [article](https://blogs.msdn.microsoft.com/asiatech/2015/12/28/use-crash-diagnoser-site-extension-to-capture-dump-for-intermittent-exception-issues-or-performance-issues-on-azure-web-app/). – Brando Zhang Aug 02 '17 at 08:35
  • @BrandoZhang: please confirm that I should monitor 2nd Change Unhandled Exceptions on the application process? – Dave New Aug 04 '17 at 11:11
  • 2284 is related to tracing only I guess. More here: https://technet.microsoft.com/en-us/library/cc734951.aspx . Depending on your config, couldn't that be normal? IIS app pool can recycle: https://learn.microsoft.com/en-us/iis/configuration/system.applicationHost/applicationPools/add/recycling/ and https://github.com/aspnet/KestrelHttpServer/issues/1040#issuecomment-267506588 "IIS signals to the module, the module signals to the .NET Core proces" – Simon Mourier Aug 05 '17 at 06:49

1 Answers1

3

Very likely application is crashing due to fatal exception and causing the restarts.

On Azure App Service platform.You can use the Diagnostics as a Service (DaaS) to troubleshoot this

It can also do an analysis and tell you the root cause most of the time.More step by step infofrmation can be found on this msdn blog .Also refer tips for using crash diagnoser

Memory Dumps

Rohith
  • 5,527
  • 3
  • 27
  • 31