We are trying to deploy our new wasp
application on fly io
. However we are coming across an issue related to postgres database creation when running the following command.
wasp deploy fly launch test-app mia
The frontend
and backend
applications are launched successfully however when it comes to launching the database application it ends up with the following error.
I am providing the entire log below
$ flyctl version
flyctl v0.2.41 linux/amd64 Commit: 7932d6b6e8bf0e0e6518a0a5034f687bcf3f2be7 BuildDate: 2024-04-23T20:02:55Z
$ flyctl auth whoami
abc@gmail.com
🚀 Launching your Wasp app to Fly.io!
🚀 Setting up your Wasp app with Fly.io!
🚀 Building your Wasp app...
$ cd /home/moeed/test/open-saas/app/
$ /home/moeed/.local/share/wasp-lang/0.13.2/wasp-bin build
🐝 --- Clearing the content of the .wasp/build directory... -----------------------
✅ --- Successfully cleared the contents of the .wasp/build directory. ------------
🐝 --- Clearing the content of the .wasp/out/sdk directory... ---------------------
✅ --- Successfully cleared the contents of the .wasp/out/sdk directory. ----------
🐝 --- Building wasp project... ---------------------------------------------------
[ Wasp ] Starting npm install
[ Wasp ]
[ Wasp ] up to date in 3s
[ Wasp ]
[ Wasp ] 140 packages are looking for funding
[ Wasp ] run `npm fund` for details
[ Client ] Starting npm install
[ Server ] Starting npm install
[ Server ] Still installing npm dependencies!
[ Client ] Still installing npm dependencies!
[ Client ] Installation going great - we'll get there soon!
[ Server ] Installation going great - we'll get there soon!
[ Client ]
[ Client ] added 114 packages in 20s
[ Client ]
[ Client ] 14 packages are looking for funding
[ Client ] run `npm fund` for details
[ Server ] The installation is taking a while, but we'll get there!
[ Server ]
[ Server ] added 371 packages in 32s
[ Server ]
[ Server ] 120 packages are looking for funding
[ Server ] run `npm fund` for details
[ Db !] Error: P1012
[ Db !]
[ Db !] error: Environment variable not found: DATABASE_URL.
[ Db !] --> schema.prisma:4
[ Db !] |
[ Db !] 3 | provider = "postgresql"
[ Db !] 4 | url = env("DATABASE_URL")
[ Db !] |
[ Db !]
[ Db !]
✅ --- Successfully completed npm install. ----------------------------------------
🐝 --- Setting up database... -----------------------------------------------------
[ Db ] Prisma schema loaded from ../db/schema.prisma
[ Db ]
[ Db ] ✔ Generated Prisma Client (4.16.2 | library) to ./../../../node_modules/@prisma/client in 218ms
[ Db ] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
[ Db ] ```
[ Db ] import { PrismaClient } from '@prisma/client'
[ Db ] const prisma = new PrismaClient()
[ Db ] ```
✅ --- Database successfully set up. ----------------------------------------------
🐝 --- Building SDK... ------------------------------------------------------------
✅ --- SDK built successfully. ----------------------------------------------------
✅ --- Your wasp project has successfully compiled. -------------------------------
✅ --- Your wasp project has been successfully built! Check it out in the .wasp/build directory. ---
🚀 Setting up server app with name test-app-server
$ cd /home/moeed/test/open-saas/app/.wasp/build
$ flyctl launch --no-deploy --name test-app-server --region mia
Scanning source code
Detected a Dockerfile app
Creating app in /home/moeed/test/open-saas/app/.wasp/build
We're about to launch your app on Fly.io. Here's what you're getting:
Organization: Organization (fly launch defaults to the personal org)
Name: test-app-server (specified on the command line)
Region: Miami, Florida (US) (specified on the command line)
App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM)
Postgres: <none> (not requested)
Redis: <none> (not requested)
Sentry: false (not requested)
Created app 'test-app-server' in organization 'personal'
Admin URL: https://fly.io/apps/test-app-server
Hostname: test-app-server.fly.dev
Wrote config file fly.toml
Your app is ready! Deploy with `flyctl deploy`
Validating /home/moeed/test/open-saas/app/.wasp/build/fly.toml
✓ Configuration is valid
$ flyctl secrets set JWT_SECRET=91d80eae60510b5975fc2005c57c7748d40a85a9fcebc85a8a847d04dc4c65ca PORT=8080 WASP_WEB_CLIENT_URL=https://test-app-client.fly.dev WASP_SERVER_URL=https://test-app-server.fly.dev
Secrets are staged for the first deployment
🚀 Server setup complete!
🚀 Setting up client app with name test-app-client
$ cd /home/moeed/test/open-saas/app/.wasp/build/web-app
$ flyctl launch --no-deploy --name test-app-client --region mia
Scanning source code
Detected a NodeJS app
Creating app in /home/moeed/test/open-saas/app/.wasp/build/web-app
We're about to launch your NodeJS app on Fly.io. Here's what you're getting:
Organization: Organization (fly launch defaults to the personal org)
Name: test-app-client (specified on the command line)
Region: Miami, Florida (US) (specified on the command line)
App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM)
Postgres: <none> (not requested)
Redis: <none> (not requested)
Sentry: false (not requested)
Created app 'test-app-client' in organization 'personal'
Admin URL: https://fly.io/apps/test-app-client
Hostname: test-app-client.fly.dev
installing: npm install @flydotio/dockerfile@latest --save-dev
added 35 packages in 7s
19 packages are looking for funding
run `npm fund` for details
create Dockerfile
Wrote config file fly.toml
If you need custom packages installed, or have problems with your deployment
build, you may need to edit the Dockerfile for app-specific changes. If you
need help, please post on https://community.fly.io.
Now: run 'fly deploy' to deploy your Node.js app.
Validating /home/moeed/test/open-saas/app/.wasp/build/web-app/fly.toml
✓ Configuration is valid
🚀 Client setup complete!
🚀 Don't forget to create your database by running "wasp deploy fly create-db <region>".
🚀 Creating your DB on Fly.io!
$ flyctl postgres create --name test-app-db --region mia --vm-size shared-cpu-1x --initial-cluster-size 1 --volume-size 1
automatically selected personal organization: Organization
Creating postgres cluster in organization personal
Creating app...
Setting secrets on app test-app-db...
Error: Post "https://api.fly.io/graphql": remote error: tls: bad record MAC
🚀 There was an error running "wasp deploy fly create-db <region>". Please review the error and try again (if appropriate)