question

studix-5643 avatar image
3 Votes"
studix-5643 asked EddieLiu22781942-7584 commented

Diagnose container start issues in Azure App Service for Linux

I deployed successfully a simple rails app to my Azure App Service following this Microsoft Docs 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-webapps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SnehaAgrawal-MSFT avatar image
0 Votes"
SnehaAgrawal-MSFT answered

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IftachSchonbaum-2041 avatar image
5 Votes"
IftachSchonbaum-2041 answered EddieLiu22781942-7584 commented

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?

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@IftachSchonbaum-2041: So you only have a single log entry in the container log? Then I have no idea how you can debug further.


Just for completness: I could solve my original startup problem by eliminating the bootstrap gem from my gem file. I included bootstrap manually with the help of this article


0 Votes 0 ·

I have the same issue as you with the same error msg: Stopping site app-xxxx because it failed during startup.

Have you figured out how to solve it?

0 Votes 0 ·
ryanchill avatar image ryanchill EddieLiu22781942-7584 ·

@EddieLiu22781942-7584 do you see any additional entries in /api/logs/docker on your kudu console?

0 Votes 0 ·

I have fixed that after checking the logs on Azure portal. It's just because I haven't specified all required packages on requirements.txt. (my application is on flask)

1 Vote 1 ·
OscarPreis-2575 avatar image
1 Vote"
OscarPreis-2575 answered

@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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TmikTmik-3624 avatar image
0 Votes"
TmikTmik-3624 answered TmikTmik-3624 published

Halloechen, comrades!
Enybody was able to solve this problem?
We have face with Container Xx for site Yy did not start within expected time limit problem, and we havn't answer for that question in current time. Docker logs is empty (without necessarily information)..

  2021-03-30T19:19:42.316914100Z Documentation: http://aka.ms/webapp-linux
  2021-03-30T19:19:42.316918100Z Python 3.7.9
  2021-03-30T19:19:42.316921800Z Note: Any data outside '/home' is not persisted
  2021-03-30T19:19:42.421475957Z Starting OpenBSD Secure Shell server: sshd.
  2021-03-30T19:19:42.461231021Z Site's appCommandLine: ./run_webapi.sh
  2021-03-30T19:19:42.461861027Z Checking of ./run_webapi.sh is a file
  2021-03-30T19:19:42.463947846Z App command line is a file on disk
  2021-03-30T19:19:42.478289277Z App command line is a shell script, will execute this script as startup script
  2021-03-30T19:19:42.481361205Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -bindPort 8000 -userStartupCommand ./run_webapi.sh
  2021-03-30T19:19:42.533730385Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
  2021-03-30T19:19:42.539747540Z Build Operation ID: |RpX1Owk7T4s=.4ad91264_
  2021-03-30T19:19:42.541898860Z Oryx Version: 0.2.20201225.1, Commit: 70edd60569a71918c11bc4dfda1355f6c56f1546, ReleaseTagName: 20201225.1
  2021-03-30T19:19:43.006477913Z Writing output script to '/opt/startup/startup.sh'
  2021-03-30T19:19:43.953502878Z Found virtual environment .tar.gz archive.
  2021-03-30T19:19:43.953527078Z Removing existing virtual environment directory /antenv...
  2021-03-30T19:19:43.963575669Z Extracting to directory /antenv...
  2021-03-30T19:20:03.762822318Z Using packages from virtual environment antenv located at /antenv.
  2021-03-30T19:20:03.763456124Z Updated PYTHONPATH to ':/antenv/lib/python3.7/site-packages'
  2021-03-30T19:20:24.258440190Z [2021-03-30 19:20:24 +0000] [44] [INFO] Starting gunicorn 20.0.4
  2021-03-30T19:20:24.260633500Z [2021-03-30 19:20:24 +0000] [44] [INFO] Listening at: http://0.0.0.0:8000 (44)
  2021-03-30T19:20:24.260654499Z [2021-03-30 19:20:24 +0000] [44] [INFO] Using worker: sync
  2021-03-30T19:20:24.270884981Z [2021-03-30 19:20:24 +0000] [47] [INFO] Booting worker with pid: 47


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RajatAgarwal-2321 avatar image
0 Votes"
RajatAgarwal-2321 answered RajatAgarwal-2321 published

@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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

studix-5643 avatar image
0 Votes"
studix-5643 answered studix-5643 commented

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.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I checked the container logs again and found the problem.

2020-05-21T23:33:14.626857866Z WARNING: Nokogiri was built against LibXML version 2.9.4, but has dynamically loaded 2.9.1
2020-05-21T23:33:16.165823130Z /tmp/bundle/gems/ffi-1.12.2/lib/ffi/library.rb:145:in block in ffi_lib': Could not open library '/tmp/bundle/gems/sassc-2.2.1/ext/libsass.so': /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by /tmp/bundle/gems/sassc-2.2.1/ext/libsass.so) (LoadError)

I interpreted the second log message as a warning. Now I can investigate further.

Thansk @SnehaAgrawal-MSFT for your help.



0 Votes 0 ·