Skip to main content
GitHub
flydotio

"The app is not listening on the expected address…"

2024-10-01 in Particles

Sometimes fly deploy will output a warning like this, even with a properly configured app:

WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
  - 0.0.0.0:8080
Found these processes inside the machine with open listening sockets:
  PROCESS                         | ADDRESSES                            
----------------------------------*--------------------------------------
  /.fly/hallpass                  | [fdaa:0:3b99:a7b:ef:8e61:63d7:2]:22  
  /app/erts-15.1/bin/epmd -daemon | 0.0.0.0:4369, [::]:4369   

At some point after the app’s Machines have booted up, if your app config file (fly.toml) contains an http_service or TCP services section, the Fly.io platform checks to see if there’s a service listening where fly-proxy can reach it, and on the port that your config said it would use—and complains if there isn’t a process listening there.

If the app processes are a little slow to start, this warning may fire even though a second later it’s all up and running and fly-proxy can route requests to all the services you want it to.

A tangent

Each Fly Machine (VM) has a private IPv4 address at which fly-proxy can reach it. That’s why flyctl is telling me to make sure my service listens on 0.0.0.0:8080 (the loopback address, 127.0.0.1, is useful for local dev, but won’t work when I deploy the app because, well, fly-proxy is not running inside my VM).

For a service to be reachable from within your IPv6 private network—which does not involve fly-proxy—it should listen on either fly-local-6pn or just the IPv6 wildcard address.

In any case: inside a Fly Machine, you don’t use IP addresses to control access to a service; it’s more a matter of making sure that your process is definitely listening on at least enough addresses, and telling fly-proxy which ports you want it to deliver traffic to (either public Anycast traffic or Flycast traffic).

In the wild

https://community.fly.io/t/fly-deploy-on-fresh-laravel-app-the-app-is-not-listening-on-the-expected-address/21970

Possibly https://community.fly.io/t/getting-warning-messages-when-deploying-with-elixir-1-17-erlang-27/21004