Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 'E' packet on "auth_conn query" instantly #954

Open
ylacancellera opened this issue Oct 3, 2023 · 3 comments
Open

Getting 'E' packet on "auth_conn query" instantly #954

ylacancellera opened this issue Oct 3, 2023 · 3 comments
Assignees
Labels
good-first-issue Good issue for new contributors to pick up usability-improvement

Comments

@ylacancellera
Copy link

ylacancellera commented Oct 3, 2023

Hi

I currently have a repeatable issue where users can connect to every db, except one (with appropriate pg privileges).
Users are able to connect to other databases and switch between them with \c, but not to the "broken" one.

I notice I have a "error response from auth_query", I tried debugging it:

2023-10-03 06:47:02.635 UTC [7] NOISE C-0x561ead097b10: some_user/(nouser)@<client_ip>:<client_port> doing auth_conn query
2023-10-03 06:47:02.635 UTC [7] DEBUG pktbuf_dynamic(512): 0x561ead0a24a0
2023-10-03 06:47:02.635 UTC [7] NOISE tls_write: req=108 out=108
2023-10-03 06:47:02.635 UTC [7] DEBUG pktbuf_free(0x561ead0a24a0)
2023-10-03 06:47:02.635 UTC [7] NOISE resync(10): done=0, parse=0, recv=0
2023-10-03 06:47:02.635 UTC [7] NOISE tls_read: req=4096 out=103
2023-10-03 06:47:02.635 UTC [7] NOISE S-0x561ead0a83f0: some_user/_pgbouncer@<pg_ip>:5432 read pkt='E', len=103
2023-10-03 06:47:02.635 UTC [7] LOG S-0x561ead0a83f0: some_user/_pgbouncer@<pg_ip>:5432 closing because: error response from auth_query (age=0s)
2023-10-03 06:47:02.635 UTC [7] LOG C-0x561ead097b10: some_user/(nouser)@<client_ip>:<client_port> closing because: bouncer config error (age=0s)
2023-10-03 06:47:02.635 UTC [7] WARNING C-0x561ead097b10: some_user/(nouser)@<client_ip>:<client_port> pooler error: bouncer config error

I have some questions regarding it:

  • is it possible something else than postgres is answering this "E" packet ? (a pgbouncer cache, anything)
  • is it weird taht everything is instantaneous here ? It is not on successful logins
  • could that be a pg_catalog issue somehow ?
  • anything particular logging you would advise on postgres side to dive further ?
@ylacancellera
Copy link
Author

ylacancellera commented Oct 5, 2023

Found it.
It was a permission issue on pgbouncer schema. The error is obfuscated unfortunately, it would be really nice to display it as pgbounceruser was getting a proper "permission denied" when trying to use select * from pgbouncer.get_auth(x) directly
EDIT: just to make it clear, "end" users had the correct permissions, only pgbouncer user lacked privileges for some reason

@JelteF
Copy link
Member

JelteF commented Oct 5, 2023

Hmm, that indeed sounds annoying to debug. We should log the error provided by postgres instead of saying only "error response from auth_query". If you want to contribute a PR for that it's very much appreciated. I think it would be a good first contribution.

@JelteF JelteF added good-first-issue Good issue for new contributors to pick up usability-improvement labels Oct 5, 2023
@ylacancellera
Copy link
Author

Why not actually, it would be fun, I will try over the next days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good issue for new contributors to pick up usability-improvement
Projects
None yet
Development

No branches or pull requests

2 participants