You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using pgbouncer 1.20.1 on Ubuntu 22.04 via the PGDG apt repo. The PG instance is PG 15, the DB name is hyphenated (eg "this-is-my-db"). I had a misconfig in the pgbouncer ini file where the hyphens were replaced with underscores in the DB name entry, but not in the actual connection.
When I would try to connect to the database (using the hyphenated name) via psql from my workstation through the pgbouncer, it would fail (as you'd expect), but the error it would give me is no such user, a la:
2023-11-28 20:26:37.397 UTC [14907] LOG C-0x56384fed3ea0: (nodb)/(nouser)@10.23.34.56:54596 no such user: this-is-my-db
In my case the username I was attempting to log in with was the same as the DB name. I can set up a test with a name that is unique.
It took me a long time to catch the underscores vs hyphens thing so basically I'm wondering if this is a mistake in the error message. I can try whip up a concrete test case later tonight.
The text was updated successfully, but these errors were encountered:
Yeah I can duplicate when I login with a completely fake DB name that it is referring to the user name I give it on the psql command-line. On the client end I just see FATAL: password authentication failed, in the pgbouncer log I see the failed login attempt with no such user.
Maybe the (nodb) part of the log message should be the hint I need that something was wrong with the DB name? I'm basically just asking if we can make this error more clear/obvious for smooth-brained folks like myself.
$ psql -U xpto1 -d xpto2
psql: error: connection to server on socket "/tmp/.s.PGSQL.9916" failed: FATAL: role "xpto1" does not exist
It uses the same pattern as Postgres. It checks the role before the database. Provide additional information for the login is not recommended for security reasons.
For security reasons I can see returning that error to the client attempting the connection. But in the pgbouncer log would it be possible to note that client attempted a connection to a non-existent database?
Using pgbouncer 1.20.1 on Ubuntu 22.04 via the PGDG apt repo. The PG instance is PG 15, the DB name is hyphenated (eg "this-is-my-db"). I had a misconfig in the pgbouncer ini file where the hyphens were replaced with underscores in the DB name entry, but not in the actual connection.
So the ini entry would be something like:
When I would try to connect to the database (using the hyphenated name) via psql from my workstation through the pgbouncer, it would fail (as you'd expect), but the error it would give me is
no such user
, a la:In my case the username I was attempting to log in with was the same as the DB name. I can set up a test with a name that is unique.
It took me a long time to catch the underscores vs hyphens thing so basically I'm wondering if this is a mistake in the error message. I can try whip up a concrete test case later tonight.
The text was updated successfully, but these errors were encountered: