"Connection refused" for TCP service

For context, I’m trying to reproduce something like this: I have a single Fly Machine that runs OpenSSH on port 22. This port is exposed as a TCP service (not HTTP) on a public IPv6 address.

Sometimes connecting through that public address works but more often than not it fails with “Connection refused”. I don’t see a pattern that predicts when. Everything else seems to be working:

  • My *.fly.dev hostname resolves to the IPv6 address shown by the flyctl ip list command
  • flyctl logs shows the machine running
  • Connecting with flyctl ssh console works
  • Sometimes I even have a TCP connection active (and ssh command running, with the remote shell still responsive), but opening another connection fails.

Everything seems to be pointing at the TCP proxy sitting between my Machine and the public address being extremely unreliable.

My fly.toml file looks like this:

app = "example"
primary_region = "cdg"

[[services]]
  internal_port = 22
  protocol = "tcp"
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
  [[services.ports]]
    handlers = []
    port = 22

[mounts]
source = "home"
destination = "/home"

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