# Configuring pgpool-II 4.4 but pcp\_recovery\_node can't connect

**URL:** <https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663>\
**Category:** PostgreSQL\
**Created:** [January 17, 2023, 3:06pm UTC](https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663 "2023-01-17T15:06:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![possebon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/possebon/32/9033_2.png) [@possebon](https://forums.percona.com/u/possebon)\
**Post date:** [January 17, 2023, 3:06pm UTC](https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663/1 "2023-01-17T15:06:27Z")

</div>

Hi everyone,

I followed this documentation [https://www.pgpool.net/docs/44/en/html/example-cluster.html](https://www.pgpool.net/docs/44/en/html/example-cluster.html) to setup pgpool in my PostgreSQL cluster.

Everything seems to be working as expected, at least the virtual IP is being delegated to the master node after I started the pgpool.

When I try to execute this step:

```auto
 pcp_recovery_node -h 172.28.0.224 -p 9898 -U pgpool -n 1

```

I’m getting this error message:

```auto
FATAL: authentication failed for user "pgpool"
DETAIL: username and/or password does not match

```

This is my pool\_hba.conf

```auto
# IPv4 local connections:
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all pgpool 0.0.0.0/0 scram-sha-256
host all postgres 0.0.0.0/0 scram-sha-256

```

This is my pg\_hba.conf

```auto
# IPv4 local connections:
host all all 127.0.0.1/32 ident
host	all postgres	0.0.0.0/0 scram-sha-256
host	all all 0.0.0.0/0 md5

# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 ident
host replication all ::1/128 ident
host	replication	repl 172.28.0.225/32 scram-sha-256
host	replication	repl 172.28.0.226/32 scram-sha-256

```

And have configured pcp.conf and pool\_passwd

```auto
drwxr-xr-x. 3 root root 4096 jan 16 23:47 .
drwxr-xr-x. 82 root root 4096 jan 16 23:16 ..
-rwxr-xr-x. 1 postgres postgres 638 jan 16 23:26 escalation.sh
-rwxr-xr-x. 1 postgres postgres 2772 jan 16 22:59 failover.sh
-rwxr-xr-x. 1 postgres postgres 6974 jan 16 23:01 follow_primary.sh
-rw-------. 1 postgres postgres 898 jan 16 23:02 pcp.conf
-rw-------. 1 postgres postgres 858 dez 22 11:03 pcp.conf.sample
-rw-------. 1 postgres postgres 53183 jan 16 23:47 pgpool.conf
-rw-------. 1 postgres postgres 52964 dez 22 11:03 pgpool.conf.sample
-rw-------. 1 postgres postgres 3 jan 16 22:45 pgpool_node_id
-rw-------. 1 postgres postgres 3617 jan 16 23:11 pool_hba.conf
-rw-------. 1 postgres postgres 3476 dez 22 11:03 pool_hba.conf.sample
-rw-------. 1 postgres postgres 92 jan 16 23:13 pool_passwd
drwxr-xr-x. 2 root root 4096 jan 16 22:11 sample_scripts

```

Any clues?

Best regards,

possebon

---

<div class="post-metadata">

**Author:** ![muhammad.usama](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@muhammad.usama](https://forums.percona.com/u/muhammad.usama)\
**Post date:** [January 17, 2023, 6:10pm UTC](https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663/2 "2023-01-17T18:10:29Z")

</div>

> [@possebon](#):
>
> `authentication failed for user `

The error suggests that the PCP user/password is not correct. Other than providing the wrong user/password combination, this could happen when “pcp.conf” file does not contain the ‘user: password’ in the correct format (see [Configuring pcp.conf](https://www.pgpool.net/docs/44/en/html/configuring-pcp-conf.html) for details) or pcp.conf file is not picked up by pgpool. Note: you can also provide the pcp.conf to pgpool using ‘–pcp-file’ or -F command line arguments.

Regards  
Muhammad Usama

---

<div class="post-metadata">

**Author:** ![possebon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/possebon/32/9033_2.png) [@possebon](https://forums.percona.com/u/possebon)\
**Post date:** [January 17, 2023, 9:27pm UTC](https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663/3 "2023-01-17T21:27:16Z")

</div>

Hi Muhammad, thanks for your reply.

I checked the pcp.conf and it has the user and the password on it. One thing that sounds strange to me is that I set the password of pgpool with scram-sha-256 (as documentation) and on pcp.conf it’s a MD5 hash of password.

Regards,

Fernando Possebon

---

<div class="post-metadata">

**Author:** ![muhammad.usama](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@muhammad.usama](https://forums.percona.com/u/muhammad.usama)\
**Post date:** [January 18, 2023, 6:43am UTC](https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663/4 "2023-01-18T06:43:29Z")

</div>

Scram only works for PG connections `(between Client <-> pgpool and pgpool <-> PostgreSQL),` while PCP only supports `md5` authentication. PCP users differ from PostgreSQL users and don’t need to be created in the PG database. The ‘username: password’ for PCP only needs to be listed in `pcp.conf`, and that doesn’t require any configuration in pool\_hba, pg\_hba, or pool\_passwd files

---

<div class="post-metadata">

**Author:** ![usman\_khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/usman_khan/32/16341_2.png) [@usman\_khan](https://forums.percona.com/u/usman_khan)\
**Post date:** [May 8, 2024, 6:49pm UTC](https://forums.percona.com/t/configuring-pgpool-ii-4-4-but-pcp-recovery-node-cant-connect/19663/5 "2024-05-08T18:49:54Z")

</div>

Hi @possebon  
Try to change authentication to trust in hba file.
