prisma: Error: P1002 database server was reached but timed out
Bug description
I was running prisma migrate dev
and ran into this error.
Error: P1002
The database server at `xx.xx.xx.xx`:`5432` was reached but timed out.
Please try again.
Please make sure your database server is running at `xx.xx.xx.xx`:`5432`.
I’m not using pgBouncer. This is my connection string:
postgres://<XXXXXXXXXX>/defaultdb?connection_limit=3&connection_timeout=30&pool_timeout=30
I looked at #6053
How to reproduce
This is a random error.
Expected behavior
Primsa migrate happens as expected
Prisma information
Environment & setup
- OS: Mac OS 10.15.7
- Database: Postgres
- Node.js version: 15.14.0
- Prisma version:
prisma : 2.21.2
@prisma/client : 2.21.2
Current platform : darwin
Query Engine : query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine : migration-engine-cli e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : e421996c87d5f3c8f7eeadd502d4ad402c89464d
Studio : 0.371.0
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 26 (9 by maintainers)
can you explain more ?
Resolved by enable PRISMA_SCHEMA_DISABLE_ADVISORY_LOCK. Guess it is a network issue
I’m getting this with
npx prisma migrate dev
. This just started happening to me after stepping away from the project for like a month, I was using Prisma for.It originally popped up in 4.8.0 but upgrading @prisma/client@4.11.0 doesn’t seem to help. This is all running inside a docker setup which you can see here.
Notably, prisma seems to be fine otherwise. I can query and update records via code. Just running migrations is not finding the database. It’s using the same env variables as the code.
@janpio I am running
npx prisma migrate dev
and I expected it to just add a uniqueness constraint to an existing field in a table.same