Question

Deploy Error: Health Checks (Does Not show any issues in logs)

Here are my logs:

2024-06-18 06:59:58]  › configuring custom build command to be run at the end of the build:
[2024-06-18 06:59:58]    │ npm run build
[2024-06-18 06:59:58] 
[2024-06-18 06:59:58] ╭──────────── buildpack detection ───────────╼
[2024-06-18 06:59:58] │  › using Ubuntu 22.04 stack
[2024-06-18 06:59:58] │ Detected the following buildpacks suitable to build your app:
[2024-06-18 06:59:58] │ 
[2024-06-18 06:59:58] │    heroku/nodejs-engine   v1.5.4  
[2024-06-18 06:59:58] │    digitalocean/node      v0.4.0  (Node.js)
[2024-06-18 06:59:58] │    digitalocean/procfile  v0.0.4  (Procfile)
[2024-06-18 06:59:58] │    digitalocean/custom    v0.1.2  (Custom Build Command)
[2024-06-18 06:59:58] │ 
[2024-06-18 06:59:58] │ For documentation on the buildpacks used to build your app, please see:
[2024-06-18 06:59:58] │ 
[2024-06-18 06:59:58] │    Node.js  v0.4.0  https://do.co/apps-buildpack-node
[2024-06-18 06:59:58] ╰─────────────────────────────────────────────╼
[2024-06-18 06:59:58] 
[2024-06-18 06:59:58] ╭──────────── app build ───────────╼
[2024-06-18 06:59:58] │ [INFO] Node.js Buildpack
[2024-06-18 06:59:58] │ [INFO] Setting NODE_ENV to production
[2024-06-18 06:59:58] │ [INFO] Installing toolbox
[2024-06-18 06:59:58] │ [INFO] - yj
[2024-06-18 06:59:59] │ 
[2024-06-18 06:59:59] │ [Installing Node]
[2024-06-18 06:59:59] │ [INFO] Getting Node version
[2024-06-18 06:59:59] │ [INFO] Resolving Node version
[2024-06-18 07:00:05] │ [INFO] Downloading and extracting Node v20.14.0
[2024-06-18 07:00:11] │ 
[2024-06-18 07:00:11] │ [Parsing package.json]
[2024-06-18 07:00:11] │ [INFO] Parsing package.json
[2024-06-18 07:00:13] │ [INFO] No file to start server
[2024-06-18 07:00:13] │ [INFO] either use 'docker run' to start container or add index.js or server.js
[2024-06-18 07:00:13] │ Project contains package-lock.json, using npm
[2024-06-18 07:00:13] │ Using npm v10.7.0. To configure a different version of npm, set the engines.npm property in package.json.
[2024-06-18 07:00:13] │   See https://do.co/apps-buildpack-node for further instructions.
[2024-06-18 07:00:13] │ Installing node_modules using npm (from package-lock.json)
[2024-06-18 07:00:13] │ Running npm ci
[2024-06-18 07:00:13] │ 
[2024-06-18 07:00:27] │ 
[2024-06-18 07:00:27] │ > kankei@4.2.0 prepare
[2024-06-18 07:00:27] │ > husky install
[2024-06-18 07:00:27] │ 
[2024-06-18 07:00:27] │ husky - Git hooks installed
[2024-06-18 07:00:27] │ 
[2024-06-18 07:00:27] │ added 938 packages, and audited 939 packages in 13s
[2024-06-18 07:00:27] │ 
[2024-06-18 07:00:27] │ 290 packages are looking for funding
[2024-06-18 07:00:27] │   run `npm fund` for details
[2024-06-18 07:00:27] │ 
[2024-06-18 07:00:27] │ found 0 vulnerabilities
[2024-06-18 07:00:27] │ npm notice
[2024-06-18 07:00:27] │ npm notice New minor version of npm available! 10.7.0 -> 10.8.1
[2024-06-18 07:00:27] │ npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
[2024-06-18 07:00:27] │ npm notice To update run: npm install -g npm@10.8.1
[2024-06-18 07:00:27] │ npm notice
[2024-06-18 07:00:27] │ 
[2024-06-18 07:00:30] │ Running custom build command: npm run build
[2024-06-18 07:00:30] │ 
[2024-06-18 07:00:30] │ > kankei@4.2.0 build
[2024-06-18 07:00:30] │ > astro build
[2024-06-18 07:00:30] │ 
[2024-06-18 07:00:31] │ ▶ Astro collects anonymous usage data.
[2024-06-18 07:00:31] │   This information helps us improve Astro.
[2024-06-18 07:00:31] │   Run "astro telemetry disable" to opt-out.
[2024-06-18 07:00:31] │   https://astro.build/telemetry
[2024-06-18 07:00:31] │ 
[2024-06-18 07:00:32] │ 07:00:31 [types] Added src/env.d.ts type declarations.
[2024-06-18 07:00:32] │ 07:00:32 [types] Added src/env.d.ts type declarations.
[2024-06-18 07:00:32] │ 07:00:32 [build] output: "static"
[2024-06-18 07:00:32] │ 07:00:32 [build] directory: /workspace/dist/
[2024-06-18 07:00:32] │ 07:00:32 [build] Collecting build info...
[2024-06-18 07:00:32] │ 07:00:32 [build] ✓ Completed in 360ms.
[2024-06-18 07:00:32] │ 07:00:32 [build] Building static entrypoints...
[2024-06-18 07:00:32] │ 07:00:32 [types] Added src/env.d.ts type declarations.
[2024-06-18 07:00:34] │ 07:00:34 [vite] ✓ built in 2.03s
[2024-06-18 07:00:34] │ 07:00:34 [build] ✓ Completed in 2.10s.
[2024-06-18 07:00:34] │ 
[2024-06-18 07:00:34] │  building client (vite) 
[2024-06-18 07:00:34] │ 07:00:34 [types] Added src/env.d.ts type declarations.
[2024-06-18 07:00:34] │ 07:00:34 [vite] transforming...
[2024-06-18 07:00:35] │ 07:00:35 [vite] ✓ 50 modules transformed.
[2024-06-18 07:00:35] │ 07:00:35 [vite] rendering chunks...
[2024-06-18 07:00:35] │ 07:00:35 [vite] computing gzip size...
[2024-06-18 07:00:35] │ 07:00:35 [vite] dist/_astro/index.DhYZZe0J.js      6.72 kB │ gzip:  2.68 kB
[2024-06-18 07:00:35] │ 07:00:35 [vite] dist/_astro/hoisted.sO-65EBM.js   14.57 kB │ gzip:  4.98 kB
[2024-06-18 07:00:35] │ 07:00:35 [vite] dist/_astro/Search.DtvSuZip.js    29.00 kB │ gzip: 11.26 kB
[2024-06-18 07:00:35] │ 07:00:35 [vite] dist/_astro/client.J7s0XX1m.js   135.44 kB │ gzip: 43.74 kB
[2024-06-18 07:00:35] │ 07:00:35 [vite] ✓ built in 1.01s
[2024-06-18 07:00:35] │ 
[2024-06-18 07:00:35] │  generating static routes 
[2024-06-18 07:00:35] │ 07:00:35 ▶ src/pages/404.astro
[2024-06-18 07:00:35] │ 07:00:35   └─ /404.html (+8ms)
[2024-06-18 07:00:35] │ 07:00:35 ▶ src/pages/about.md
[2024-06-18 07:00:35] │ 07:00:35   └─ /about/index.html (+3ms)
[2024-06-18 07:00:39] │ 07:00:39 λ src/pages/og.png.ts
[2024-06-18 07:00:39] │ 07:00:39   └─ /og.png (+253ms)
[2024-06-18 07:00:39] │ 07:00:39 λ src/pages/posts/[slug]/index.png.ts
[2024-06-18 07:00:39] │ 07:00:39   └─ /posts/test.png (+85ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/posts/[slug]/index.astro
[2024-06-18 07:00:39] │ 07:00:39   ├─ /posts/test/index.html (+11ms)
[2024-06-18 07:00:39] │ 07:00:39   └─ /posts/1/index.html (+5ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/posts/index.astro
[2024-06-18 07:00:39] │ 07:00:39   └─ /posts/index.html (+3ms)
[2024-06-18 07:00:39] │ 07:00:39 λ src/pages/robots.txt.ts
[2024-06-18 07:00:39] │ 07:00:39   └─ /robots.txt (+1ms)
[2024-06-18 07:00:39] │ 07:00:39 λ src/pages/rss.xml.ts
[2024-06-18 07:00:39] │ 07:00:39   └─ /rss.xml (+3ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/search.astro
[2024-06-18 07:00:39] │ 07:00:39   └─ /search/index.html (+6ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/tags/[tag]/[page].astro
[2024-06-18 07:00:39] │ 07:00:39   └─ /tags/test/1/index.html (+13ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/tags/[tag]/index.astro
[2024-06-18 07:00:39] │ 07:00:39   └─ /tags/test/index.html (+3ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/tags/index.astro
[2024-06-18 07:00:39] │ 07:00:39   └─ /tags/index.html (+3ms)
[2024-06-18 07:00:39] │ 07:00:39 ▶ src/pages/index.astro
[2024-06-18 07:00:40] │ 07:00:39   └─ /index.html (+5ms)
[2024-06-18 07:00:40] │ 07:00:39 ✓ Completed in 4.56s.
[2024-06-18 07:00:40] │ 
[2024-06-18 07:00:40] │ 07:00:40 [@astrojs/sitemap] `sitemap-index.xml` created at `dist`
[2024-06-18 07:00:40] │ 07:00:40 [build] 10 page(s) built in 8.08s
[2024-06-18 07:00:40] │ 07:00:40 [build] Complete!
[2024-06-18 07:00:41] ╰───────────────────────────────────╼
[2024-06-18 07:00:41] 
[2024-06-18 07:00:41] ╭──────────── app upload ───────────╼
[2024-06-18 07:00:41] │  › uploading app container image to DOCR
[2024-06-18 07:00:45] │ Adding layer 'heroku/nodejs-engine:nodejs'
[2024-06-18 07:00:58] │ Adding 2/2 app layer(s)
[2024-06-18 07:00:58] │ Adding layer 'launcher'
[2024-06-18 07:00:58] │ Adding layer 'config'
[2024-06-18 07:00:58] │ Adding label 'io.buildpacks.lifecycle.metadata'
[2024-06-18 07:00:58] │ Adding label 'io.buildpacks.build.metadata'
[2024-06-18 07:00:58] │ Adding label 'io.buildpacks.project.metadata'
[2024-06-18 07:00:58] │ Saving <image-1>...
[2024-06-18 07:01:06] │ *** Images (sha256:01607eb978c0cd8424a489227a5f7124599f3e178589394704131637ad41bc3d):
[2024-06-18 07:01:06] │       <image-2>
[2024-06-18 07:01:06] │ Reusing cache layer 'heroku/nodejs-engine:nodejs'
[2024-06-18 07:01:06] │ Reusing cache layer 'heroku/nodejs-engine:toolbox'
[2024-06-18 07:01:10] │ Reusing cache layer 'digitalocean/node:node_modules'
[2024-06-18 07:01:10] │  ✔ uploaded app image to DOCR
[2024-06-18 07:01:10] ╰────────────────────────────────────╼
[2024-06-18 07:01:10] 
[2024-06-18 07:01:10]  ✔  build complete 
[2024-06-18 07:01:10] 
[]

And my deploy logs:

[2024-06-18 07:01:48] 
[2024-06-18 07:01:48] > kankei@4.2.0 dev
[2024-06-18 07:01:48] > astro dev
[2024-06-18 07:01:48] 
[2024-06-18 07:01:50] ▶ Astro collects anonymous usage data.
[2024-06-18 07:01:50]   This information helps us improve Astro.
[2024-06-18 07:01:50]   Run "astro telemetry disable" to opt-out.
[2024-06-18 07:01:50]   https://astro.build/telemetry
[2024-06-18 07:01:50] 
[2024-06-18 07:01:53] 07:01:53 [types] Added src/env.d.ts type declarations.
[2024-06-18 07:01:53] 07:01:53 [vite] Re-optimizing dependencies because vite config has changed
[2024-06-18 07:01:53] 
[2024-06-18 07:01:53]  astro  v4.10.2 ready in 1943 ms
[2024-06-18 07:01:53] 
[2024-06-18 07:01:53] ┃ Local    http://localhost:4321/
[2024-06-18 07:01:53] ┃ Network  use --host to expose
[2024-06-18 07:01:53] 
[2024-06-18 07:01:55] 07:01:55 watching for file changes...

I ensured that the http port is set to 4321 as well as ensuring that the health checks on 4321 instead of 8080. Yet, I still fail every health check, and there is absolutely no help being given by any of the logs that I can see.


Submit an answer


This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
June 19, 2024

Hey!

Indeed, the health check setup you’ve described sounds correct. But based on the output here:

[2024-06-18 07:01:53] ┃ Local    http://localhost:4321/
[2024-06-18 07:01:53] ┃ Network  use --host to expose

I think that you just need to use the --host flag in your run command in order to actually expose the service so it could be accessible via the outside world.

Let me know how it goes!

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel