Skip to content

Strapi v4, postgres, Error "Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?" #11860

@smaranjit

Description

@smaranjit

Bug report

Describe the bug

I am getting an error message on Postgres database (version 14) but working perfectly with MySQL database

[2021-12-09 19:26:58.233] debug: ⛔️ Server wasn't able to start properly.
[2021-12-09 19:26:58.235] error: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at Client_PG.acquireConnection (/home/xxxx/xxx/node_modules/knex/lib/client.js:295:26)
    at runNextTicks (internal/process/task_queues.js:62:5)
    at listOnTimeout (internal/timers.js:523:9)
    at processTimers (internal/timers.js:497:7)
error Command failed with exit code 1.

when I have 34+ collections, 200+ relation types, 250+ tables in the database and when adding, removing or modifying field or relation

Steps to reproduce the behavior

  1. 34+ collections, 200+ relation type, 250+ tables in database
  2. modify any schema
  3. See error

Update: https://github.com/smaranjit/strapi4-knex-issue-demonstration, we can use this repository to reproduce the error.

Expected behavior

the server should restart without error

System

  • Node.js version: Node LTS version v14
  • NPM version: npm v6.14.15
  • Strapi version: v4
  • Database: postgres
  • Operating system: ubuntu 21.10

Additional context

working fine for less no of collections or relations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions