Discussion:
[Pgbouncer-general] "closing because: client unexpected eof" error in pgbouncer
Anshu Avinash
2016-07-11 14:48:14 UTC
Permalink
Hi

I've set up pgbouncer in transaction pool mode with default_pool_size as
20. I'm connecting to pgbouncer from my rake tasks and occasionally see
this error in pgbouncer log:
"closing because: client unexpected eof (age=3110)"

Corresponding error on the client side:

ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() could
not receive data from server: Connection timed out

Also this errors don't happen if I directly connect to postgres. Using
transaction pooling in pgbouncer and rails has created problems for people
in past. I followed this blog post:
https://gocardless.com/blog/the-troubleshooting-tales-issues-scaling-postgres-connections/
and upgraded my rails version to 4.2.5, but that doesn't fix this error.

Is this an issue at the client side or a config issue in pgbouncer?
Attaching my pgbouncer config file.

I have also asked this on stackoverflow:
http://stackoverflow.com/q/38294359/1843751
Any help in debugging this issue would be appreciated!
Greg Sabino Mullane
2016-07-30 15:45:36 UTC
Permalink
Post by Anshu Avinash
"closing because: client unexpected eof (age=3110)"
This means the client sent something unexpected to pgbouncer.
Post by Anshu Avinash
ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() could
not receive data from server: Connection timed out
PQconsumeInput is a pretty good indication that you are trying to use
(perhaps indirectly) LISTEN/NOTIFY, which is not allow in pgbouncer's
transaction mode. To use LISTEN/NOTIFY, you need to drop back to session
mode.
--
Greg Sabino Mullane ***@endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
Loading...