Diagnose container start issues in Azure App Service for Linux

studix 46 Reputation points
2020-05-27T05:20:18.967+00:00

I deployed successfully a simple rails app to my Azure App Service following this Microsoft Learn tutorial but the app does not start.

How can I diagnose container startup problems in Azure App Service for linux?

What I already did:

  • run the app in production environment locally -> works on my machine
  • changed rails version from 5.1.7 to 5.2.4.3
  • verified my environment variables
  • extended the container start time configuration to max (using the environment variable WEBSITES_CONTAINER_START_TIME_LIMIT)
  • checked the rails app production.log file -> no entries there
  • checked the container logs:

....docker.log

> 2020-05-20 18:53:36.737 ERROR - Container xy for site tournaments-app has exited, failing site start
> 2020-05-20 18:53:36.760 ERROR - Container xy respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
> 2020-05-20 18:53:36.786 INFO - Stoping site tournaments-app because it failed during startup.

...default.log (last line)

> 2020-05-20T18:53:35.862298997Z from bin/rails:3 <main>

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,068 questions
0 comments No comments
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 19,181 Reputation points
    2020-05-27T11:08:35.237+00:00

    Thanks for asking question! If you are experiencing problem with site, you may check the docker log, this is helpful in troubleshooting your site when it doesn't start or if it's restarting. Different ways to access Docker logs is below:

    1. Docker logs appear on the Container Settings page in the portal.
    2. You can find the Docker log in the /LogFiles directory. You can access this via the Kudu (Advanced Tools) Bash console or by using
      an FTP client to access it.
    3. You can use our API to download the current logs.

    Also, investigate on if your container is responding to an HTTP ping as in order to consider a container to be successfully started, the container must start and must respond to an HTTP ping. If the container starts but does not respond to a ping, this will eventually log an event in the Docker log saying that it didn't start.

    You may refer to the blog Things You Should Know: Web Apps and Linux for more details on this.

    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Iftach Schonbaum 26 Reputation points
    2020-06-16T12:53:04.877+00:00

    i have the same issue but other than the message as your described here originally: "2020-06-16T11:54:57.594Z INFO - Stopping site app-xxxx because it failed during startup." - i dont get any further messages. and i have no idea how to debug it. any ideas?

    5 people found this answer helpful.

  2. Oscar Preis 6 Reputation points
    2020-06-19T19:00:11.737+00:00

    @IftachSchonbaum-2041 I have the same issue. Container didn't respond to HTTP pings on port: 8080, failing site start.
    I hope someone will be able to help with that.

    1 person found this answer helpful.
    0 comments No comments

  3. studix 46 Reputation points
    2020-05-27T15:02:00.59+00:00

    Thanks for your answer @SnehaAgrawal-MSFT .

    Checking the container logs was the first thing I did. The output of the container logs are in the original question. Nothing helpful there.

    I also already read the blog post you mentioned.


  4. Rajat Agarwal 1 Reputation point
    2020-06-25T21:28:57.337+00:00

    @SnehaAgrawal-MSFT
    Same issue here.

    Have tried with below listed startup commands

    pm2 start app.js
    pm2 start npm -- start
    pm2 start npm --name "app" -- start
    pm2 start ecosystem.config.js

    For each of teh command i get the below:

    2020-06-25T20:58:09.005497987Z [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2
    2020-06-25T20:58:17.645371122Z [PM2] PM2 Successfully daemonized
    2020-06-25T20:58:18.057023590Z [PM2][WARN] Applications my-app not running, starting...
    2020-06-25T20:58:18.358542401Z [PM2] App [my-app] launched (1 instances)
    2020-06-25T20:58:18.881539640Z
    App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
    my-app │ 0 │ N/A │ fork │ 75 │ online │ 0 │ 0s │ 0% │ 27.6 MB │ root │ enabled │

    2020-06-25T20:58:18.899354059Z Use pm2 show <id|name> to get more details about an app
    2020-06-25T20:58:23.912Z ERROR - Container XXXXXXX for site XXXXXXXX has exited, failing site start
    2020-06-25T20:58:23.923Z ERROR - Container XXXXXXX didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
    2020-06-25T20:58:23.951Z INFO - Stopping site XXXXXXX because it failed during startup.

    Have already put it this on APP Setting
    -NODE_ENV dev -WEBSITES_PORT 8080 -PORT 8080 -WEBSITE_PORT 8080

    During release i can see that above settings are being applied
    2020-06-25T21:17:32.5100240Z Trying to update App Service Application settings. Data: {"NODE_ENV":"dev","WEBSITES_PORT":"8080","PORT":"8080","WEBSITE_PORT":"8080"}
    2020-06-25T21:17:35.4886307Z Updated App Service Application settings and Kudu Application settings.
    2020-06-25T21:18:02.9285859Z Updated App Service Application settings and Kudu Application settings.

    When i just set startup command to npm start everything works well.

    0 comments No comments