Unable to deploy node app due to unhealthy allocations.

first time trying to deploy and app and getting this:

==> Verifying app config
→ Verified app config
==> Building image
Remote builder fly-builder-fragrant-snowflake-9927 ready
==> Creating build context
→ Creating build context done
==> Building image with Docker
→ docker host: 20.10.12 linux x86_64
[+] Building 38.5s (0/1)
[+] Building 0.7s (15/15) FINISHED
=> CACHED [internal] load remote build context 0.0s
=> CACHED copy /context / 0.0s
=> [internal] load metadata for Docker 0.2s
=> [builder 1/8] FROM Docker 0.0s
=> CACHED [builder 2/8] RUN apt-get update; apt install -y curl python-is-python3 pkg-config build-essential 0.0s
=> CACHED [builder 3/8] RUN curl https://get.volta.sh | bash 0.0s
=> CACHED [builder 4/8] RUN volta install node@19.7.0 0.0s
=> CACHED [builder 5/8] RUN mkdir /app 0.0s
=> CACHED [builder 6/8] WORKDIR /app 0.0s
=> CACHED [builder 7/8] COPY . . 0.0s
=> CACHED [builder 8/8] RUN npm install && npm run build 0.0s
=> CACHED [stage-1 2/4] COPY --from=builder /root/.volta /root/.volta 0.0s
=> CACHED [stage-1 3/4] COPY --from=builder /app /app 0.0s
=> CACHED [stage-1 4/4] WORKDIR /app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:0256cf3757b6e953d23cc82ad8685a084ab30dba98158800b890fb0b9eddceb3 0.0s
=> => naming to registry.fly.io/virtual-garden:deployment-01GV4CXV5J8QKHNGQE8TG4XPW6 0.0s
→ Building image done
==> Pushing image to fly
The push refers to repository [registry.fly.io/virtual-garden]
5f70bf18a086: Layer already exists
0e5c55b3903d: Layer already exists
db2cec7e8179: Layer already exists
cf2e8433dbf2: Layer already exists
deployment-01GV4CXV5J8QKHNGQE8TG4XPW6: digest: sha256:243f8947d42508a6286c3392dfbab36632d12be8ba263b75bdb10f15e12c82d4 size: 1161
→ Pushing image done
image: registry.fly.io/virtual-garden:deployment-01GV4CXV5J8QKHNGQE8TG4XPW6
image size: 881 MB
==> Creating release
→ release v7 created

→ You can detach the terminal anytime without stopping the deployment
==> Monitoring deployment
Logs: Sign In · Fly

1 desired, 1 placed, 0 healthy, 1 unhealthy [restarts: 2] [health checks: 1 total, 1 critical]
Failed Instances

Failure #1

Instance
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
ae9885dd app 7 iad run running 1 total, 1 critical 2 2m2s ago

Recent Events
TIMESTAMP TYPE MESSAGE
2023-03-09T23:58:10Z Received Task received by client
2023-03-09T23:58:10Z Task Setup Building Task Directory
2023-03-09T23:58:31Z Started Task started by client
2023-03-09T23:59:05Z Terminated Exit Code: 1
2023-03-09T23:59:05Z Restarting Task restarting in 1.227125717s
2023-03-09T23:59:10Z Started Task started by client
2023-03-09T23:59:44Z Terminated Exit Code: 1
2023-03-09T23:59:44Z Restarting Task restarting in 1.007288252s
2023-03-09T23:59:49Z Started Task started by client

2023-03-10T00:00:20Z [info] roundTripTime: -1,
2023-03-10T00:00:20Z [info] lastUpdateTime: 31448,
2023-03-10T00:00:20Z [info] lastWriteDate: null,
2023-03-10T00:00:20Z [info] opTime: null,
2023-03-10T00:00:20Z [info] type: ‘Unknown’,
2023-03-10T00:00:20Z [info] topologyVersion: undefined,
2023-03-10T00:00:20Z [info] minWireVersion: 0,
2023-03-10T00:00:20Z [info] maxWireVersion: 0,
2023-03-10T00:00:20Z [info] hosts: ,
2023-03-10T00:00:20Z [info] passives: ,
2023-03-10T00:00:20Z [info] arbiters: ,
2023-03-10T00:00:20Z [info] tags:
2023-03-10T00:00:20Z [info] }
2023-03-10T00:00:20Z [info] },
2023-03-10T00:00:20Z [info] stale: false,
2023-03-10T00:00:20Z [info] compatible: true,
2023-03-10T00:00:20Z [info] compatibilityError: null,
2023-03-10T00:00:20Z [info] logicalSessionTimeoutMinutes: null,
2023-03-10T00:00:20Z [info] heartbeatFrequencyMS: 10000,
2023-03-10T00:00:20Z [info] localThresholdMS: 15,
2023-03-10T00:00:20Z [info] commonWireVersion: null
2023-03-10T00:00:20Z [info] }
2023-03-10T00:00:20Z [info]}
2023-03-10T00:00:20Z [info]Node.js v19.7.0
2023-03-10T00:00:20Z [info]npm notice
2023-03-10T00:00:20Z [info]npm notice New minor version of npm available! 9.5.0 → 9.6.1
2023-03-10T00:00:20Z [info]npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.1
2023-03-10T00:00:20Z [info]npm notice Run npm install -g npm@9.6.1 to update!
2023-03-10T00:00:20Z [info]npm notice
2023-03-10T00:00:21Z [info]Starting clean up.
→ v7 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v8

→ Troubleshooting guide at Troubleshooting your Deployment · Fly Docs
Error abort

➜ Virtual-Garden-Forum git:(main) ✗

Sorry you’re having trouble getting your app deployed!

1 desired, 1 placed, 0 healthy, 1 unhealthy [restarts: 2] [health checks: 1 total, 1 critical]

I believe this means your app is failing its health checks.

In order for connections to make their way to your app, your app has to listen on the port you define in fly.toml.

In this fairly typical example for HTTP apps, lifted from our configuration docs page, the app is listening on port 8080

[http_service]
  internal_port = 8080
  force_https = true
  [http_service.concurrency]
    type = "requests"
    soft_limit = 200
    hard_limit = 250

If your app is listening on the same port as defined in fly.toml, and set to listen on 0.0.0.0, then everything configuration-wise should be set.

The last bit of quick advice I can give is to run fly logs to see if anything stands out.
If that doesn’t help, feel free to post again.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.