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
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
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.
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.
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.
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
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.