Skip to content
Latchkey

Fly.io "fly deploy" Fails - Release & Health Check Errors in CI

fly deploy built and pushed your image but the release did not become healthy - a release_command failed, the new machines failed their health/smoke checks, or the image could not boot - so Fly rolled the deploy back.

What this error means

fly deploy builds, then fails while releasing: a release command non-zero, machines never passing checks, or a boot failure. A real app error reproduces every run; a flaky health check or transient build push may pass on retry.

flyctl output
==> Release command failed, deployment aborted
Error: smoke checks for ... failed: the app appears to be crashing
  Health check on port 8080 has failed. Your app is not responding

Common causes

Release command or health check failure

A release_command (e.g. migrations) exited non-zero, or the app does not pass its configured health checks on the expected port within the grace period, so Fly aborts and rolls back.

Image cannot boot or wrong port

The container crashes on start, or internal_port in fly.toml does not match what the app listens on, so checks never succeed.

How to fix it

Read the release logs and fix the failure

  1. Inspect the failing release: fly logs and the deploy output show the crash or failed check.
  2. Confirm internal_port in fly.toml matches the port the app binds.
  3. Fix the release_command (e.g. a failing migration) so it exits zero.

Align health checks with the app

Point the health check at a real path/port and give the app enough grace to start.

fly.toml
# fly.toml
[http_service]
  internal_port = 8080
  [[http_service.checks]]
    path = "/healthz"
    grace_period = "10s"

How to prevent it

  • Match internal_port to the port the app actually listens on.
  • Give a real health-check path and a sensible grace period.
  • Test the release command and image boot locally before deploying.

Frequently asked questions

What causes ""fly deploy" failed"?
A release_command (e.g. migrations) exited non-zero, or the app does not pass its configured health checks on the expected port within the grace period, so Fly aborts and rolls back.
How do I fix "fly deploy" failed?
Read the release logs and fix the failure

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card