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

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.

×
2 answers

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 (0.0.0.0: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.

  • I also get this:

    If I check the deploy logs I get:

    Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    

    I have set the port correctly in the Components, but I can’t get an endpoint to check.

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 ;)

  • Hi @registerStarfish – is your NuxtJS app in a public repo? If so, can you share it here? I’d like to give it a try and see what might be wrong.

    • Not necessary anymore, it’s fixed.

      Not only the port number is relevant but also the host. After changing my code from,

      server: {
        port: 8080 // default: 3000
      },
      

      to

      server: {
        port: 8080, // default: 3000
        host: '0.0.0.0' // default: localhost
      },
      

      the issue was fixed. So it seems that defining the host is also a smart thing to do.

      Another tip for Digital Ocean, make sure stuff like this gets logged in the console so a user does get some kind of clue when something goes wrong.

      Another thing, nothing to do with above but performance wise DO is outranked by it’s own $5 droplet that runs Nginx + node and Vercel (and that’s the free plan). See a Grafana screenshot over here. It’s tested with Sitespeed.io, 3 iterations per run, takes the average and the new app platform performs the worst.

      @jakelevirne If you need more info contact me.

Submit an Answer