Question

App Platform Deploy Error: Health Checks, DeployContainerHealthChecksFailed

Posted October 18, 2020 2.2k views
Node.jsDeploymentDigitalOcean App Platform

After deploying my NestJS api service, it started properly as seen on this screenshot of the deployment logs. But everytime, the health checks fails, which inhibits me from deploying.

I tried, according to the documentation, with a TCP health check, initally on my set port which was 3333, followed by the default port which is 8080, but both without success. I then went on and implemented a service health check route, under /api/health, but once again it still fails. You can take a look at my open-source config/project here.

It doesn’t seem to be giving any other information.. Please let me know how I can fix it, or how I can turn off this check.

1 comment

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.

×
Submit an Answer
2 answers

@gabrielbottari 👋

Thanks for sharing the open source project and config. I forked the project and deployed it via the .do/app.yaml. I hit the same failing health checks error that you described. The problem is a subtle one that we need to get better at surfacing in the platform. Notice at the bottom of the deploy logs that we see this from nestjs:

Server listening at http://127.0.0.1:3333

It’s listening on http://127.0.0.1:3333 — so only connections targeting 127.0.0.1 will be consumed. The resolution for this is to update the code to listen on 0.0.0.0 instead (4e008e1). After making that update, it deploys successfully: https://stator-ewm6b.ondigitalocean.app/

  • Thank you! Very appreciated

  • Hm, I’m having the same issue…

    Is there something specific we’re supposed to define in our server code for health checks? (I’m a mobile developer, but server newb.)

    If not, my Nest app has this line: await app.listen(3000);
    I don’t see any place 127.0.0.1 is used, so I’m not sure if its a similar problem.

    Any ideas? Thanks in advance:)

In case you have an app on NUXT. Configure the Nuxt.js server to see your site on deployment.

in nuxt.config.js

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

in package.json

"config": {
    "nuxt": {
      "host": "0.0.0.0",
      "port": "8080"
    }

source from:
https://nuxtjs.org/faq/host-port/

edited by MattIPv4