Skip to content

Log server error when issuing auth query#1187

Merged
JelteF merged 7 commits intopgbouncer:masterfrom
greg-rychlewski:log_auth_query_server_error
Dec 2, 2024
Merged

Log server error when issuing auth query#1187
JelteF merged 7 commits intopgbouncer:masterfrom
greg-rychlewski:log_auth_query_server_error

Conversation

@greg-rychlewski
Copy link
Copy Markdown
Contributor

@greg-rychlewski greg-rychlewski commented Oct 20, 2024

Closes #954

This is my attempt to log the error message from auth queries coming from Postgres.

I tried to follow what happens here: https://github.com/pgbouncer/pgbouncer/blob/master/src/server.c#L151. When receiving an error packet they call log_server_error before disconnect_server and the former's note has S: prepended to it. I am guessing that is to distinguish it as a note coming from the server rather than something generated from pgbouncer.

Copy link
Copy Markdown
Member

@JelteF JelteF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change, it looks good but needs a small rebase.

@greg-rychlewski
Copy link
Copy Markdown
Contributor Author

@JelteF Thanks for the review. The windows error looks to be something affecting all the recent PRs and unrelated to this change.

It might be related to the image used. I could probably spare some time to see if I can fix this in a separate PR.

@JelteF JelteF merged commit 1d43b0c into pgbouncer:master Dec 2, 2024
@JelteF
Copy link
Copy Markdown
Member

JelteF commented Dec 2, 2024

If you have time to fix the Windows build in another PR that would be greatly appreciated.

@greg-rychlewski greg-rychlewski deleted the log_auth_query_server_error branch December 3, 2024 04:24
rajaryanece pushed a commit to rajaryanece/pgbouncer that referenced this pull request Jan 16, 2025
This is inspired by what happens here:
https://github.com/pgbouncer/pgbouncer/blob/master/src/server.c#L151.
When receiving an error packet they call `log_server_error` before
`disconnect_server` and the former's note has `S:` prepended to it. I am
guessing that is to distinguish it as a note coming from the server
rather than something generated from pgbouncer.

Fixes pgbouncer#954
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting 'E' packet on "auth_conn query" instantly

2 participants