Hi all -
I'll file this as an issue (bug) if i'm not doing something obviously wrong, but wanted to send here first... also to get my feet wet around here :)
thank you!
- PK
**Describe the bug**
unable to connect to postgres db via pgbouncer
this occurs both if pgbouncer added to an existing db cluster, or if added later.
i am unable to connect with testuser (as in the documentation), a newly provisioned user, or the postgres superuser.
**To Reproduce**
Steps to reproduce the behavior:
A. adding pgbouncer to an existing cluster
1. create database cluster
pgo create cluster profig-pgo
# confirm database is running
pgo test profig-pgo
2. create pgbouncer
pgo create pgbouncer profig-pgo
# confirm pgbouncer service is available
kubectl -n pgo get svc
# and we see profig-pgo-pgbouncer with port 5432 exposed
3. further validate that pgbouncer works by connecting to it
pgo show pgbouncer profig-pgo
PGPASSWORD=<excised> psql -h localhost -p 5432 -U pgbouncer pgbouncer
# get to a psql prompot on pgbouncer
4. retrieve testuser password
kubectl -n pgo port-forward svc/postgres-operator 8443:8443
pgo show user -n pgo testuser --show-system-accounts
5. demonstrate we can connect directly to database
kubectl -n pgo port-forward svc/profig-pgo 5432:5432
PGPASSWORD="<excised>>" psql -h localhost -p 5432 -U testuser profig-pgo
# get psql promppt
6. attempt to connect via pgbouncer
kubectl -n pgo port-forward svc/profig-pgo-pgbouncer 5432:5432
PGPASSWORD="<excised>>" psql -h localhost -p 5432 -U testuser profig-pgo
# error as detailed below
B. pgbouncer provisioned with cluster
1. pgo create cluster profig-pgo --pgbouncer
# confirm database is running
pgo test profig-pgo
# confirm pgbouncer service is available
kubectl -n pgo get svc
# and we see profig-pgo-pgbouncer with port 5432 exposed
THEN: follow steps 3-6 under A above.
Notes:
User details
---
I show both above using the testuser as per the documentation here:
connecting using a newly provisioned user or with Postgres user is done similarly.
let me know if you want steps i took here detailed.
to create the new user:
pgo create user --selector=name=profig-pgo --username "profig"
**Expected behavior**
connect through pgbouncer to postgres database and get a psql prompt
**Actual behavior**
response:
psql: error: ERROR: query_wait_timeout
checking the pgbouncer pod logs:
2021-02-12 00:32:49.359 UTC [13] WARNING DNS lookup failed: profig: result=0
2021-02-12 00:32:49.359 UTC [13] LOG S-0x56208c5b9970: profig/pgbouncer@(bad-af):0 closing because: server DNS lookup failed (age=0s)
2021-02-12 00:33:04.357 UTC [13] LOG S-0x56208c5b9970: profig/pgbouncer@(bad-af):0 closing because: server DNS lookup failed (age=0s)
2021-02-12 00:33:04.357 UTC [13] LOG S-0x56208c5b9970: profig/pgbouncer@(bad-af):0 closing because: server DNS lookup failed (age=0s)
2021-02-12 00:33:04.357 UTC [13] LOG S-0x56208c5b9970: profig/pgbouncer@(bad-af):0 closing because: server DNS lookup failed (age=0s)
2021-02-12 00:33:18.023 UTC [13] LOG C-0x56208c5b2bf0: profig/(nouser)@
127.0.0.1:46354 closing because: query_wait_timeout (age=120s)
2021-02-12 00:33:18.023 UTC [13] WARNING C-0x56208c5b2bf0: profig/(nouser)@
127.0.0.1:46354 pooler error: query_wait_timeout
2021-02-12 00:33:18.023 UTC [13] LOG C-0x56208c5b2bf0: profig/(nouser)@
127.0.0.1:46354 closing because: query_wait_timeout (age=120s)
2021-02-12 00:33:18.023 UTC [13] WARNING C-0x56208c5b2bf0: profig/(nouser)@
127.0.0.1:46354 pooler error: query_wait_timeout
**Screenshots**
n/a
**Please tell us about your environment:**
* Operating System: Amazon Linux 2
* Where is this running ( Local, Cloud Provider): Amazon EKS
* Storage being used (NFS, Hostpath, Gluster, etc): EBS
* PGO Version: 4.6.0
* PostgreSQL Version: 13.1
* Platform (Docker, Kubernetes, OpenShift): Kubernetes
* Platform Version: 1.18
**Additional context**
n/a