Share via

How to debug Container Crash Issue

Anonymous
2023-12-14T16:03:09.6233333+00:00

I deployed an Azure Web App with a Node.js environment. Sometimes I noticed a container crash with the following log in the Availability and Performance section. Can anyone help give me some hints as to what is the underlying issue?

Container exited unexpectedly: last 10 seconds logs [REDACTED]
Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


Answer accepted by question author

  1. SnehaAgrawal-MSFT 22,721 Reputation points Moderator
    2023-12-15T07:03:34.56+00:00

    @Afforai Verify Thanks for reaching here! Please check under Diganose and Solve Problems and search for Container crash, Container issues. It will help identify potential reason that are occurring-

    For details refer to- Azure App Service diagnostics overview

    User's image

    Steps to troubleshoot is-

    1. If the container couldn't start or exited, look at the AppLogs to see if the application error is causing the webserver/application to fail to respond successfully to the Platform's HTTP Ping or if there is an unhandled exception causing the container crash during runtime.
    2. Crashes at startup will be logged with the text: "Container 'container name' couldn't be started"
    3. Crashes at runtime will be logged with the text: "Container exited unexpectedly"
    4. The 5 latest application logs are shown in descending order which should give you a fair idea of the most current exception causing the issue.
    5. Assess and fix/handle the exceptions that maybe causing the container to crash/exit at startup or during runtime.
    6. In case your container is not throwing any exceptions but simply requires more than 230 seconds to complete initialization and respond successfully to the Platform's HTTP Ping , we allow you to increase that 230 second wait time up to a limit of 1800 seconds. To configure that, add an app setting called WEBSITES_CONTAINER_START_TIME_LIMIT and set it to the number of seconds you would like for us to wait for your container to start.
      https://docs.microsoft.com/en-us/archive/blogs/waws/things-you-should-know-web-apps-and-linux#if-your-container-takes-a-long-time-to-start-increase-the-start-time-limit
    7. Please review the following article that might help you customize and configure your Web App to your requirements https://docs.microsoft.com/en-us/azure/app-service/containers/configure-custom-container
    8. We cover many unique topics on our Azure OSS Developer Support Blog which can be found here https://azureossd.github.io/.

    Please let us know if further assistance is required here.

    Was this answer helpful?

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.