Skip to content

"TimeoutError: Knex: Timeout acquiring a connection" when using with Node 14 #3831

@nicoburns

Description

@nicoburns

Environment

Node: 14.x <-- pretty sure this is the problem / difference

Knex version: 0.21.0 (also seen in older version)
Database + version: Postgres 12
OS: Observed on macOS and Linux

Bug

  1. Initially, all knex connections/queries failed (timed out). I was able to fix regular connections by upgrading knex to 0.21.0 and node-pg to version 8.x. However, running migrations using knex migrate:latest or npx knex migrate:latest is still failing.

  2. Error message

TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
    at /<omitted>/node_modules/knex/lib/client.js:318:17

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