Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection timeout: pool is probably full. #6034

Open
shuo-tian opened this issue Mar 12, 2024 · 4 comments
Open

Connection timeout: pool is probably full. #6034

shuo-tian opened this issue Mar 12, 2024 · 4 comments

Comments

@shuo-tian
Copy link

Environment

Knex version: 3.1.0
Database + version: PostgreSQL 13.13 (Ubuntu 13.13-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit
OS: Windows 10
Node: 16.20.2
pg: 8.11.3

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do
    I'm running the back end of a web app. It should start without an error

  2. Error message
    image

"Error while establishing postgresql connection:  Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
 
   KnexTimeoutError : Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
  1. Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
    database connection to MySQL or PostgreSQL, then single file example which initializes
    needed data and demonstrates the problem.

I don't have one for now. I can create a sandbox later if needed.

configs:

module.exports = {
  client: "postgresql",
  connection: {
    connectionString: process.env.DATABASE_URL,
    ssl: { rejectUnauthorized: false },
  },
  acquireConnectionTimeout: 1000000,
  "pool": {
    "min": 2,
    "max": 6,
    "createTimeoutMillis": 3000,
    "acquireTimeoutMillis": 30000,
    "idleTimeoutMillis": 30000,
    "reapIntervalMillis": 1000,
    "createRetryIntervalMillis": 100,
    "propagateCreateError": true
  },
  migrations: {
    tableName: "migrations"
  },  
};

I've seen the same error with Prisma, which is documented here. I wonder if something similar can be done here.

@jarzt-pham
Copy link

I have the same problem

@rluvaton
Copy link
Member

Can you please provide a minimal reproduction repository

@shuo-tian
Copy link
Author

Can you please provide a minimal reproduction repository

No, as I can't reproduce it consistently. Sometimes re-running npm run dev after seeing this error fixes it.

@rluvaton
Copy link
Member

I don't know how I can help without a minimal reproduction repository as it is probably a local setup, when it happens try to connect debug the db connections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants