question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Timed out fetching a new connection from the pool" message is misleading

See original GitHub issue

Bug description

It’s not really a bug, but a misleading message that could be improved. The Timed out fetching a new connection from the pool. Please consider reducing the number of requests or increasing the `connection_limit` parameter (https://www.prisma.io/docs/concepts/components/prisma-client/connection-management#connection-pool). Current limit: 1. message hints that we should either reduce requests count or increase the connection limit parameter.

Now the reducing of requests is valid as I have faced it. But the two suggestions can be misleading in situations like:

1- Using lambda and having set the connection_limit to 1 as a temporary fix for the connections depletion issue. 2- Failure to connect to a database in cases like: - database being in private subnets with no public internet access. - misconfiguration on the AWS/provider side that caused a database in a public subnet to not be publicly accessible.

How to reproduce

Any of the scenarios above

Expected behavior

What I suggest is that it keeps the starting part of the message saying that it timed out while getting a connection, but improve the second part by saying something like:

This could happen due to multiple reasons like...

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, May 6, 2021

That is possible that the mismatch still existed there. If possible, update to a recent version and see if the same misleading error happens again.

Besides that, the error message in general is not the best and the advice to change the pool size / connection limit might not be the best any more. We will look into that.

1reaction
omar-dulaimicommented, May 5, 2021

Unfortunately no, since this happened a while ago. The issue basically was the database being inaccessible from lambda for reasons like missing internet gateway or wrong security groups, etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nestjs - Timed out fetching a new connection from the ...
I have a nestjs scheduler which will run every one hour. I'm using multiple library to connect to postgres ...
Read more >
4 Optimizing Universal Connection Pool Behavior
The connection wait timeout specifies how long an application request waits to obtain a connection if there are no longer any connections in...
Read more >
API Reference — asyncpg Documentation
If a callable is provided, it will be called each time a new connection is established. ... coroutine fetch(query, *args, timeout=None, record_class=None) ...
Read more >
Connection Pooling
A connection pool is a standard technique used to maintain long running connections in memory for efficient re-use, as well as to provide ......
Read more >
c3p0-v0.9.5.5 - JDBC3 Connection and Statement Pooling
Introduction; Basic Pool Configuration; Managing Pool Size and Connection Age ... fetch a JNDI-bound DataSource InitialContext ictx = new InitialContext(); ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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