Deployment error

I am running into the following error while trying to deploy an app:


App
  Name     = rest-apis
  Owner    = personal
  Version  = 3
  Status   = running
  Hostname = rest-apis.fly.dev
  Platform = nomad

Deployment Status
  ID          = 80597ca9-a9f7-37fb-bfd1-278d550caf3a
  Version     = v3
  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
b03b4e57        app     1       fra     run     running 1 total, 1 critical     0               47m44s ago

This is the fly.toml file:

# fly.toml file generated for rest-apis on 2022-08-09T12:17:34+02:00

app = "rest-apis"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []
  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

And this is the Dockerfile:

FROM python:3.10
EXPOSE 8080
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
CMD ["flask", "run", "--host", "0.0.0.0"]

Based on where the deployment is failing, you might want to review what, if any, errors your app is emitting with fly logs. You can also get more detail on what steps are happening when an deployment fails by running fly deploy LOG_LEVEL=debug.

One thing in particular you might want to look out for is the default Flask port-- this is ‘5000’ in development mode.

No error from the app, some interesting lines from logs:

2022-08-09T11:57:34Z app[51058d6c] fra [info]Starting init (commit: c86b3dc)...
2022-08-09T11:57:34Z app[51058d6c] fra [info]Preparing to run: `flask run --host 0.0.0.0:8080` as root
2022-08-09T11:57:35Z app[51058d6c] fra [info]2022/08/09 11:57:35 listening on [fdaa:0:8072:a7b:cbb7:5105:8d6c:2]:22 (DNS: [fdaa::3]:53)

I am confused by the line which says where it’s listened to, is the problem maybe there?

What happens when you run fly vm status? This might be able to give you more detailed information about why an individual app instance is failing