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.

.Net 5.0: upgrading from 5.0.2 -> 5.0.5 leads to '53300: sorry, too many clients already'

See original GitHub issue

Issue:

  1. currently running .net 5.0, and after upgrading to Npgsql.EntityFrameworkCore.PostgreSQL 5.0.5, connection strings are not disposed of, leading to an exception: ‘53300: sorry, too many clients already’.

Workaround:

  1. Downgrading to Npgsql.EntityFrameworkCore.PostgreSQL 5.0.2

Tested: For 5.0.2 and 5.0.5, completed the following steps:

  1. ran pg_stat_activity query to see current db connections
SELECT *
FROM   pg_stat_activity
order by "backend_start"
  1. run 10 queries using ef core
  2. re-run pg_stat_activity query to see connections

Test Result:

  1. 5.0.2 - 2 connection remains idle
  2. 5.0.5 - 10 connections remain idle

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
taspeotiscommented, Apr 20, 2021

I recommend downgrading to Npgsql.EntityFrameworkCore.PostgreSQL 5.0.4

I mentioned downgrading to 5.0.4 on another issue but I was a bit inaccurate (sorry) - the next earlier version on NuGet is 5.0.2. Downgrading to that fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PostgresException 53300: sorry, too many clients already
Hi all, I initialize Hangfire.Postgres with the name of my connection string. The same database is used by EntityFramework with the same ...
Read more >
Too Many Clients Already in C# and PostgreSQL
Too Many Clients Already " exception comes where a server is asked to create more connections than it is configured to maintain.
Read more >
psql: FATAL: sorry, too many clients already
This seems to be client programming specific problem. You won't be able to fix this by e.g. raising "max_connections" parameter.
Read more >
.NET 5.0 will reach End of Support on May 10, 2022 - . ...
NET 5.0 will reach end of support on May 08, 2022, this blog breaks down all the valuable information you need to know...
Read more >
Upgrading several of my Applications and Libraries to .NET 5.0
NET 5.0 's release a couple of weeks ago, I went through all of my personal/company .NET Core 3.1 applications and upgraded them...
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