fly deploy pointing to wrong server URL
I am trying to deploy a postgres + websockets Wasp app to Fly, following the deploy instructions here: https://wasp-lang.dev/docs/advanced/deployment/cli
App works correctly locally.
I ran:
wasp deploy fly launch my-wasp-app mia
This created 3 apps:
- my-wasp-app-client-morning-feather-500
- my-wasp-app-server-broken-mountain-1141
- my-wasp-app-broken-mountain-1141-db
When I visit the client app URL, I see the Wasp loading spinner, however requests are failing:
- ERR_NAME_NOT_RESOLVED
for request to https://my-wasp-app-morning-feather-500-server.fly.dev/auth/me
- socket requests are failing
Looking at the names, it looks like the client was given the incorrect server name? my-wasp-app-morning-feather-500-server
but it should be my-wasp-app-server-broken-mountain-1141
.
This might have been an issue during the deploy, where the CLI timed out waiting for the apps to be available. I re-ran the command since the TOML files were correctly created assuming it would pick off where it left off, but not sure what happened.
1: is there a way to fix this?
2: is this a known issue?Deploying with the Wasp CLI | Wasp
Wasp CLI can deploy your full-stack application with only a single command.
4 Replies
Hi @Prefix. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Thank you for your detailed question about deploying a Wasp app to Fly.io. This indeed seems to be a known issue with the Wasp CLI deployment process to Fly.io. Let me address your questions based on the information available:
1. Is there a way to fix this?
Unfortunately, I don't have specific information on how to directly fix this issue. However, there are a few things you can try:
a) You could try manually updating the
WASP_WEB_CLIENT_URL
environment variable on your server app to point to the correct client URL. You can do this using the flyctl
command:
b) Another option might be to delete all the created resources and try the deployment process again. However, this approach comes with its own risks and complications Github Issue #1498 (https://github.com/wasp-lang/wasp/issues/1498).
2. Is this a known issue?
Yes, this appears to be a known issue with the Wasp CLI deployment to Fly.io. There are several reports of similar problems:
- The issue of unique names across Fly.io causing deployment failures is documented in Github Issue #1588 (https://github.com/wasp-lang/wasp/issues/1588).
- There are ongoing discussions about improving error handling and robustness of the Fly.io deployment process, as seen in Github Issue #1498 (https://github.com/wasp-lang/wasp/issues/1498).
The core of the problem seems to be that when Fly.io generates unique names for the apps, it can cause mismatches in the way Wasp CLI tries to connect them. This can lead to situations like yours where the client is trying to connect to an incorrectly named server.
Given the complexity of this issue, you might want to consider reaching out to the Wasp team directly through their Discord channel or by opening a new issue on their GitHub repository. They might be able to provide more specific guidance or workarounds for your particular case.
In the meantime, you could try running the deployment command again with a more unique app name to reduce the chances of Fly.io needing to generate random suffixes. As mentioned in the Wasp CLI deployment docs (https://wasp-lang.dev/docs/advanced/deployment/cli#deploying), your app name must be unique across all of Fly or deployment will fail.
Hmm, I do not have enough information to answer your question.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Prefix, 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?You have used
my-wasp-app
as your app name which is used by somebody else Fly.
Wasp's CLI doesn't handle this case well and the deployment breaks down due to Wasp CLI keeps going thinking my-wasp-app
is your apps name, but in reality, it's e.g. my-wasp-app-client-morning-feather-500
.
The solution is to use a unique app name e.g. prefix-saas-app
🙂Ah yes, what you got here is a mix of two dfiferent deplyments. Best is to delete all fo these and start from scratch with unique name, as Miho said.
I also added this to our GH issue: https://github.com/wasp-lang/wasp/issues/1588#issuecomment-2483112172
GitHub
CLI deploy fly.io unique name issue · Issue #1588 · wasp-lang/wasp
Describe the bug App name must be unique across all of fly.io or deployment with wasp deploy launch fails. To Reproduce when deploying an app, use a name that already exists on the fly.io service, ...