W
Waspβ€’8mo ago
Kbk

Deploying on fly.io

Hello, I got stuck when trying to deploy using command wasp deploy fly deploy I made launch and setup, I have active db on fly.io. Frontend server app are "pending". While trying to make deploy i got error with prisma in console
15 Replies
kapa.ai
kapa.aiβ€’8mo ago
Hi @Kbk. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It seems like you're encountering an error related to Prisma while trying to deploy your Wasp app to Fly.io. This could be due to a variety of reasons, but one common issue is related to the DATABASE_URL environment variable. In one of the support threads (https://discord.com/channels/686873244791210014/1196865084304150639), a community member was able to fix a similar error by running the deploy/build command inline with their local DB environment variable found in .wasp/out/server/.env. The command looked like this:
DATABASE_URL="<your_database_url>" wasp deploy fly launch <app_name> den
DATABASE_URL="<your_database_url>" wasp deploy fly launch <app_name> den
However, this solution might seem a bit hacky. Another community member suggested that if the error doesn't prevent you from deploying, you can safely ignore it. But if it does prevent you from deploying, you might need to set the environment variables on Fly properly. You can find more information on how to set environment variables in Wasp here (https://wasp-lang.dev/docs/project/env-vars) and how to manually deploy to Fly.io here (https://wasp-lang.dev/docs/advanced/deployment/manually#flyio). If you're still encountering issues, it would be helpful to know the exact error message you're seeing. This will help in diagnosing the problem more accurately. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Kbk, 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?
miho
mihoβ€’8mo ago
Could you maybe try doing wasp clean and then try deploying? πŸ™‚
Kbk
KbkOPβ€’8mo ago
@kapa.ai Thank you for advice, I made wasp clean than tried to deploy agine using DATABASE_URL=postgres://app_server:[email protected]:5432/cryptotx_server?sslmode=disable wasp deploy fly deploy app den This database_url was printed in console when I deployed db first time. Do you think that is something wrong with DATABASE_URL? Do you know how to check this url? [ Db !] Error: P1001 [ Db !] [ Db !] Can't reach database server at app-db.flycast:5432 [ Db !] [ Db !] Please make sure your database server is running at app-db.flycast:5432. [ Db !] 'Error: failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref e89ea33e-dc1f-4e53-88b3-60b92f4ab750::sn1guuphpovc2oudy8lca8nuj: "/node_modules/.prisma/client/schema.prisma": not found\n' }
No description
kapa.ai
kapa.aiβ€’8mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- The error message you're seeing suggests that the application is unable to reach the database server at the provided DATABASE_URL. This could be due to a variety of reasons such as the database server not running, incorrect database credentials, or network issues. Here are a few things you can check: 1. Database Server: Ensure that your database server is running. You can check the status of your Fly.io apps by running flyctl apps list in your terminal. 2. Database Credentials: The DATABASE_URL you're using seems to be in the correct format. However, you should double-check that the username (app_server), password (hash), and database name (cryptotx_server) are correct. These would have been set when you first created the database. 3. Network Issues: The error message suggests that the application is unable to reach app-db.flycast on port 5432. This could be due to network issues. You might want to check if there are any firewalls or other network configurations that could be blocking the connection. 4. Prisma Client: The error message also mentions a problem with the Prisma client's schema.prisma file. You might want to check if this file exists in your project and is correctly configured. If you're still encountering issues, it might be helpful to share the exact steps you're taking and any additional error messages you're seeing. This will help in diagnosing the problem more accurately. For more information on how to deploy Wasp apps to Fly.io, you can refer to the official Wasp documentation (https://wasp-lang.dev/docs/advanced/deployment/manually#flyio). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Kbk, 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?
miho
mihoβ€’8mo ago
The bot is not giving good advice for this issue. Let's see what went wrong. Which Wasp version are you using? Are you using open sass? What kind of changes did you do? Is the app running locally okay?
Kbk
KbkOPβ€’8mo ago
1) localy app works 2) yes opensaas 3) wasp: { version: "^0.13.0" 4) i made changes in .env.server database_url to check if i will be able to connect somehow but when dont work i commented that and make wasp clean. First time when i was trying to deploy i leaved this place commented (as in default) to let wasp pass secrets I think maybe something with database_url is wrong
miho
mihoβ€’8mo ago
When deploying to Fly, Wasp will set the necessary DATABASE_URL env variable on the Fly server app. No need for you to set that variable manually or pass it while deploying with the CLI πŸ˜„ The error you see is caused by a missing schema.prisma file which I find very odd. Could you maybe share your repo with the code here or in the DMs?
Kbk
KbkOPβ€’8mo ago
https://github.com/Kbk17/CryptoTX/blob/development/CryptoTX/ Here is my repo. Thank you. Im quite sure that I mixed sth up by mistake πŸ˜„
GitHub
CryptoTX/CryptoTX at development Β· Kbk17/CryptoTX
Contribute to Kbk17/CryptoTX development by creating an account on GitHub.
miho
mihoβ€’8mo ago
@sodic one for you
Kbk
KbkOPβ€’8mo ago
I will try to make deployment from "fresh" project
Filip
Filipβ€’8mo ago
Nice thinking! If that doesn't work out, let me know and I'll try to deploy CryptoTX πŸ™‚
ellie
ellieβ€’8mo ago
just wanted to pop in and say that fly.io has had several incidents over the last 24 hours which are affecting deployments and machine availability, so there may be a problem that's not caused by you πŸ™‚ (I spent a few hours down a rabbit hole last night when it turnd out to be a fly.io incident...)
Kbk
KbkOPβ€’8mo ago
yes indeed, I made deploy from "fresh" project at morning and it works fine I dont have this error now
'Error: failed to fetch an image or build from source: error building: failed to solve: failed to compute cache key: failed to calculate checksum of ref e89ea33e-dc1f-4e53-88b3-60b92f4ab750::sn1guuphpovc2oudy8lca8nuj: "/node_modules/.prisma/client/schema.prisma": not found\n' I still have log in console about missing database_url but fly.io automaticly assigne this env and connection with db works fine. Thank you for advice about this issue!
Filip
Filipβ€’8mo ago
Man, this keeps happening on a regular basis πŸ˜… Thanks for the info @ellie And glad you got it working @Kbk
martinsos
martinsosβ€’8mo ago
Maybe we should have a check in our wasp deploy fly command that pulls in status from Fly and warns user if Fly is having issues hah
Want results from more Discord servers?
Add your server