Error: P1001: Can't reach database server at localhost:5432

i made my friend clone my project on his pc fresh install of pgsql but idk why he cant connect to it same password same everything but it says it cant reach (pgadmin work) using bun 1.1.26 prisma 5.20.0
No description
26 Replies
RaphaelEtim
RaphaelEtim2w ago
Hi @realspinelle Does the password contain special characters? If yes, he will need to percent encode any of the special characters. Also, what does the connection string look like? You can obfuscate the username and password when sharing.
Connection URLs (Reference) | Prisma Documentation
Learn about the format and syntax Prisma ORM uses for defining database connection URLs for PostgreSQL, MySQL and SQLite.
realspinelle
realspinelle2w ago
hi 123456789 is the password DATABASE_URL = "postgresql://postgres:123456789@localhost:5432/panel"
RaphaelEtim
RaphaelEtim2w ago
The connection string looks correct. Is a VPN being used?
realspinelle
realspinelle2w ago
yes but not the problem in this case i tryed to disable / enable no change i tryed so many things like 127.0.0.1 i was like maybe his windows fucked i tryed reinstall pgsql 2 TIMES x)
RaphaelEtim
RaphaelEtim7d ago
Can you probably try restarting the system to see if it helps resolve the issue?
realspinelle
realspinelle7d ago
did it already no fix i have no idea and he doesnt want to reinstall windows ... tryed on 2 different pc same error now something is weird trying on an another pc now
RaphaelEtim
RaphaelEtim7d ago
Can you try connecting to a database client like TablePlus https://tableplus.com/
TablePlus | Modern, Native Tool for Database Management.
Modern, native client with intuitive GUI tools to create, access, query & edit multiple relational databases: MySQL, PostgreSQL, SQLite, Microsoft SQL Server, Amazon Redshift, MariaDB, CockroachDB, Vertica, Cassandra, and Redis.
realspinelle
realspinelle7d ago
working its prisma 100% there isnt a debug thingy to know what goes wrong ?
RaphaelEtim
RaphaelEtim7d ago
Can you share the repository with me
realspinelle
realspinelle7d ago
sure i dm you ? its a private git behind a vpn i can add u to it but
RaphaelEtim
RaphaelEtim7d ago
You can use this command line statement to add debugging to it
export DEBUG="*"
export DEBUG="*"
realspinelle
realspinelle7d ago
i tryed that i found it somewhere i dont remember where and it didnt show more information
RaphaelEtim
RaphaelEtim7d ago
Debugging (Reference) | Prisma Documentation
This page explains how to enable debugging output for Prisma Client by setting the DEBUG environment variable.
realspinelle
realspinelle7d ago
ok wait im trying again
RaphaelEtim
RaphaelEtim7d ago
once you get the logs, please paste it here. Thanks
realspinelle
realspinelle7d ago
yep
PS bun run test
$ DEBUG=* prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "panel", schema "public" at "localhost:5432"

Error: P1001: Can't reach database server at `localhost:5432`

Please make sure your database server is running at `localhost:5432`.
error: script "test" exited with code 1
PS bun run test
$ DEBUG=* prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "panel", schema "public" at "localhost:5432"

Error: P1001: Can't reach database server at `localhost:5432`

Please make sure your database server is running at `localhost:5432`.
error: script "test" exited with code 1
or
realspinelle
realspinelle7d ago
at launch of my app i added
await prisma.$connect()
await prisma.$connect()
but i have no clue why it does work for me i have a fresh install too OMG I FOUND wtf sooo.... x) shouldnt the database get automaticly created by prisma ? x) cause i made it by hand like i just created the db not populate it and it worked on my prod env its making the database alone
RaphaelEtim
RaphaelEtim7d ago
you would need to have done a prisma db push or prisma migrate dev
realspinelle
realspinelle7d ago
ye but those didnt work until i made the db 100% check i record
realspinelle
realspinelle7d ago
@RaphaelEtim
realspinelle
realspinelle7d ago
an actual weird bug but its maybe cause of the usage of bun there is also a bug of any command hanging in last version of bun
RaphaelEtim
RaphaelEtim7d ago
can you try bunx prisma db push? I want to see if it gives the same error So i can raise an issue with our engineering team
Yetzederixx
Yetzederixx7d ago
the actual db create statement is rarely done by any orm I've ever used
RaphaelEtim
RaphaelEtim7d ago
db push command in Prisma creates the db if it does not exist. https://www.prisma.io/docs/orm/reference/prisma-cli-reference#db-push
Prisma CLI reference | Prisma Documentation
This page gives an overview of all available Prisma CLI commands, explains their options and shows numerous usage examples.
realspinelle
realspinelle7d ago
It does with any commands Well check the video i sent it doesnt I dont have node installed on my pc
Want results from more Discord servers?
Add your server