unable to connect to pgpool host ERROR: failed to authenticate with backend using SCRAM
Name and Version
bitnami/pgpool4
What steps will reproduce the bug?
using provided docker-compose.yml as is (no changes), I was able to get a network up and running in docker with 2 postgres containers (a primary and a standby) and a pgpool container. The postgres replication appears to be running correctly (the data from the primary is getting replicated onto the standby and I'm able to write to the primary but not to the standby), but when I try to log into the pool (I'm doing so from the terminal on the pgpool container using command: psql -d customdatabase -U customuser -h pgpool), I get the below error:
error: connection to server at "pgpool" (192.168.0.2), port 5432 failed: ERROR: failed to authenticate with backend using SCRAM
DETAIL: valid password not found
I'm unsure if I'm not using the correct command to make the connection or if there is another issue.
What is the expected behavior?
I'm expecting command: psql -d customdatabase -U customuser -h pgpool to make a connection to the pool and allow me to run psql statements that it directs to the appropriate postgres instance.
What do you see instead?
the command: psql -d customdatabase -U customuser -h pgpool generates the below error:
error: connection to server at "pgpool" (192.168.0.2), port 5432 failed: ERROR: failed to authenticate with backend using SCRAM
DETAIL: valid password not found
Additional information
When I do a google search, it appears there may have been a similar issue submitted to the bitnami-docker-pool repo https://github.com/bitnami/bitnami-docker-pgpool/issues/68, but that repo doesn't seem to exist anymore so I can't see the response to that issue. I'm very new to this so I may be doing something wrong.
running show pool_nodes results in the below:
postgres=# show pool_nodes;
node_id | hostname | port | status | pg_status | lb_weight | role | pg_role | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change
---------+----------+------+--------+-----------+-----------+---------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------
0 | pg-0 | 5432 | up | up | 0.500000 | primary | primary | 0 | true | 0
| | | 2023-01-13 19:56:08
1 | pg-1 | 5432 | up | up | 0.500000 | standby | standby | 0 | false | 0
| | | 2023-01-13 19:56:18
(2 rows)
I have the same issue...
If I execute the following command in the pgpool container then the connection via pgpool seems to work:
echo "customuser:TEXTcustompassword">> /opt/bitnami/pgpool/conf/pool_passwd
Hi @jenremgit,
We were able to reproduce the issue. A task has been created in order to review it.
As @esanya , a workaround would be adding the user to the /opt/bitnami/pgpool/conf/pool_passwd file (Upstream docs)
We will update any advances here.
Regards
That workaround did work for me. Thank you, @esanya and @dgomezleon!
Hello @jenremgit,, The bug has been fixed in this PR: https://github.com/bitnami/containers/pull/22490/files. We have modified the docker-compose structure since, mainly, the SR_CHECK_USER user is only intended to check that streaming replication is working and typically its value is the repmgr user. So now, the customuser can be used for its expected usage and not for replication.