WARNING: The app is listening on the incorrect address

I have the following in the prod section of my config but still get “incorrect address” error when I deploy app and in the fly.io Monitor view. Any idea how to troubleshoot this? fly.toml also shows 0.0.0.0 and 8080 as host and port.
config :myapp, MyappWeb.Endpoint, server: true
config :myapp, MyappWeb.Endpoint,
url: [host: “myapp.fly.dev”, port: 443, scheme: “https”]
http: [ip: {0, 0 , 0 , 0 , 0 , 0 ,0, 0}, port: “8080”]

WARNING The app is listening on the incorrect 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:…:a7b:113:98ac:2401:2]:22
    /app/erts-13.0.4/bin/epmd -daemon | 0.0.0.0:4369, [::]:4369

[2/2] Machine 9185340f119683 [app] update finished: success
Finished deploying

1 Like

what port is the app itself serving your app on? could it be that port 4369 that i see in your log

The http config (http: [ip: {0, 0 , 0 , 0 , 0 , 0 ,0, 0}, port: “8080”]) is the only thing I have configured for ip/port. Where else would you look? I even searched for 4369 throughout the code base and didn’t find it.

hmm ok maybe it isnt what i thought it was then. what platform/stack is your app using? (i.e. what language/framework etc). it may be worth looking up the default port for that particular tech setup and making sure the port in your fly.toml is set to that same thing

Elixir 1.14.1 /Phoenix framework 1.7.2.

BTW, In the Monitor section of fly.io site, the log says this “[info] 2023/05/18 00:58:58 listening on [fdaa:0:b0da:a7b:7d16:3703:6696:2]:22 (DNS: [fdaa::3]:53)” I don’t know where that comes from or what it points to.

Hi,

The error you’re seeing means that the fly.io proxy that routes incoming connections to your application will not be able to do so because it expects your application to be listening on port 8080 but it’s actually not.

I’m not very familiar with Phoenix but unless you changed it, the documentation states that it listens on port 4000 by default. So maybe trying to change port 8080 in your fly.toml to 4000 to tell fly-proxy that’s where it should route incoming requests would do the trick.

The process listening on port 4369 is epmd - sounds like something internal to Erlang and almost certainly not your application listening for http connections.

Also, the process listening on port 22 is very likely an SSH daemon (22 is the standard port for SSH) - also unlikely to be your application.

Can you share your fly.toml file?

BTW, In the Monitor section of fly.io site, the log says this “[info] 2023/05/18 00:58:58 listening on [fdaa:0:b0da:a7b:7d16:3703:6696:2]:22 (DNS: [fdaa::3]:53)” I don’t know where that comes from or what it points to.

We(flyio) run an internal DNS server for you, so you can easily access your other apps using cool domain names like <app>.internal and <app>.flycast. Read more on this here and here.

/.fly/hallpass | [fdaa:0:…:a7b:113:98ac:2401:2]:22

We(flyio) run an ssh server in your VM, that’s what allows you to securely do fly ssh console (fly ssh console · Fly Docs)

1 Like

Tried changing port 8080 in fly.toml to 4000 as you suggested, but still getting the exact same result. :frowning: Thanks anyway.

Here you go.

app = “signupsheet”
primary_region = “lax”
kill_signal = “SIGTERM”

[deploy]
release_command = “/app/bin/migrate”

[env]
PHX_HOST = “signupsheet.fly.dev
PORT = “8080”

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
[http_service.concurrency]
type = “connections”
hard_limit = 1000
soft_limit = 1000

Some context behind that error message you’re seeing.

That message shows up when you tell fly you’re listening on a said address:port, but you actually aren’t, and so our internal proxy will never be able to reach your app.

To fix it, you need to ensure your app is actually listening on port 8080. Can you confirm your app is listening on 0.0.0.0:8080?

Yes, the app is set up to listen on 0.0.0.0:8080. When I run mix release and then _build/prod/rel/myapp/bin/myapp start I see the address logged.

Did you say this is the fly.io internal DNS server version of the address my app is actually listening on? Is there a way to find out what this is pointing to?
/.fly/hallpass | [fdaa:0:b0da:a7b:7d16:3703:6696:2]:22

Hi @jason2023

Looking at the logs, your app is being killed by OOM killer.
During rollout flyctl deploys the first machine, waits a bit and queries a list of processes from the machine. If it can’t find a process listening on the expected address:port (from fly.toml) it prints the warning for this first machine.

Since your app is being killed by OOM killer, it’s possible that when flyctl queries the list of processes, there is no BEAM running anymore and nothing is listening on the address.

Try bumping the amount of RAM for the machine - Scale Machine CPU and RAM · Fly Docs

1 Like

Thank you. I saw the OOM error but couldn’t connect the dots there.

Have you found out the solution? I am getting the same error

I was encountering the same problem and root cause was indeed an out-of-memory error.
I fixed it with

flyctl scale memory 1024

Have you found a solution to this?

I’m getting the same error, no way around it

hi @tfnielson-se

If you aren’t seeing OOM errors in your logs, then increasing the RAM won’t help with this error.

Here’s some specific troubleshooting info for the app is not listening on the expected address error that might help you figure out the issue: