PgBouncer fail authentication for users defined in users section
Summary
When configuring the pgbouncer users section the authentication fails.
psql -h 35.242.170.167 -p 5432 -U kadaffy -d nutanix
Password for user kadaffy:
psql: error: ERROR: password authentication failed
with a cluster with pooling config having:
pgBouncer:
pgbouncer.ini:
pgbouncer:
pool_mode: session
max_client_conn: '2000'
default_pool_size: '200'
log_connections: '1'
log_disconnections: '1'
log_stats: '1'
databases:
mydb:
pool_size: 200
dbname: 'mydb'
reserve_pool: 5
users:
kadaffy:
pool_mode: transaction
max_user_connections: 20
custom configuration is not taken.
Current Behavior
Authentication fails for users defined in the users section.
Steps to reproduce
1- Create an SGCluster with a Pooling configuration like:
apiVersion: stackgres.io/v1
kind: SGPoolingConfig
metadata:
name: poolconfig
spec:
pgBouncer:
pgbouncer.ini:
pgbouncer:
pool_mode: session
max_client_conn: '2000'
default_pool_size: '200'
log_connections: '1'
log_disconnections: '1'
log_stats: '1'
databases:
mydb:
pool_size: 200
dbname: 'mydb'
reserve_pool: 5
users:
kadaffy:
pool_mode: transaction
max_user_connections: 20
2- Create the user in the database
3- try to authenticate with the user created.
Expected Behavior
User is correctly authenticated.
Possible Solution
The operator configure the auth_file
parameter in pgbouncer.ini.
The Pod controller generate auth_file
file from pg_shadow
for users in users section.
Environment
- StackGres version: 1.0.0-beta3
Edited by Matteo Melli