Help with deploy error: Failed due to unhealthy allocations

I don’t understand why this is happening since I didn’t change anything related to the ports/deploy/config files in my app. I’ve tried some of the solutions that worked for others such as making sure internal_port=8080 in fly.toml and exposing the port in the Dockerfile.

Any help would be greatly appreciated :slightly_smiling_face:

The output of fly status --all:

App
Name = goods
Owner = personal
Version = 0
Status = dead
Hostname = goods.fly.dev
Platform = nomad

Deployment Status
ID = effd669a-b2e3-4588-ac09-3d5f0277b6f6
Version = v0
Status = failed
Description = Failed due to unhealthy allocations - no stable job version to auto revert to
Instances = 1 desired, 1 placed, 0 healthy, 1 unhealthy

Instances
ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED
494ddf6e app 0 ord run failed 1 total, 1 critical 2 17m11s ago

One thing that may be wrong is that my Environment Variables are set to “NAME VALUE”. I’m not sure if these values were reset at some point, but I was able to deploy just fine before today.

The solution was to scale the app to increase memory. Thank you to whoever on the Fly team took the time to solve the problem.

1 Like

This solution worked for a day. I’m trying to deploy the app again after minimal changes since 2d ago and I’m receiving the same error. At this point, is the solution still to increase memory? The app I’m building is not particularly complex or heavy so I can’t imagine that would be the problem. Help please!

The output on my GitHub action:


Run superfly/flyctl-actions@1.3

