flyctl icon indicating copy to clipboard operation
flyctl copied to clipboard

FlyCTL is eager to say "The app is not listening on the expected address" when the app takes longer to bind

Open lubien opened this issue 1 year ago • 3 comments

Describe the bug

Myself and a customer have been seeing flyctl report "The app is not listening on the expected address and will not be reachable by fly proxy..." very fast because our apps have slow boot times, mine being a NodeJS+puppeteer and theirs a rails app.

Deployment works as expected this might be a non-urgent display issue.

  • Operating system; Mac M1 2022
  • fly version: fly v0.2.15 darwin/arm64 Commit: 846630217aff135b32ec0d6a018cf6bdde0f1762-dirty BuildDate: 2024-03-10T09:52:28Z

** Paste your fly.toml

# fly.toml app configuration file generated for myapp on 2024-03-09T09:06:35+09:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'myapp'
primary_region = 'nrt'
console_command = '/rails/bin/rails console'
swap_size_mb = 512

[build]

[deploy]
  release_command = './bin/rails db:prepare'

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  processes = ['app']

[[vm]]
  memory = 256
  cpu_kind = 'shared'
  cpus = 1

** Command output: **

2024-03-11T02:41:27.581 app[784e667b274628] nrt [info] => Booting Puma

2024-03-11T02:41:27.581 app[784e667b274628] nrt [info] => Rails 7.0.4.3 application starting in production

2024-03-11T02:41:27.581 app[784e667b274628] nrt [info] => Run `bin/rails server --help` for more startup options

2024-03-11T02:41:30.007 app[784e667b274628] nrt [info] Puma starting in single mode...

2024-03-11T02:41:30.007 app[784e667b274628] nrt [info] * Puma version: 5.6.5 (ruby 3.2.2-p53) ("Birdie's Version")

2024-03-11T02:41:30.007 app[784e667b274628] nrt [info] * Min threads: 5

2024-03-11T02:41:30.007 app[784e667b274628] nrt [info] * Max threads: 5

2024-03-11T02:41:30.007 app[784e667b274628] nrt [info] * Environment: production

2024-03-11T02:41:30.008 app[784e667b274628] nrt [info] * PID: 305

2024-03-11T02:41:30.009 app[784e667b274628] nrt [info] * Listening on http://0.0.0.0:3000

2024-03-11T02:41:30.028 app[784e667b274628] nrt [info] Use Ctrl-C to stop

lubien avatar Mar 11 '24 12:03 lubien

having the same issue here, with a deployment of Umami. App functions fine, but the warning pops up:

The app is not listening on the expected address and will not be reachable by fly-proxy. <machine id> reached started state
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:3000

log sample after fly deploy:

2024-07-25T21:58:31Z app[148e46db107689] lax [info][   26.633794] reboot: Restarting system
2024-07-25T21:58:32Z app[148e46db107689] lax [info]2024-07-25T21:58:32.931225364 [01J3NYE74QHX6W9XGVM4CKR9P0:main] Running Firecracker v1.7.0
2024-07-25T21:58:33Z app[148e46db107689] lax [info][    0.267076] PCI: Fatal: No config space access function found
2024-07-25T21:58:33Z app[148e46db107689] lax [info] INFO Starting init (commit: 3dd5d9e)...
2024-07-25T21:58:33Z app[148e46db107689] lax [info] INFO Preparing to run: `docker-entrypoint.sh yarn start-docker` as nextjs
2024-07-25T21:58:33Z app[148e46db107689] lax [info] INFO [fly api proxy] listening at /.fly/api
2024-07-25T21:58:33Z app[148e46db107689] lax [info]2024/07/25 21:58:33 INFO SSH listening listen_address=[fdaa:0:b7c1:a7b:c0da:8e3a:8bb:2]:22 dns_server=[fdaa::3]:53
2024-07-25T21:58:33Z runner[148e46db107689] lax [info]Machine created and started in 3.269s
2024-07-25T21:58:34Z app[148e46db107689] lax [info]yarn run v1.22.19
2024-07-25T21:58:34Z app[148e46db107689] lax [info]$ npm-run-all check-db update-tracker start-server
2024-07-25T21:58:34Z app[148e46db107689] lax [info]$ node scripts/check-db.js
2024-07-25T21:58:34Z app[148e46db107689] lax [info]✓ DATABASE_URL is defined.
2024-07-25T21:58:35Z app[148e46db107689] lax [info]✓ Database connection successful.
2024-07-25T21:58:35Z app[148e46db107689] lax [info]✓ Database version check successful.
2024-07-25T21:58:36Z app[148e46db107689] lax [info]Prisma schema loaded from prisma/schema.prisma
2024-07-25T21:58:36Z app[148e46db107689] lax [info]Datasource "db": PostgreSQL database "umami_", schema "public" at "my-umami-db.flycast:5432"
2024-07-25T21:58:36Z app[148e46db107689] lax [info]6 migrations found in prisma/migrations
2024-07-25T21:58:36Z app[148e46db107689] lax [info]No pending migrations to apply.
2024-07-25T21:58:36Z app[148e46db107689] lax [info]✓ Database is up to date.
2024-07-25T21:58:36Z app[148e46db107689] lax [info]$ node scripts/update-tracker.js
2024-07-25T21:58:36Z app[148e46db107689] lax [info]$ node server.js
2024-07-25T21:58:37Z app[148e46db107689] lax [info]  ▲ Next.js 14.2.3
2024-07-25T21:58:37Z app[148e46db107689] lax [info]  - Local:        http://localhost:3000
2024-07-25T21:58:37Z app[148e46db107689] lax [info]  - Network:      http://0.0.0.0:3000
2024-07-25T21:58:37Z app[148e46db107689] lax [info] ✓ Starting...
2024-07-25T21:58:37Z app[148e46db107689] lax [info] ✓ Ready in 161ms

paulrudy avatar Jul 25 '24 22:07 paulrudy

I'm encountering the same problem

mikeguo99 avatar Aug 06 '24 00:08 mikeguo99