It happens to all the sessions I have to all the databases. In other words, different apps are connected to different databases but I still keep getting those errors. I queried pg_shadow and I didnt see that a specific user has a different client_encoding configured. Moreover, the client_encoding is set to default in postgresql.conf.
What else can I check ? I'm trying to check the if the problem is in the pool as tatsuo suggested but is there anything else that I can check ?