Ghoul
Ghoul

Reputation: 149

PgPool-II backend authentication failed

I'm trying to configure pgpool as the load balancer for my Postgres cluster. I have two postgres nodes, 1 master and 1 slave.

My pg_hba.conf looks like

hostssl  user  mydb  1.1.1.1/32  md5
hostssl  user  postgres 1.1.1.1/32  md5
host     user  mydb  1.1.1.1/32  md5
host     user  postgres 1.1.1.1/32  md5

where 1.1.1.1/32 is my actual pgpool server IP.

If I try to establish a connection to ether master or slave using psql right from the pgpool container, I can do it without any problems. But when I start pgpool I got this error message:

2021-10-26 13:50:13: pid 753: ERROR:  backend authentication failed
2021-10-26 13:50:13: pid 753: DETAIL:  backend response with kind 'E' when expecting 'R'
2021-10-26 13:50:13: pid 753: HINT:  This issue can be caused by version mismatch (current version 3)
2021-10-26 13:50:13: pid 736: ERROR:  backend authentication failed
2021-10-26 13:50:13: pid 736: DETAIL:  backend response with kind 'E' when expecting 'R'
2021-10-26 13:50:13: pid 736: HINT:  This issue can be caused by version mismatch (current version 2)

If I edit pool_passwd file and set some invalid password I got a proper error


2021-10-26 13:59:03: pid 736: ERROR:  md5 authentication failed
2021-10-26 13:59:03: pid 736: DETAIL:  password does not match

So I guess that's not a problem with my postgres credentials.

Any ideas?

Upvotes: 3

Views: 2937

Answers (1)

Vincent Gerris
Vincent Gerris

Reputation: 7537

Late to the party, but you probably didn't generate a password file with the pg_md5 command that is the same as the password of your database user.

More info is in the docs: https://www.pgpool.net/docs/42/en/html/auth-methods.html

So you need to have something like user:md5password in the file and a user in postgres called user and password password.

With Scram-sha-256 you need an additional key file that both pgpool and postgres need to read.

Upvotes: 0

Related Questions