Deployed Server and Client appear "Disconnected"
I am deploying via the Wasp CLI with fly.io, and after trying to debug some unrelated deployment issues I now have a problem where it appears the client cannot connect to the database at all. The initial auth request is hanging and nothing involving the database works at all. I can see via listing the secrets that all the environment variables are correct (or at least present) on the server.
Additionally, everything I try locally all works so I am unable to debug it locally. Looking at fly.io's dashboard, the server seems to be online and successfully receiving releases. I can also connect to it via the command line. Are there any steps I can take to figure out what's going on? I currently don't have a database backup so I'd like to avoid totally re-launching my app if possible.
12 Replies
Hi @CamBlackwood. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
I'm sorry to hear you're experiencing issues with your deployment. Here are some steps you can take to troubleshoot the issue:
1. Check the server logs: You can use the
flyctl logs
command to check the logs of your server. This might give you some insight into what's going wrong. If there are any error messages, they could point you in the right direction.
2. Check the network tab in your browser's developer tools: This can help you see if requests to the server are taking a long time or failing.
3. Check the database: Make sure your database is running correctly. You can use the flyctl postgres restart -a <your-db-name>
command to restart your database. Also, check the logs and metrics of your database on Fly.io to see if there are any issues.
4. Check your domain: If you're using a custom domain, make sure it's set up correctly. You can check your domain's CNAME record using a tool like DNS Checker (https://dnschecker.org/#CNAME/). If you haven't set up a CNAME record, you can follow the instructions in the Fly.io documentation (https://fly.io/docs/networking/custom-domain/).
5. Try redeploying your app: You can use the wasp deploy fly deploy
command to redeploy your app. This might solve the issue if it's related to a temporary problem with the deployment.
6. Upgrade your Wasp version: If none of the above steps work, you might want to consider upgrading your Wasp version. You can do this by running curl -sSL <https://get.wasp-lang.dev/installer.sh> | sh
, changing the Wasp version in your main.wasp
file, and then redeploying your app.
Remember, these are just suggestions and the actual solution might depend on the specific details of your issue. If you're still having trouble, you might want to consider asking for help in the Wasp community.
Sources:
- Discord support thread: Problems with server on fly.io (https://discord.com/channels/686873244791210014/1201898985300971540)
- Discord support thread: My login tab on the frontpage went missing after deployment on fly.io (https://discord.com/channels/686873244791210014/1217941277979574315)
- Discord support thread: server deployment issue (https://discord.com/channels/686873244791210014/1207206194872057917)
- Wasp Docs: Deploying Manually (https://wasp-lang.dev/docs/advanced/deployment/manually#deploy-to-a-flyio-app)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @CamBlackwood, 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?@kapa.ai Thanks - I am trying step 3. Do I need to redeploy afterwards?
Let me check the knowledge base for you. One moment! :books:
----------------------
Yes, after restarting your database, it would be a good idea to redeploy your application. This ensures that your application can establish a fresh connection with the database. You can redeploy your application using the
wasp deploy
command.
Remember to navigate to the root directory of your Wasp project before running the command. Here's how you can do it:
Please replace <path-to-your-wasp-project>
with the actual path to your Wasp project.
Source: Wasp Docs: Deploying Manually (https://wasp-lang.dev/docs/advanced/deployment/manually#deploy-to-a-flyio-app)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @CamBlackwood, 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?@kapa.ai Getting this error when deploying now
Error: P1011: Error opening a TLS connection: unexpected EOF
[PC01] instance refused connection. is your app listening on 0.0.0.0:8080? 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)
INFO Main child exited normally with code: 1
INFO Starting clean up.
WARN could not unmount /rootfs: EINVAL: Invalid argument
[ 3.697421] reboot: Restarting system
2024-09-16T08:16:45.666940429 [01J7WYEMZ28NQV2S24YJAP4MME:main] Running Firecracker v1.7.0
at deployServer (file:///Users/cameronblackwood/.local/share/wasp-lang/0.13.2/data/packages/deploy/dist/providers/fly/deploy/deploy.js:65:13)
exit code: 1
at ChildProcess.<anonymous> (file:///Users/cameronblackwood/.local/share/wasp-lang/0.13.2/data/packages/deploy/node_modules/zx/build/core.js:146:26)
Let me check the knowledge base for you. One moment! :books:
----------------------
The error message suggests that your application might not be listening on the correct IP address and port. It should be listening on
0.0.0.0:8080
, but the error message suggests it might be listening on 127.0.0.1
instead.
Here are a few steps you can take to troubleshoot this issue:
1. Check your server configuration: Make sure your server is configured to listen on 0.0.0.0:8080
. If you're using Express.js, for example, you can do this with app.listen(8080, '0.0.0.0')
.
2. Check your logs: The error message suggests looking at your startup logs, as servers often print the address they are listening on. You can check your logs with the flyctl logs
command.
3. Check your Fly.io configuration: Make sure your Fly.io configuration is correct. You can check this in your fly.toml
file or in the Fly.io dashboard.
4. Redeploy your app: If you've made any changes to your server configuration or Fly.io configuration, you'll need to redeploy your app for the changes to take effect. You can do this with the wasp deploy
command.
If none of these steps solve the issue, you might want to consider asking for help in the Wasp community.
Unfortunately, I don't have any specific code or links to provide as the knowledge sources don't contain any relevant information for this specific issue.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @CamBlackwood, 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?@kapa.ai this is in my fly-server.toml
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = 'stop'
auto_start_machines = true
min_machines_running = 1
processes = ['app']
Let me check the knowledge base for you. One moment! :books:
----------------------
Your
fly-server.toml
configuration seems correct with the internal_port
set to 8080
. However, the error message suggests that your application might not be listening on the correct IP address.
In your server code, ensure that your application is set to listen on 0.0.0.0:8080
. If you're using Express.js, for example, you can do this with app.listen(8080, '0.0.0.0')
.
If you've made any changes to your server configuration, you'll need to redeploy your app for the changes to take effect. You can do this with the wasp deploy
command.
If the issue persists, it might be helpful to seek assistance from the Wasp community or Fly.io support, as they might be able to provide more specific guidance based on your exact setup and issue.
Unfortunately, I don't have any specific code or links to provide as the knowledge sources don't contain any relevant information for this specific issue.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @CamBlackwood, 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?@kapa.ai The logs for my server say Error: P1011: Error opening a TLS connection: unexpected EOF
Let me check the knowledge base for you. One moment! :books:
----------------------
The
Error: P1011: Error opening a TLS connection: unexpected EOF
error typically indicates an issue with establishing a secure connection. This could be due to a variety of reasons such as network issues, incorrect configuration, or problems with the TLS/SSL certificate.
Here are a few steps you can take to troubleshoot this issue:
1. Check your network: Ensure that your server has a stable network connection and is able to reach the outside world.
2. Check your TLS/SSL certificate: If you're using a custom domain with HTTPS, make sure your TLS/SSL certificate is correctly configured and hasn't expired. You can check this in your domain provider's dashboard.
3. Check your server configuration: Make sure your server is correctly configured to handle TLS connections. This might involve checking your server code and your server's configuration files.
4. Redeploy your app: If you've made any changes to your server configuration or TLS/SSL certificate, you'll need to redeploy your app for the changes to take effect. You can do this with the wasp deploy
command.
If none of these steps solve the issue, you might want to consider asking for help in the Wasp community or from your hosting provider.
Unfortunately, I don't have any specific code or links to provide as the knowledge sources don't contain any relevant information for this specific issue.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @CamBlackwood, 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?Hey Cam, was Kapa of any help or should I jump in here? 😄
@sodic hey 🙂 yeah it was me omitting the ssl parameter from the db url that was the issue in the end, all sorted now!
Great to hear!