P
Prisma3mo ago
friselis

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
RaphaelEtim3mo 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.
friselis
friselisOP3mo ago
hi 123456789 is the password DATABASE_URL = "postgresql://postgres:123456789@localhost:5432/panel"
RaphaelEtim
RaphaelEtim3mo ago
The connection string looks correct. Is a VPN being used?
friselis
friselisOP3mo 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
RaphaelEtim3mo ago
Can you probably try restarting the system to see if it helps resolve the issue?
friselis
friselisOP3mo 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
RaphaelEtim3mo 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.
friselis
friselisOP3mo ago
working its prisma 100% there isnt a debug thingy to know what goes wrong ?
RaphaelEtim
RaphaelEtim3mo ago
Can you share the repository with me
friselis
friselisOP3mo ago
sure i dm you ? its a private git behind a vpn i can add u to it but
RaphaelEtim
RaphaelEtim3mo ago
You can use this command line statement to add debugging to it
export DEBUG="*"
export DEBUG="*"
friselis
friselisOP3mo ago
i tryed that i found it somewhere i dont remember where and it didnt show more information
RaphaelEtim
RaphaelEtim3mo ago
Debugging (Reference) | Prisma Documentation
This page explains how to enable debugging output for Prisma Client by setting the DEBUG environment variable.
friselis
friselisOP3mo ago
ok wait im trying again
RaphaelEtim
RaphaelEtim3mo ago
once you get the logs, please paste it here. Thanks
friselis
friselisOP3mo 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
friselis
friselisOP3mo 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
RaphaelEtim3mo ago
you would need to have done a prisma db push or prisma migrate dev
friselis
friselisOP3mo ago
ye but those didnt work until i made the db 100% check i record
friselis
friselisOP3mo ago
@RaphaelEtim
friselis
friselisOP3mo 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
RaphaelEtim3mo 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
Yetzederixx3mo ago
the actual db create statement is rarely done by any orm I've ever used
RaphaelEtim
RaphaelEtim3mo 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.
friselis
friselisOP3mo 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