W
Wasp4mo ago
Dimitris

Fly.io: is your app listening on 0.0.0.0:3001? make sure it is not only listen on 127.0.0.1

[PC01] instance refused connection. is your app listening on 0.0.0.0:3001? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on) 2025-05-19T20:39:41.858 app[d890159f67e398] mia [info] 2025/05/19 20:39:41 INFO SSH listening listen_address=[fdaa:10:3e43:a7b:2c6:f832:f8a8:2]:22 2025-05-19T20:39:44.772 app[d891257a613138] mia [info] > server@0.0.0 start-production 2025-05-19T20:39:44.772 app[d891257a613138] mia [info] > npm run db-migrate-prod && NODE_ENV=production npm run start [PR04] could not find a good candidate within 20 attempts at load balancing [PR04] could not find a good candidate within 20 attempts at load balancing 2025-05-19T20:39:50.131 proxy[d891257a613138] mia [error] [PC01] instance refused connection. is your app listening on 0.0.0.0:3001? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
3 Replies
kapa.ai
kapa.ai4mo ago
Hi @Dimitris. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the error message you're seeing with your Fly.io deployment, it appears your Wasp application server isn't properly binding to the correct network interface. This is a common issue when deploying Wasp apps to Fly.io. The key error is: instance refused connection. is your app listening on 0.0.0.0:3001? make sure it is not only listening on 127.0.0.1 This indicates that your server is likely only listening on the localhost interface (127.0.0.1) rather than all interfaces (0.0.0.0), which is required for external connections on Fly.io. When deploying a Wasp app to Fly.io, you need to ensure your server is configured to listen on all network interfaces. This is typically handled automatically by Wasp's deployment process, but sometimes additional configuration is needed. From the Discord support threads, it appears other users have encountered similar issues with Fly.io deployments. Some troubleshooting steps you can try: 1. Check if your server is properly configured in your Wasp app 2. Try redeploying your app with wasp deploy fly deploy 3. You might need to restart your server with:
wasp deploy fly cmd --context server scale count 0
wasp deploy fly cmd --context server scale count 1

wasp deploy fly cmd --context server scale count 0
wasp deploy fly cmd --context server scale count 1

If the issue persists, you might need to check your environment variables and ensure the server URL is properly configured. As mentioned in one of the support threads, you may need to set the WASP_WEB_CLIENT_URL environment variable in your .env.server file to match your client URL. If you're still having trouble, providing more information about your deployment process and any custom configurations you've made would help in diagnosing the issue further. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Dimitris, 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?
Dimitris
DimitrisOP4mo ago
resolved thanks! was due to missing an environment variable
Filip
Filip4mo ago
Glad you got it working! Anything we could have documented better here?

Did you find this page helpful?