[33](action_name_here#step:7:34)/usr/bin/docker run --name cfb356f39871f4592ba695f593d35cc58_545a05 --label 49859c --workdir /github/workspace --rm -e "FLY_API_TOKEN" -e "INPUT_ARGS" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/goods/goods":"/github/workspace" 49859c:fb356f39871f4592ba695f593d35cc58 deploy --image registry.fly.io/goods:main-87ea715d752f3a5e5069beda4dba9bfd2f8893be

[34](action_name_here#step:7:35)==> Verifying app config

[35](action_name_here#step:7:36)--> Verified app config

[36](action_name_here#step:7:37)==> Building image

[37](action_name_here#step:7:38)Searching for image 'registry.fly.io/goods:main-87ea715d752f3a5e5069beda4dba9bfd2f8893be' remotely...

[38](action_name_here#step:7:39)image found: img_wd57v5nx2y9v38o0

[39](action_name_here#step:7:40)==> Creating release

[40](action_name_here#step:7:41)--> release v8 created

[41](action_name_here#step:7:42)

[42](action_name_here#step:7:43)--> You can detach the terminal anytime without stopping the deployment

[43](action_name_here#step:7:44)==> Monitoring deployment

[44](action_name_here#step:7:45)Logs: https://fly.io/apps/goods/monitoring

[45](action_name_here#step:7:46)

[46](action_name_here#step:7:47)v8 is being deployed

[47](action_name_here#step:7:48)ffb6004e: ord running healthy

[48](action_name_here#step:7:49)ffb6004e: ord running unhealthy [health checks: 2 total, 1 critical]

[49](action_name_here#step:7:50)ffb6004e: ord running unhealthy [health checks: 2 total, 2 critical]

[50](action_name_here#step:7:51)ffb6004e: ord running unhealthy [health checks: 2 total]

[51](action_name_here#step:7:52)ffb6004e: ord running unhealthy [health checks: 2 total]

[52](action_name_here#step:7:53)ffb6004e: ord running unhealthy [health checks: 2 total, 1 critical]

[53](action_name_here#step:7:54)ffb6004e: ord running unhealthy [health checks: 2 total, 2 critical]

[54](action_name_here#step:7:55)ffb6004e: ord running unhealthy [health checks: 2 total, 2 critical]

[55](action_name_here#step:7:56)Failed Instances

[56](action_name_here#step:7:57)Instance

[57](action_name_here#step:7:58)

[58](action_name_here#step:7:59)ID PROCESS VERSION REGION DESIRED STATUS HEALTH CHECKS RESTARTS CREATED

[59](action_name_here#step:7:60)Failure #1

[60](action_name_here#step:7:61)ffb6004e app 8 ord run running 2 total, 2 critical 2 49s ago

[61](action_name_here#step:7:62)

[62](action_name_here#step:7:63)

[63](action_name_here#step:7:64)--> v8 failed - Failed due to unhealthy allocations - rolling back to job version 7 and deploying as v9

[64](action_name_here#step:7:65)Recent Events

[65](action_name_here#step:7:66)

[66](action_name_here#step:7:67)TIMESTAMP TYPE MESSAGE

[67](action_name_here#step:7:68)--> Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/

[68](action_name_here#step:7:69)2023-01-25T21:38:19Z Received Task received by client

[69](action_name_here#step:7:70)Error abort

[70](action_name_here#step:7:71)2023-01-25T21:38:19Z Task Setup Building Task Directory

[71](action_name_here#step:7:72)

[72](action_name_here#step:7:73)2023-01-25T21:38:22Z Started Task started by client

[73](action_name_here#step:7:74)

[74](action_name_here#step:7:75)2023-01-25T21:38:36Z Terminated Exit Code: 1

[75](action_name_here#step:7:76)2023-01-25T21:38:36Z Restarting Task restarting in 1.155172218s

[76](action_name_here#step:7:77)2023-01-25T21:38:42Z Started Task started by client

[77](action_name_here#step:7:78)2023-01-25T21:38:56Z Terminated Exit Code: 1

[51](action_name_here#step:7:52)2023-01-25T21:38:56Z Restarting Task restarting in 1.178373024s

[52](action_name_here#step:7:53)2023-01-25T21:39:02Z Started Task started by client

[53](action_name_here#step:7:54)

[54](action_name_here#step:7:55)2023-01-25T21:39:11Z [info]Datasource "db": SQLite database "sqlite.db" at "file:/data/sqlite.db"

[55](action_name_here#step:7:56)2023-01-25T21:39:11Z [info]12 migrations found in prisma/migrations

[56](action_name_here#step:7:57)2023-01-25T21:39:11Z [info]No pending migrations to apply.

[57](action_name_here#step:7:58)2023-01-25T21:39:11Z [info]npm notice

[58](action_name_here#step:7:59)2023-01-25T21:39:11Z [info]npm notice New major version of npm available! 8.19.3 -> 9.4.0

[59](action_name_here#step:7:60)2023-01-25T21:39:11Z [info]npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.4.0>

[60](action_name_here#step:7:61)2023-01-25T21:39:11Z [info]npm notice Run `npm install -g npm@9.4.0` to update!

[61](action_name_here#step:7:62)2023-01-25T21:39:11Z [info]npm notice

[62](action_name_here#step:7:63)2023-01-25T21:39:11Z [info]+ npm run start

[63](action_name_here#step:7:64)2023-01-25T21:39:11Z [info]> start

[64](action_name_here#step:7:65)2023-01-25T21:39:11Z [info]> remix-serve build

[65](action_name_here#step:7:66)2023-01-25T21:39:13Z [info]Error: Cannot find module 'react-is'

[66](action_name_here#step:7:67)2023-01-25T21:39:13Z [info]Require stack:

[67](action_name_here#step:7:68)2023-01-25T21:39:13Z [info]- /myapp/node_modules/styled-components/dist/styled-components.cjs.js

[68](action_name_here#step:7:69)2023-01-25T21:39:13Z [info]- /myapp/node_modules/react-loader-spinner/dist/loader/InfinitySpin.js

[69](action_name_here#step:7:70)2023-01-25T21:39:13Z [info]- /myapp/node_modules/react-loader-spinner/dist/index.js

[70](action_name_here#step:7:71)2023-01-25T21:39:13Z [info]- /myapp/build/index.js

[71](action_name_here#step:7:72)2023-01-25T21:39:13Z [info]- /myapp/node_modules/@remix-run/serve/dist/cli.js

[72](action_name_here#step:7:73)2023-01-25T21:39:13Z [info] at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)

[73](action_name_here#step:7:74)2023-01-25T21:39:13Z [info] at Function.Module._load (node:internal/modules/cjs/loader:841:27)

[74](action_name_here#step:7:75)2023-01-25T21:39:13Z [info] at Module.require (node:internal/modules/cjs/loader:1067:19)

[75](action_name_here#step:7:76)2023-01-25T21:39:13Z [info] at require (node:internal/modules/cjs/helpers:103:18)

[76](action_name_here#step:7:77)2023-01-25T21:39:13Z [info] at Object.<anonymous> (/myapp/node_modules/styled-components/dist/styled-components.cjs.js:1:145)

[77](action_name_here#step:7:78)2023-01-25T21:39:13Z [info] at Module._compile (node:internal/modules/cjs/loader:1165:14)

[78](action_name_here#step:7:79)2023-01-25T21:39:13Z [info] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)

[79](action_name_here#step:7:80)2023-01-25T21:39:13Z [info] at Module.load (node:internal/modules/cjs/loader:1043:32)

[80](action_name_here#step:7:81)2023-01-25T21:39:13Z [info] at Function.Module._load (node:internal/modules/cjs/loader:878:12)

[81](action_name_here#step:7:82)2023-01-25T21:39:13Z [info] at Module.require (node:internal/modules/cjs/loader:1067:19)

[82](action_name_here#step:7:83)2023-01-25T21:39:14Z [info]Starting clean up.

[83](action_name_here#step:7:84)2023-01-25T21:39:14Z [info]Umounting /dev/vdc from /data

The Error: Cannot find module 'react-is' error is happening somewhere in your application and causing it to exit.

Thank you, apologies for asking a question without properly scanning the logs. I had to install react-is and the deploy went through just fine. Much appreciated.