You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, I have searched for similar issues on GitHub and found none.
What did you do?
Issue with Prisma in Docker (v2.2.0)
Description
After updating to version 2.2.0, Prisma cannot connect to PostgreSQL in Docker, throwing the following error:
Error: P1001: Can't reach database server at localhost:5432
In version 1.8.2, it works without any issues.
Details
I am using Google Cloud.
PostgreSQL in Docker has IP:172.23.0.3, but Prisma keeps trying to connect to localhost:5432.
I tried using DATABASE_URL=postgresql://user:password@postgres:5432/evolution and DATABASE_URL=postgresql://user:[email protected]:5432/evolution, but neither worked.
docker exec -it evolution_api printenv fails with broken pipe.
Question
Does anyone have any idea how to make it work with a newer version than 1.8.2?
Thanks for the help.
What did you expect?
use v2.2.0
What did you observe instead of what you expected?
Prisma fails to connect to the PostgreSQL database and throws the following error: Error: P1001: Can't reach database server at localhost:5432
Screenshots/Videos
NO
Which version of the API are you using?
2.2.0 (Works fine on 1.8.2)
What is your environment?
Linux
Other environment specifications
Cloud Provider: Google Cloud
PostgreSQL in Docker IP:172.23.0.3, but Prisma keeps trying to connect to localhost:5432.
The issue was in the prisma/postgresql-schema.prisma file, specifically with the datasource configuration:
datasourcedb {provider="postgresql"url=env("DATABASE_CONNECTION_URI")// Use DATABASE_CONNECTION_URI!}
In my .env file, I was using the DATABASE_URL variable instead of DATABASE_CONNECTION_URI. The value of the environment variable in the .env file was configured like this:
After making this change, the connection to the database worked correctly, and the issue was resolved.
You can now copy and paste this into a GitHub issue as a response.
Welcome!
What did you do?
Issue with Prisma in Docker (v2.2.0)
Description
After updating to version
2.2.0
, Prisma cannot connect to PostgreSQL in Docker, throwing the following error:Error: P1001: Can't reach database server at localhost:5432
In version
1.8.2
, it works without any issues.Details
172.23.0.3
, but Prisma keeps trying to connect tolocalhost:5432
.DATABASE_URL=postgresql://user:password@postgres:5432/evolution
andDATABASE_URL=postgresql://user:[email protected]:5432/evolution
, but neither worked.docker exec -it evolution_api printenv
fails withbroken pipe
.Question
Does anyone have any idea how to make it work with a newer version than 1.8.2?
Thanks for the help.
What did you expect?
use v2.2.0
What did you observe instead of what you expected?
Prisma fails to connect to the PostgreSQL database and throws the following error: Error: P1001: Can't reach database server at localhost:5432
Screenshots/Videos
NO
Which version of the API are you using?
2.2.0
(Works fine on1.8.2
)What is your environment?
Linux
Other environment specifications
172.23.0.3
, but Prisma keeps trying to connect tolocalhost:5432
.postgresql://user:password@postgres:5432/evolution
postgresql://user:[email protected]:5432/evolution
docker exec -it evolution_api printenv
fails withbroken pipe
.If applicable, paste the log output
Error: P1001: Can't reach database server at localhost:5432
Additional Notes
No response
The text was updated successfully, but these errors were encountered: