- Postgres 14
- prisma 2
- Azure Database
Faced an error during seeding development DB
remaining connection slots are reserved for non-replication superuser connections
I found that this error is caused by lack of connection pool. After some struggling, I failed. Here are my tries.
- checked session leaks(not found)
- increase 'max_connections' value in
/etc/postgresql/14/postgresql.conf
- reboot DB
- reboot local node.js app which uses the remote DB
Full logs are below.
PrismaClientUnknownRequestError:
Invalid `prisma.problem.create()` invocation in
/myproject/api/prisma/seed.ts:448:43
445
446 await Promise.all(
447 problemData.map(async (data) => {
→ 448 const newOne = await prisma.problem.create(
Error in connector: Error querying the database: db error: FATAL: remaining connection slots are reserved for non-replication superuser connections
at RequestHandler.request (/myproject/api/node_modules/@prisma/client/runtime/index.js:49026:15)
at async PrismaClient._request (/myproject/api/node_modules/@prisma/client/runtime/index.js:49919:18)
at async /myproject/api/prisma/seed.ts:448:22
at async Promise.all (index 11)
at async main (/myproject/api/prisma/seed.ts:446:3) {
clientVersion: '3.15.2'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
An error occured while running the seed command:
Error: Command failed with exit code 1: yarn seed