I created a new Ruby on Rails app (latest version of Rails 7). The port number in fly.toml
is correct and it’s listening to 0.0.0.0
. Here’s the input from my command line:
Release v2 created
Monitoring Deployment
1 desired, 1 placed, 0 healthy, 1 unhealthy [health checks: 1 total, 1 critical]
v2 failed - Failed due to unhealthy allocations - no stable job version to auto revert to
Failed Instances
==> Failure #1
Instance
ID = ebca6ffa
Process =
Version = 2
Region = ord
Desired = run
Status = running
Health Checks = 1 total, 1 critical
Restarts = 0
Created = 5m21s ago
Recent Events
TIMESTAMP TYPE MESSAGE
2022-03-15T02:03:22Z Received Task received by client
2022-03-15T02:03:48Z Task Setup Building Task Directory
2022-03-15T02:03:51Z Started Task started by client
Recent Logs
2022-03-15T02:03:51.000 [info] Configuring firecracker
2022-03-15T02:03:51.000 [info] Starting virtual machine
2022-03-15T02:03:51.000 [info] Starting init (commit: 0c50bff)...
2022-03-15T02:03:51.000 [info] Preparing to run: `/bin/sh -c bundle exec bin/rails s -b 0.0.0.0` as root
2022-03-15T02:03:51.000 [info] 2022/03/15 02:03:51 listening on [fdaa:0:534d:a7b:81:ebca:6ffa:2]:22 (DNS: [fdaa::3]:53)
2022-03-15T02:03:52.000 [info] Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
2022-03-15T02:04:00.000 [info] => Booting Puma
2022-03-15T02:04:00.000 [info] => Rails 7.0.2.3 application starting in development
2022-03-15T02:04:00.000 [info] => Run `bin/rails server --help` for more startup options
***v2 failed - Failed due to unhealthy allocations - no stable job version to auto revert to and deploying as v3
Troubleshooting guide at https://fly.io/docs/getting-started/troubleshooting/
Error abort
Here’s the output from the server:
2022-03-15T02:03:37Z runner[cd626286] ord [info]Shutting down virtual machine
2022-03-15T02:03:37Z app[cd626286] ord [info]Sending signal SIGINT to main child process w/ PID 514
error.message="problem connecting to app instance" 2022-03-15T02:03:37Z proxy[cd626286] fra [error]error.code=2000 request.method="GET" request.url="/" request.id="01FY5MZ5X582NCXWHHD4W5TKYY-fra" response.status=502
2022-03-15T02:03:49Z runner[ebca6ffa] ord [info]Starting instance
2022-03-15T02:03:49Z runner[ebca6ffa] ord [info]Configuring virtual machine
2022-03-15T02:03:49Z runner[ebca6ffa] ord [info]Pulling container image
2022-03-15T02:03:49Z runner[ebca6ffa] ord [info]Unpacking image
2022-03-15T02:03:49Z runner[ebca6ffa] ord [info]Preparing kernel init
2022-03-15T02:03:51Z runner[ebca6ffa] ord [info]Configuring firecracker
2022-03-15T02:03:51Z runner[ebca6ffa] ord [info]Starting virtual machine
2022-03-15T02:03:51Z app[ebca6ffa] ord [info]Starting init (commit: 0c50bff)...
2022-03-15T02:03:51Z app[ebca6ffa] ord [info]Preparing to run: `/bin/sh -c bundle exec bin/rails s -b 0.0.0.0` as root
2022-03-15T02:03:51Z app[ebca6ffa] ord [info]2022/03/15 02:03:51 listening on [fdaa:0:534d:a7b:81:ebca:6ffa:2]:22 (DNS: [fdaa::3]:53)
2022-03-15T02:03:52Z app[ebca6ffa] ord [info]Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
2022-03-15T02:04:00Z app[ebca6ffa] ord [info]=> Booting Puma
2022-03-15T02:04:00Z app[ebca6ffa] ord [info]=> Rails 7.0.2.3 application starting in development
2022-03-15T02:04:00Z app[ebca6ffa] ord [info]=> Run `bin/rails server --help` for more startup options
I don’t see any error messages in the server logs.
Interestingly, even though the instance went critical, it’s still running according to fly status --all
:
Deployment Status
ID = 66c74e0d-1746-b3a9-f5bb-35c000bab407
Version = v2
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
ebca6ffa app 2 ⇡ ord run running 1 total, 1 critical 1 16m7s ago
cd626286 app 1 ord stop complete 1 total, 1 critical 2 31m52s ago
a27290fa app 0 ord run failed 1 total, 1 critical 14 2022-03-14T01:21:36Z
And the VM status shows a 137 exit code, which Googling makes seem like out of memory:
Instance
ID = ebca6ffa
Process =
Version = 2
Region = ord
Desired = run
Status = running
Health Checks = 1 total, 1 critical
Restarts = 1
Created = 16m48s ago
Recent Events
TIMESTAMP TYPE MESSAGE
2022-03-15T02:03:22Z Received Task received by client
2022-03-15T02:03:48Z Task Setup Building Task Directory
2022-03-15T02:03:51Z Started Task started by client
2022-03-15T02:08:48Z Alloc Unhealthy Task not running for min_healthy_time of 10s by deadline
2022-03-15T02:18:59Z Terminated Exit Code: 137
2022-03-15T02:18:59Z Restarting Task restarting in 1.038181586s
2022-03-15T02:19:07Z Started Task started by client
Checks
ID SERVICE STATE OUTPUT
2c049ace173aa212ee0332a9b0a966d5 tcp-3000 critical dial tcp 172.19.5.18:3000: connect: connection refused
Recent Logs
But I’m not sure how to debug this, I don’t think a Rails app should have trouble starting up with 256MB since it’s not even getting to any of my controller code yet. Any suggestions?