When trying to perform a database action i get network error. Also when trying to register
When i try to perform a database action or register an account i get network error. I did
When i do the prisma thingy opens and i see all the tables.
7 Replies
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided, it seems like your PostgreSQL database is running correctly as indicated by the logs. However, you're experiencing a network error when trying to perform a database action or register an account.
This issue might be related to the connection between your application and the database. Here are a few things you could check:
1. Database Connection String: Ensure that the connection string in your
.env
file is correct. It should look something like this: DATABASE_URL="postgresql://postgres:devpass@localhost:5432/postgres"
.
2. Database Server: Make sure your database server is running at localhost:5432
. You can check this by running the command docker info
and docker -v
to ensure Docker is installed and running, as Docker is used to run the PostgreSQL database.
3. Prisma Client: There might be an issue with the Prisma Client. One of the issues mentioned was about an error in Prisma Client request, where the query engine binary for the current platform could not be found. This usually happens when Prisma Client is built on a different platform. To solve this, you can add the platform "undefined" to the "generator" block in the "schema.prisma" file and then run "prisma generate" for your changes to take effect.
If you're still experiencing issues, it might be helpful to provide more details about the exact error message you're seeing when trying to perform a database action or register an account.
Sources:
- Github Issue (closed): Wasp db studio not working? (https://github.com/wasp-lang/wasp/issues/228)
- Github Issue (closed): Realworld app returning Network Error (https://github.com/wasp-lang/wasp/issues/460)
- Discord support thread: "wasp start db" takes too much time. (https://discord.com/channels/686873244791210014/1223569423177089093)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?
why is this on the top of the .env example file? @kapa.ai
Let me check the knowledge base for you. One moment! :books:
----------------------
The note at the top of the
.env
example file is providing instructions on how to set up your database when using Wasp. Here's a breakdown of what each part means:
- wasp start db
: This command starts a default PostgreSQL development database for you. Your Wasp app will automatically connect to it, so you just need to keep this command running in the background. This is a convenient feature as you don't need to set up your own database or provide its connection URL to the Wasp app.
- wasp db migrate-dev
: This command synchronizes the development database with the current state of your schema (entities). If there are any changes in the schema, it generates a new migration and applies any pending migrations to the database.
- wasp start
: This command launches the Wasp app in development mode. It automatically opens a browser tab with your application running and watches for any changes to .wasp or files in src/
to automatically reflect in the browser.
- DATABASE_URL env variable
: If you're not using the wasp start db
command (i.e., you're connecting to an existing database or spinning up your own dev database), you need to tell Wasp about it using the DATABASE_URL
environment variable. Wasp will use the value of DATABASE_URL
as a connection string. However, if you're using wasp start db
, you don't need to add this variable, as Wasp will handle the connection for you.
The note is there to guide you on how to set up your database and start your Wasp app, depending on whether you're using Wasp's default database or your own.
Sources:
- Wasp Docs: Connecting to a Database (https://wasp-lang.dev/docs/data-model/backends#connecting-to-a-database)
- Wasp Docs: CLI Reference (https://wasp-lang.dev/docs/general/cli#project-commands)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?I did all this, in docker a container is running.
I did the migrate
then did
but still when i try to register i get network error
@Wasp Team
@Sven Please keep in mind that we're a small team, and we will answer you as soon as we can.
Overusing pinging the whole team isn't going to help you.
Ohhh sorry, i thought i manually had to ping. Was not my intention to over rush u
Sorry
I will stop pinging then
I totally understand
SOLVED!
awesome. nice work
glad you got it solved 🙂