Fly Prod Deploy - ...not listening on the expected address and will not be reachable by fly-proxy.
I have seen the below error as I run
wasp deploy fly deploy
(both initially + subsequently). It seems like my app is working fine but wonder if this is an issue I need to address.
I have not manually changed any of the fly-client.toml
or fly-server.toml
, which shows internal_port
of 8043 and 8080 respectively since they are automatically generated, which I believe contributed to this issue.
Per Fly's troubleshooting doc, it looks like I would need to update the toml
docs, but before I do that I want to make it won't mess with anything as those files are currently automatically generated.
Error from deploy logs:
7 Replies
Hi @Ringo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
You're encountering a common issue with Fly.io deployments where the app isn't listening on the expected address. This warning indicates that your server application isn't binding to the correct port that Fly.io expects.
The Issue
The warning message indicates that Fly.io expects your application to listen on
0.0.0.0:8080
, but your application is likely listening on a different address or port. This is a configuration mismatch between what Fly.io expects (as defined in your fly-server.toml
) and what your application is actually doing.
Solution
Since you mentioned your app seems to be working fine despite the warning, it's possible that the issue isn't critical. However, it's best to address it to ensure reliable operation. Here's what you can do:
1. Check your environment variables: Make sure your server is configured to use the PORT
environment variable. Wasp should set this up for you when deploying to Fly.io.
2. Set the PORT environment variable: If not already set, you can add it with:
Deploying Manually documentation mentions that PORT is one of the environment variables your server will be looking for.
3. Verify internal_port in fly-server.toml: Ensure that the internal_port
in your fly-server.toml
is set to 8080, which matches what Fly.io expects.
Is it safe to modify the toml files?
Yes, you can safely edit the fly-server.toml
and fly-client.toml
files. According to the Wasp documentation:
You can edit theDeploying with the Wasp CLI Additional Troubleshooting If you continue to experience issues after making these changes, you might want to: 1. Check the server logs to see what port it's actually binding to 2. Verify that your application code isn't hardcoding a different port 3. Make sure there are no conflicting environment variables Remember that when deploying with Wasp, the generated code is available in thefly-server.toml
andfly-client.toml
files to further configure your Fly deployments. Wasp will use the TOML files when you rundeploy
.
.wasp/build
directory, which you can inspect to see exactly what's being deployed.
Let me know if you need more specific guidance on modifying your configuration files!
GitHub: wasp-lang/wasp
Fly.io: fly.io
Wasp: wasp-lang.dev
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Ringo, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?the
internal_port
of my fly-server.toml
is already 8080, it is the fly-client.toml
that is currently 8043 now. @kapa.aiWohooo @Ringo, you just became a Waspeteer level 2!
I have tried to change
internal_port
in fly-client.toml
to 8080 (since it was the one that was using 8043, and not 8080), and kept the one in fly-server.toml
as 8080. It broke the app with below error.
I could totally be understanding the issue wrongly though. Thanks in advance for any help!
Hey @Ringo what is your Wasp version? You can check it with
wasp version
Did you check the server logs e.g. are you seeing any errors unrelated to ports?hey @miho my wasp version is
0.16.2
. For what it's worth, the deployed app seems to be working fine, the issue i was seeing was in the logs while I run wasp deploy fly deploy
(in my original message), and I am not sure if they are just ignorable or not.I'd say - if it's working for you, it might be an error that transient and goes away after the initial deployment process. Let me know if something stops working for you and we'll see what's up 🙂