Why am I getting a Deploy Error: Health Checks?

When I deploy a new application on the App Platform, I see the Building… progress indicator but after a while it errors out and I see this:

Deploy Error: Health Checks
Your deploy failed because your container did not respond to health checks.
Error code: DeployContainerHealthChecksFailed

I have the same issue while not running an webservice. just an discordbot which use a MongoDB Database hosted on digitalocean. it worked fine on droplets but the performance there is worse and discord bots go offline after a while for no reason. I’m hoping, that someone could help me out.

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In general, when App Platform attempts to deploy your application it will run some automated health checks to make sure your app started correctly before sending web traffic to it. You can configure these checks, but by default they’re just checking to see if your app is listening on port 8080.

So the most common reason for this error, especially with a new app, is a misconfigured port.

App Platform expects that any Service you deploy will listen on all interfaces on port 8080 ( If you cannot modify your Service’s code to listen on port 8080, you can configure App Platform to expect a different port. This can be done during initial App creation or on the Component details page of your Service after your App has been created. If you’re configuring your application via App Spec, you can use the http_port key to set App Platform to expect your Service on a different port.

For convenience, App Platform will set an environment variable named PORT in your runtime environment that contains the expected port number for your Service to listen on.

This comment has been deleted

Had the same issue while using Nuxt.js and deploying as an app. I added this to nuxt.config.js:

server: {
  port: process.env.PORT,
  host: process.env.HOST

Leaving the default HTTP port in DigitalOcean, but adding an env var in the component configuration HOST= This lets me work locally via .env and on DigitalOcean without hardcoding anything.

So I deployed a Django app from a Docker image. Following @VoutNL suggestion, I specified the below command to get it to work.

python, runserver

Same error over here when i try to deploy a NuxtJS app. App is running fine on an 5 dollar droplet and currently i’m also testing Vercel (which is working fine) but for one or another reason it doesn’t work on Digital Ocean… and ofcourse a very useful error log with 0 errors in it ;)