Postgres DB connect issues *Netbox pod and worker pod is not connecting to DB #19705
makkena-snps
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have created the NetBox on the kube cluster and am having some DB connectivity issues. But I see the DB is up and running fine.
kubectl -n netbox logs deployment/netbox --tail=100 -f
Defaulted container "netbox" out of: netbox, init-dirs (init), wait-for-redis (init)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (0s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (3s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (6s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (9s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (12s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (15s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (18s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (21s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (24s / 30s)
python /opt/netbox/netbox/generate_secret_key.py
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (27s / 30s)
postgres log
kubectl -n netbox logs statefulset/netbox-postgresql --tail=100
postgresql 15:09:57.72 INFO ==>
postgresql 15:09:57.72 INFO ==> Welcome to the Bitnami postgresql container
postgresql 15:09:57.72 INFO ==> Subscribe to project updates by watching https://github.com/bitnami/containers
postgresql 15:09:57.73 INFO ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
postgresql 15:09:57.73 INFO ==>
postgresql 15:09:57.74 INFO ==> ** Starting PostgreSQL setup **
postgresql 15:09:57.76 INFO ==> Validating settings in POSTGRESQL_* env vars..
postgresql 15:09:57.77 INFO ==> Loading custom pre-init scripts...
postgresql 15:09:57.77 INFO ==> Initializing PostgreSQL database...
postgresql 15:09:57.79 INFO ==> pg_hba.conf file not detected. Generating it...
postgresql 15:09:57.79 INFO ==> Generating local authentication configuration
postgresql 15:09:58.61 INFO ==> Starting PostgreSQL in background...
postgresql 15:09:58.81 INFO ==> Changing password of postgres
postgresql 15:09:58.82 INFO ==> Creating user netbox
postgresql 15:09:58.84 INFO ==> Granting access to "netbox" to the database "netbox"
postgresql 15:09:58.87 INFO ==> Setting ownership for the 'public' schema database "netbox" to "netbox"
postgresql 15:09:58.89 INFO ==> Configuring replication parameters
postgresql 15:09:58.92 INFO ==> Configuring synchronous_replication
postgresql 15:09:58.93 INFO ==> Configuring fsync
postgresql 15:09:58.97 INFO ==> Stopping PostgreSQL...
waiting for server to shut down.... done
server stopped
postgresql 15:09:59.08 INFO ==> Loading custom scripts...
postgresql 15:09:59.09 INFO ==> Enabling remote connections
postgresql 15:09:59.10 INFO ==> ** PostgreSQL setup finished! **
postgresql 15:09:59.11 INFO ==> ** Starting PostgreSQL **
2025-06-13 15:09:59.141 GMT [1] LOG: pgaudit extension initialized
2025-06-13 15:09:59.152 GMT [1] LOG: starting PostgreSQL 16.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2025-06-13 15:09:59.152 GMT [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2025-06-13 15:09:59.152 GMT [1] LOG: listening on IPv6 address "::", port 5432
2025-06-13 15:09:59.156 GMT [1] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2025-06-13 15:09:59.162 GMT [152] LOG: database system was shut down at 2025-06-13 15:09:59 GMT
2025-06-13 15:09:59.187 GMT [1] LOG: database system is ready to accept connections
2025-06-13 15:14:59.209 GMT [150] LOG: checkpoint starting: time
2025-06-13 15:15:03.378 GMT [150] LOG: checkpoint complete: wrote 44 buffers (0.3%); 0 WAL file(s) added, 0 removed, 0 recycled; write=4.115 s, sync=0.006 s, total=4.170 s; sync files=11, longest=0.004 s, average=0.001 s; distance=261 kB, estimate=261 kB; lsn=0/19505B0, redo lsn=0/1950578
srinivasaraomakkena@BD-MB68482 netbox % kubectl -n netbox get pod -l app.kubernetes.io/name=postgresql --show-labels
NAME READY STATUS RESTARTS AGE LABELS
netbox-postgresql-0 1/1 Running 0 121m app.kubernetes.io/component=primary,app.kubernetes.io/instance=netbox,app.kubernetes.io/managed-by=Helm,app.kubernetes.io/name=postgresql,app.kubernetes.io/part-of=netbox,app.kubernetes.io/version=16.1.0,apps.kubernetes.io/pod-index=0,controller-revision-hash=netbox-postgresql-84df7b5fbb,helm.sh/chart=postgresql-13.4.6,statefulset.kubernetes.io/pod-name=netbox-postgresql-0
kubectl -n netbox get pods
NAME READY STATUS RESTARTS AGE
netbox-8646cc495d-26zzt 0/1 CrashLoopBackOff 6 (2m8s ago) 11m
netbox-bb65d44c4-smp62 0/1 CrashLoopBackOff 6 (109s ago) 11m
netbox-postgresql-0 1/1 Running 0 90m
netbox-redis-master-dc9fd75bc-557j7 1/1 Running 0 28h
netbox-valkey-primary-0 1/1 Running 0 27h
netbox-valkey-replicas-0 1/1 Running 0 27h
netbox-valkey-replicas-1 1/1 Running 0 27h
netbox-valkey-replicas-2 1/1 Running 0 27h
netbox-worker-fc688bf99-f6jdb 0/1 CrashLoopBackOff 9 (2m36s ago) 23m
psql -h netbox-postgresql -U netbox -d netbox -c '\l'
List of databases
Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
netbox | netbox | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =Tc/netbox +
| | | | | | | | netbox=CTc/netbox
postgres | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | |
template0 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | libc | en_US.UTF-8 | en_US.UTF-8 | | | =c/postgres +
| | | | | | | | postgres=CTc/postgres
Beta Was this translation helpful? Give feedback.
All reactions