Health checks always failing

Hello, I’ve created a new Ruby Sinatra app this morning and every time I scale or deploy my app the health checks are always failing for both http and tcp.

Updating machine 48ed544c196d58
  Waiting for 48ed544c196d58 to become healthy (started, 0/2)
Error: failed to wait for health checks to pass: context deadline exceeded

This is my toml file

app = 'system31'
primary_region = 'ams'
kill_signal = 'SIGINT'
kill_timeout = '5s'

[experimental]
  auto_rollback = true

[build]

[env]
  PORT = '8080'

[[mounts]]
  source = 'backend_data_machines'
  destination = '/data'
  processes = ['app']

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

[[services]]
  protocol = 'tcp'
  internal_port = 8080
  processes = ['app']

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

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

  [services.concurrency]
    type = 'connections'
    hard_limit = 25
    soft_limit = 20

  [[services.tcp_checks]]
    interval = '15s'
    timeout = '2s'
    grace_period = '1s'

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

This is a warning I get in the logs but I’m not sure if it is related:

 2024-05-03T16:05:54.704 app[48ed544c196d58] ams [info] INFO Main child exited normally with code: 0

2024-05-03T16:05:54.715 app[48ed544c196d58] ams [info] INFO Starting clean up.

2024-05-03T16:05:54.716 app[48ed544c196d58] ams [info] INFO Umounting /dev/vdc from /data

2024-05-03T16:05:54.717 app[48ed544c196d58] ams [info] WARN could not unmount /rootfs: EINVAL: Invalid argument

2024-05-03T16:05:54.718 app[48ed544c196d58] ams [info] [ 1322.810127] reboot: Restarting system

2024-05-03T16:05:57.481 app[48ed544c196d58] ams [info] [ 0.040342] Spectre V2 : WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!

2024-05-03T16:05:57.511 app[48ed544c196d58] ams [info] [ 0.045442] PCI: Fatal: No config space access function found

2024-05-03T16:05:57.749 app[48ed544c196d58] ams [info] INFO Starting init (commit: c1e2693b)... 

My app is running fine though, but I just wanted to understand what was causing this warning and if I need to care about the health checks, they used to pass in the past when I deployed to LHR.

This sounds exactly like an issue another customer is seeing and I think it’s the same fix:

1 Like

Yes, that seemed to have fixed the issue: Health Checks Failing with "failed to get VM" - #2 by czue

this is what my toml looks like right now:

app = 'system31'
primary_region = 'ams'

[build]

[mounts]
  source = 'backend_data_machines'
  destination = '/data'
  processes = ['app']

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

[[vm]]
  memory = '512mb'
  cpu_kind = 'shared'
  cpus = 1

[checks]
  [checks.tcp_check]
    grace_period = "30s"
    interval = "15s"
    port = 8080
    timeout = "10s"
    type = "tcp"

1 Like

Im glad it worked and I appreciate you sharing your fixed fly.toml for future reference!

thanks for your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.