Open vincanger opened 11 months ago
Quoting Vince:
noticed something weird with Fly.io deployment. It's failing to connect the DB to the Server when it autogenerates parts of the name. For example, I ran: wasp deploy fly launch open-saas and it created: open-saas-wispy-fire to be unique across all of fly.io (this is where the problem lies)
What happens is that on the fly.io dashboard it created: open-saas-server-wispy-fire-4715 But the command getting run in our script is: $ flyctl postgres attach open-saas-wispy-fire-4715-db -a open-saas-wispy-fire-4715-server So we get: Error: failed retrieving app open-saas-wispy-fire-4715-server
The issue being that server is in the middle of the name, not the end (edited)
Why this is not great:
This happened because open-saas name was already taken on fly it seems.
We should check if the app names are taken on Fly before using them. It's not really possible to check with the Fly CLI directly if an app name is taken. It is however possible to:
If we did something for an app called potatoes-server
we expect to see potatoes-server.fly.dev in the output. If we don't see it, we know something went wrong and we can abort.
We can send a request to https://api.fly.io/graphql (details on using it https://til.simonwillison.net/fly/undocumented-graphql-api) with the query:
{
appNameAvailable(name: "wasp-ai-server")
}
Describe the bug App name must be unique across all of fly.io or deployment with
wasp deploy launch
fails.To Reproduce
open-saas
open-saas-fire-whisper
Expected behavior Script should terminate and alert user to choose a new, more unique name if the created app name doesn't match the given app name