If you’ve just setup PgBouncer, and you’re getting errors such as `closing because: No such user: *****` , especially if you’ve installed on CentOS the problem may be simple.
First. verify that you can actually log in into the PostgreSQL directly using the same username and password. Once confirmed, it’s time to check your file permissions. If you’re use PgBouncer, you’re probably using a user list, specified by `auth_file` in the `pgbouncer.ini` file. You need to ensure that that file is readable by the same user that the PgBouncer process runs as. If you’ve installed via yum on CentOS, that would be the aptly named `pgbouncer` user.
Solving the problem is then as simple as:
chown pgbouncer:pgbouncer /etc/pgbouncer/userlist.txt