TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

See original GitHub issue

Environment

Knex version: 0.15.2 Database: sqlite3 OS: Ubuntu 18

I’m getting lots of errors like TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

Any ideas? All my code lives in this one file: https://github.com/umaar/wiki-globe/blob/master/index.js - that code powers this globe which I posted in a Hacker News comment and in turn led to the discovery of such error.

An example query looks like this:

await knex('edits').insert([{
	field1: JSON.stringify(data),
	field2: 'field2'
}]);

Does sqlite3 only allow a single connection to it because it’s file-based? I’ll try adding .transacting() calls to see if that makes a difference.

I guess it comes down to: some technical limitation with sqlite3 (maybe lack of pooling?) or some badly written code DB/queries on my part! Any insight you have would be much appreciated, thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:47 (9 by maintainers)

github_iconTop GitHub Comments

162reactions
batadamnjanoviccommented, Apr 28, 2020

I solved this problem with these versions:

"knex": "^0.21.1",
"objection": "^2.1.3",
"pg": "^8.0.3"
13reactions
demisxcommented, Apr 30, 2020

@batadamnjanovic Thank you so much! I’ve been pulling my hair trying to understand what the hell happened. Upgrading to the latest pg did the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Knex: Timeout acquiring a connection. The pool is probably ...
Explanation: The propagateCreateError is set to true by default in Knex and throws a TimeoutError if the first create connection to the database ......
Read more >
Knex: Timeout acquiring a connection. The pool is probably ...
The pool is probably full. Are you missing a .transacting(trx) call? I've tried all the tweaks I found online from changing the db...
Read more >
Debugging Knex: Timeout acquiring a connection
Unhandled rejection TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
Read more >
knex: timeout acquiring a connection. the pool is probably full ...
Knex : Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? KnexTimeoutError: Knex: Timeout acquiring a ...
Read more >
KnexTimeoutError: Knex: Timeout acquiring a connection. The ...
Are you missing a .transacting(trx) call KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full knex SubError [TimeoutError]: Knex: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found