Configuring HTTP service + TCP Service, but not working

I have a working http app. It uses the http_service and TLS. I want to add another tcp service to the app.

This is what I came up with for the config:

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

[http_service.concurrency]
type = 'requests'
hard_limit = 1000
soft_limit = 750

[[http_service.checks]]
grace_period = "10s"
interval = "5s"
method = "GET"
timeout = "1s"
path = "/_healthcheck"

[[services]]
processes = ['app']
internal_port = 25
protocol = "tcp"
[[services.ports]]
port = 25

However, if I look at the network config for my app on the dashboard it does not show the port 25 service. We can see the dedicated v4 and v6 addresses, but the only service is the HTTP service:

This deploys without error and when I run fly config show it correctly displays both services:

"http_service": {
    "internal_port": 8080,
    "force_https": true,
    "auto_stop_machines": true,
    "auto_start_machines": true,
    "min_machines_running": 1,

    "processes": [
      "app"
    ],

    "concurrency": {
      "type": "requests",
      "hard_limit": 1000,
      "soft_limit": 750
    },

    "checks": [
      {
        "interval": "5s",
        "timeout": "1s",
        "grace_period": "10s",
        "method": "GET",
        "path": "/_healthcheck"
      }
    ]
  },

  "services": [
    {
      "protocol": "tcp",
      "internal_port": 25,

      "ports": [
        {
          "port": 25
        }
      ],

      "processes": [
        "app"
      ]
    }
  ],

Hm… It would probably help to post the output of fly services list and fly ips list. The dashboard may be giving an incomplete view of things here…

VERSION IP                      TYPE                                    REGION  CREATED AT        
v4      213.188.218.213         public ingress (dedicated, $2/mo)       global  2h9m ago         
v6      2a09:8280:1::b9:bf25:0  public ingress (dedicated)              global  Dec 13 2025 22:5
Services
PROTOCOL        PORTS           HANDLERS        FORCE HTTPS     PROCESS GROUP   REGIONS MACHINES 
TCP             25 => 25        []              False           app             iad     1       
TCP             80 => 8080      [HTTP]          True            app             iad     1       
TCP             443 => 8080     [HTTP,TLS]      False           app             iad     1 

But I am unable to get telnet to connect with:

telnet 213.188.218.213 25

If I ssh into the running machine, I can see it is listening on port 25:

root@e829670be55958:/app# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      682/epmd            
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      642/beam.smp        
tcp6       0      0 fdaa:9:6fe4:a7b:52f::22 :::*                    LISTEN      641/hallpass        
tcp6       0      0 :::8080                 :::*                    LISTEN      642/beam.smp        
tcp6       0      0 :::4369                 :::*                    LISTEN      682/epmd            
tcp6       0      0 :::46203                :::*                    LISTEN      642/beam.smp        
root@e829670be55958:/app# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.

:man_facepalming: Something in my network is blocking the connection.
Telnet does work from other networks.

There is a bug here though in that the fly.io dashboard is not showing configured services beyond the http service.

1 Like

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