RolnickLab / ami-platform

GNU General Public License v3.0
8 stars 2 forks source link

OperationalError: connection failed: FATAL: remaining connection slots are reserved for non-replication superuser ... #426

Open sentry-io[bot] opened 3 weeks ago

sentry-io[bot] commented 3 weeks ago

Try adding connection pooling with PG Bouncer

Sentry Issue: AMI-PLATFORM-API-6VF

OperationalError: connection failed: FATAL:  remaining connection slots are reserved for non-replication superuser connections
(1 additional frame(s) were not displayed)
...
  File "django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "django/db/backends/base/base.py", line 270, in connect
    self.connection = self.get_new_connection(conn_params)
  File "django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "django/db/backends/postgresql/base.py", line 275, in get_new_connection
    connection = self.Database.connect(**conn_params)
  File "psycopg/connection.py", line 728, in connect
    raise ex.with_traceback(None)

OperationalError: connection failed: FATAL:  remaining connection slots are reserved for non-replication superuser connections
(11 additional frame(s) were not displayed)
...
  File "django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "django/db/backends/base/base.py", line 270, in connect
    self.connection = self.get_new_connection(conn_params)
  File "django/utils/asyncio.py", line 26, in inner
    return func(*args, **kwargs)
  File "django/db/backends/postgresql/base.py", line 275, in get_new_connection
    connection = self.Database.connect(**conn_params)
  File "psycopg/connection.py", line 728, in connect
    raise ex.with_traceback(None)