"Process group has no port set" error

I’m trying to structure my fly.toml with a services section instead of a http_service section in preparation for having multiple processes. But despite much trial and error in fly.toml, I keep getting this error:

Error: error creating machine configuration: Check 'alive' for process group 'web' has no port set and the group has no http_service to take it from

This is confusing me because as far as I’m aware, I am setting ports for the web process.

Here’s my fly.toml:

app = "my-father"
primary_region = "lhr"

[processes]
  web = "bundle exec puma -C config/puma.rb"

[[services]]
  http_checks = []
  internal_port = 3000
  processes = ["web"]
  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

[checks]
  [checks.alive]
    type = "tcp"
    interval = "15s"
    timeout = "2s"
    grace_period = "5s"

[[statics]]
  guest_path = "/rails/public"
  url_prefix = "/"

[deploy]
  release_command = "bin/rails db:migrate"

If anyone can spot what I’m doing wrong I’d be really grateful :man_bowing:

Hi @Ollieh-m

Top level [checks] section needs a port specified explicitly:

Alternatively, you can use `[services.tcp_checks] which will derive the port from the service definition: Fly Launch configuration (fly.toml) · Fly Docs

1 Like

Thanks so much @pavel

I also found this separate answer right after I posted, even though I thought I’d already searched for related topics :man_facepalming:: Multiple Processes in TOML FIle - #2 by MatthewIngwersen

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