Service must expose at least one port - since when?

I have a section in fly.toml that looks like this:

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

This used to work perfectly fine. Now I’m getting a message that says

Service must expose at least one port. Add a [[services.ports]] section to fly.toml; Check docs at Fly Launch configuration (fly.toml) · Fly Docs

when I’m trying to deploy it. When did it change, and how do I get rid of it?

I also ran into this and it’s breaking deployments for an application that only uses an internal_port for internal traffic.

Yeah, that’s also my use case - the application connects to my matrix.org service, instead of exposing any ports. In fact I’d rather not open any ports.

If you’re only doing internal traffic via app-name.internal, you can remove the [[services]] and [http_service] section.

If you’re doing internal traffic via app-name.flycast (read more about Flycast here), you need to specify a port, but you can release your public IP to make your app private (fly ips release).

1 Like

I have http health checks with this service ([[services.http_checks]]), how can I keep those health checks without the services section?

It feels like you guys broke userspace and now pushing the problem on to users to fix.

You can use the top-level checks for when you don’t have services defined.

2 Likes

Ditto, this suddenly started breaking our builds…

Maybe fly.io should start versioning their configs or not do breaking changes like this.

I put a fake port in the config and it worked. I guess a better solution is to do what @ben-io is suggesting. Thanks for your help and for maintaining this great service.

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