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
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:
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?Could you maybe try doing
wasp clean
and then try deploying? π@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'
}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?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?
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
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?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.
@sodic one for you
I will try to make deployment from "fresh" project
Nice thinking! If that doesn't work out, let me know and I'll try to deploy CryptoTX π
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...)
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!
'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!
Man, this keeps happening on a regular basis π
Thanks for the info @ellie
And glad you got it working @Kbk
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