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

After upgrading to ^8.2.0 we are seing pool errors from knex #2223

Closed
neemah opened this issue May 18, 2020 · 13 comments
Closed

After upgrading to ^8.2.0 we are seing pool errors from knex #2223

neemah opened this issue May 18, 2020 · 13 comments

Comments

@neemah
Copy link

neemah commented May 18, 2020

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

Once we've downgraded to 8.1.0 - they are gone. I am not sure if these are related, but just letting you know.

@donflopez
Copy link

What version did you have installed, 8.2.0 or 8.2.1? I see the ^, but could you confirm please?

8.2.1 has a fix for a bug that could be related -> #2218

Thanks!

@neemah
Copy link
Author

neemah commented May 18, 2020

Both version have this bug, 8.2.0 and 8.2.1

@neemah
Copy link
Author

neemah commented May 18, 2020

Firstly I thought that this fix would help, upgraded to 8.2.1, but it's reproduced and only downgrade helped.

@neemah
Copy link
Author

neemah commented May 18, 2020

2020-05-18T07:02:46.170282+00:00 app[web.2]: KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
2020-05-18T07:02:46.170294+00:00 app[web.2]: at Client_PG.acquireConnection (/app/node_modules/knex/lib/client.js:349:26)
2020-05-18T07:02:46.170295+00:00 app[web.2]: From previous event:
2020-05-18T07:02:46.170296+00:00 app[web.2]: at runCallback (timers.js:705:18)
2020-05-18T07:02:46.170296+00:00 app[web.2]: at tryOnImmediate (timers.js:676:5)
2020-05-18T07:02:46.170296+00:00 app[web.2]: at processImmediate (timers.js:658:5)
2020-05-18T07:02:46.170297+00:00 app[web.2]: at process.topLevelDomainCallback (domain.js:126:23)
2020-05-18T07:02:46.170297+00:00 app[web.2]: From previous event:
2020-05-18T07:02:46.170298+00:00 app[web.2]: at Sync.<anonymous> (/app/node_modules/bookshelf/lib/sync.js:204:8)
2020-05-18T07:02:46.170298+00:00 app[web.2]: From previous event:
2020-05-18T07:02:46.170299+00:00 app[web.2]: at Sync.<anonymous> (/app/node_modules/bookshelf/lib/sync.js:66:17)
2020-05-18T07:02:46.170300+00:00 app[web.2]: From previous event:
2020-05-18T07:02:46.170300+00:00 app[web.2]: at Child.<anonymous> (/app/node_modules/bookshelf/lib/model.js:713:12)
2020-05-18T07:02:46.170300+00:00 app[web.2]: From previous event:
2020-05-18T07:02:46.170301+00:00 app[web.2]: at Child.fetch (/app/node_modules/bookshelf/lib/model.js:702:19)

I am not sure if this will help

Client_PG.acquireConnection - https://github.com/knex/knex/blob/master/lib/client.js#L338

@brianc
Copy link
Owner

brianc commented May 18, 2020

Hmmm - that's no good. I didn't change anything related to the pool in 8.2.x so not totally sure what that could be yet...

Do you have a self-contained script or test that can reproduce this issue? Knex is rather large & I don't use it myself, so narrowing this down to something I can target more accurately would help me diagnose.

@flotwig
Copy link

flotwig commented May 29, 2020

I am also having this error, although, I am not using Knex. Sequelize via pg hangs forever when connecting to the postgres database. Downgrading to pg@8.1.0 fixes it.

@JoelHobsonRoadmunk
Copy link

JoelHobsonRoadmunk commented Jun 9, 2020

I'm running into this error as well, with every version I try (I've seen it happen on 8.1.0, 8.2.1, 7.11.0 and 7.14.0 which is especially strange).

One of my coworkers has run into the same issue, but others haven't. This seems to have started for me after upgrading to Ubuntu 20.04, and my coworker who can reproduce it is on the same. I don't know if it's related, but it seemed like an odd coincidence. My coworker was able to resolve the problem on his end by upgrading to 8.2.1, but that hasn't fixed things for me.

@brianc
Copy link
Owner

brianc commented Jun 11, 2020

Please let me know if you have a self-contained script to reproduce the issue. I'd love to look at it, but can't do much w/o steps to reproduce.

@JoelHobsonRoadmunk
Copy link

Unfortunately, I don't - due to the way our app is structured, there are a lot of potential interacting variables. I'm currently busy with other tasks and probably won't return to this until next week, but if I can find a minimal reproduction, I'll definitely share it here.

@Technickster
Copy link

@flotwig Are you using Lambda functions at all? I am seeing the same issue there.

@JoelHobsonRoadmunk
Copy link

Just a followup from my comment - I don't have minimal repro steps, but I was able to fix the issue by downgrading node to 12.18.1. I was on 14.4.0 before that. I think the issue I was experiencing was the same as knex/knex#3831

@FaCuZ
Copy link

FaCuZ commented Jun 26, 2020

I had a similar problem, the error occurs from v14.0.0+ I fixed it downgrading node to v13.14.0. Thanks @JoelHobsonRoadmunk

@neemah
Copy link
Author

neemah commented Aug 23, 2020

After playing with pool settings in Knex (which depends on tarn js) with most recent versions of pg (8.3+) we don't see such errors anymore (at least ones we have no explanation for).

Thanks!

@neemah neemah closed this as completed Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants