Netbox v3.6.x does not work with pgpool #8726

Closed
opened 2025-12-29 20:40:24 +01:00 by adam · 0 comments
Owner

Originally created by @rc-networks on GitHub (Oct 6, 2023).

NetBox version

v3.6.3

Python version

3.11

Steps to Reproduce

  1. Install bitnami/postgresql-ha
PSQL_IMAGE_VERSION="15.4.0-debian-11-r43"
PGPOOL_IMAGE_VERSION="4.4.4-debian-11-r32"

helm upgrade -i $POSTGRES_RELEASE \
    --create-namespace \
    --namespace $NAMESPACE \
    --set postgresql.password="$PSQL_PASSWORD" \
    --set postgresql.repmgrUsername="$PSQL_REPMGR" \
    --set postgresql.repmgrPassword="$PSQL_REPMGR_PASS" \
    --set postgresql.repmgrDatabase="$PSQL_REPMGR" \
    --set postgresql.image.tag="$PSQL_IMAGE_VERSION" \
    --set postgresql.initdbScriptsCM=init-db-script \
    --set pgpool.adminUsername="$PGPOOL_ADMIN" \
    --set pgpool.adminPassword="$PGPOOL_ADPASS" \
    --set pgpool.customUsers.usernames="$PSQL_USERNAME" \
    --set pgpool.customUsers.passwords="$PSQL_PASSWORD" \
    --set pgpool.image.tag="$PGPOOL_IMAGE_VERSION" \
    --set persistence.storageClass="$STG_CLASS" \
    --set persistence.size="2Gi" \
    oci://registry-1.docker.io/bitnamicharts/postgresql-ha
  1. Go to bootc/netbox-chart, copy the values.yaml file and point netbox to use the bitnamicharts/postgresql-ha's SVC. Then Install netbox via the given helm-chart.
helm upgrade -i $NETBOX_RELEASE \
    --create-namespace \
    --namespace $NAMESPACE \
    --set superuser.name="$NETBOX_USERNAME" \
    --set superuser.password="$NETBOX_PASS" \
    --set superuser.apiToken="$NETBOX_TOKEN" \
    --set napalm.username="$NAPALM_USR" \
    --set napalm.password="$NAPALM_PAS" \
    --set externalDatabase.database="$NETBOX_PSQL_DB" \
    --set externalDatabase.username="$PSQL_USERNAME" \
    --set externalDatabase.password="$PSQL_PASSWORD" \
    --set image.tag="$NETBOX_VERSION" \
    --set persistence.storageClass="$STG_CLASS" \
    -f config/netbox-values-dev.yaml \
    bootc/netbox

Expected Behavior

Same as with the Netbox v3.5x and below, installed without issues:

image

NOTE: This is my prod environment running Netbox v3.5.9 with exactly the same config and variables as with the deployment on dev namespace for testing newer versions.
Dev namespace will be an entirely fresh deployment without any data.

Observed Behavior

Netbox pods and or Worker Pod erroring out:

% kubectl logs netbox-dev-58ffdb69fb-ddb7f -n netbox-dev
Defaulted container "netbox" out of: netbox, init-dirs (init)
⚙️ Applying database migrations
🧬 loaded config '/etc/netbox/config/configuration.py'
🧬 loaded config '/etc/netbox/config/extra.py'
🧬 loaded config '/etc/netbox/config/logging.py'
🧬 loaded config '/etc/netbox/config/plugins.py'
Operations to perform:
  Apply all migrations: account, admin, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, wireless
Running migrations:
Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/psycopg/server_cursor.py", line 294, in execute
    raise ex.with_traceback(None)
psycopg.OperationalError: consuming input failed: unable to execute Describe
DETAIL:  unable to get the bind message
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 114, in debug_sql
    yield
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
    return super().execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
    with self.db.wrap_database_errors:
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox/venv/lib/python3.11/site-packages/psycopg/server_cursor.py", line 294, in execute
    raise ex.with_traceback(None)
django.db.utils.OperationalError: consuming input failed: unable to execute Describe
DETAIL:  unable to get the bind message
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
<omitted output too long>
Originally created by @rc-networks on GitHub (Oct 6, 2023). ### NetBox version v3.6.3 ### Python version 3.11 ### Steps to Reproduce 1. Install [bitnami/postgresql-ha](bitnami/postgresql-ha) ``` PSQL_IMAGE_VERSION="15.4.0-debian-11-r43" PGPOOL_IMAGE_VERSION="4.4.4-debian-11-r32" helm upgrade -i $POSTGRES_RELEASE \ --create-namespace \ --namespace $NAMESPACE \ --set postgresql.password="$PSQL_PASSWORD" \ --set postgresql.repmgrUsername="$PSQL_REPMGR" \ --set postgresql.repmgrPassword="$PSQL_REPMGR_PASS" \ --set postgresql.repmgrDatabase="$PSQL_REPMGR" \ --set postgresql.image.tag="$PSQL_IMAGE_VERSION" \ --set postgresql.initdbScriptsCM=init-db-script \ --set pgpool.adminUsername="$PGPOOL_ADMIN" \ --set pgpool.adminPassword="$PGPOOL_ADPASS" \ --set pgpool.customUsers.usernames="$PSQL_USERNAME" \ --set pgpool.customUsers.passwords="$PSQL_PASSWORD" \ --set pgpool.image.tag="$PGPOOL_IMAGE_VERSION" \ --set persistence.storageClass="$STG_CLASS" \ --set persistence.size="2Gi" \ oci://registry-1.docker.io/bitnamicharts/postgresql-ha ``` 2. Go to [bootc](https://github.com/bootc)/[netbox-chart](https://github.com/bootc/netbox-chart), copy the values.yaml file and point netbox to use the bitnamicharts/postgresql-ha's SVC. Then Install netbox via the given helm-chart. ``` helm upgrade -i $NETBOX_RELEASE \ --create-namespace \ --namespace $NAMESPACE \ --set superuser.name="$NETBOX_USERNAME" \ --set superuser.password="$NETBOX_PASS" \ --set superuser.apiToken="$NETBOX_TOKEN" \ --set napalm.username="$NAPALM_USR" \ --set napalm.password="$NAPALM_PAS" \ --set externalDatabase.database="$NETBOX_PSQL_DB" \ --set externalDatabase.username="$PSQL_USERNAME" \ --set externalDatabase.password="$PSQL_PASSWORD" \ --set image.tag="$NETBOX_VERSION" \ --set persistence.storageClass="$STG_CLASS" \ -f config/netbox-values-dev.yaml \ bootc/netbox ``` ### Expected Behavior Same as with the Netbox v3.5x and below, installed without issues: <img width="1451" alt="image" src="https://github.com/netbox-community/netbox/assets/147031422/f867c7d7-ef23-4e69-8692-ffd3236330ff"> NOTE: This is my prod environment running Netbox v3.5.9 with exactly the same config and variables as with the deployment on dev namespace for testing newer versions. Dev namespace will be an entirely fresh deployment without any data. ### Observed Behavior Netbox pods and or Worker Pod erroring out: ``` % kubectl logs netbox-dev-58ffdb69fb-ddb7f -n netbox-dev Defaulted container "netbox" out of: netbox, init-dirs (init) ⚙️ Applying database migrations 🧬 loaded config '/etc/netbox/config/configuration.py' 🧬 loaded config '/etc/netbox/config/extra.py' 🧬 loaded config '/etc/netbox/config/logging.py' 🧬 loaded config '/etc/netbox/config/plugins.py' Operations to perform: Apply all migrations: account, admin, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, wireless Running migrations: Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/psycopg/server_cursor.py", line 294, in execute raise ex.with_traceback(None) psycopg.OperationalError: consuming input failed: unable to execute Describe DETAIL: unable to get the bind message server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 114, in debug_sql yield File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute return super().execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers return executor(sql, params, many, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute with self.db.wrap_database_errors: File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.11/site-packages/psycopg/server_cursor.py", line 294, in execute raise ex.with_traceback(None) django.db.utils.OperationalError: consuming input failed: unable to execute Describe DETAIL: unable to get the bind message server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. <omitted output too long> ```
adam closed this issue 2025-12-29 20:40:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8726