Alexander Genne
Alexander Genne

Reputation: 31

Intermittent problems starting Azure App Services: "500.37 ANCM Failed to Start Within Startup Time Limit"

Our app services are experiencing the problem, that they can’t be restarted by the hosting environment (ANCM).

The user is getting the following screen in that case: Http Error 500.37

Our production subscription consists of up to 8 different app services and the problem can randomly harm one of them ore some of them. The problem can occur several times a week, or just once a month.

The bootstrapping procedure of our app services is not time consuming.

The last occurrence of the problem has this log entries within the eventlog:

Failed to gracefully shutdown application 'MACHINE/WEBROOT/APPHOST/XXXXXXXXX'.

followed by:

Application '/LM/W3SVC/815681839/ROOT' with physical root 'D:\home\site\wwwroot' failed to load coreclr. Exception message: Managed server didn't initialize after 120000 ms

In most cases the problem can be resolved by manually stopping and starting the app service. In some cases we had to do that twice.

We are not able to reproduce that behavior locally.

The App Service Plan is S2 and we actually use just one instance.

The documentation of the Http error 500.37 recommends: "You may need to stagger the startup process of multiple apps."

But there is no hint of how to do that.

How can we ensure that our app services are restarted without errors.

Upvotes: 3

Views: 4046

Answers (1)

Fei Han
Fei Han

Reputation: 27793

HTTP Error 500.37 - ANCM Failed to Start Within Startup Time Limit

You can try following approaches:

Approach 1: If possible, can try to move one app into a new App Service with a separate App Service plan, then check whether it can start as expected.

Please note that creating and using a separate App Service plan would be charged.

Approach 2: Increasing the startupTimeLimit attribute of the aspNetCore element.

For more information about the startupTimeLimit attribute, please check: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.1#attributes-of-the-aspnetcore-element

Upvotes: 2

Related Questions