How to resolve 'unexpected end of file' error in RisingWave frontend node logs?
I'm seeing a recurring error in the RisingWave frontend node logs that says ERROR pgwire::pg_server: error when reading message error=unexpected end of file
. This error appears without any user interaction after restarting the frontend node. Here's an excerpt from the logs:
2023-12-20T13:14:19.151077104Z ERROR pgwire::pg_server: error when reading message error=unexpected end of file
2023-12-20T13:14:19.151250708Z ERROR pgwire::pg_server: error when reading message error=unexpected end of file
The ports mentioned in the logs keep changing, and it doesn't seem to cause any issues, but it's mostly annoying. Any idea what might be causing this and how to resolve it?
André Falk
Asked on Dec 20, 2023
The 'unexpected end of file' error messages are likely caused by health checks or other clients that connect to the frontend and then disconnect without sending any data. This can happen if there's a firewall, load balancer, or proxy with a session timeout, or a session timeout configured on the database. To resolve this, you can change the health check in your docker-compose.yaml
to use psql
instead of a simple TCP connection. Here's an example of how to modify the health check:
test:
[
"CMD",
"psql",
"-h",
"localhost",
"-p",
"4566",
"-c",
"select 1",
"-d",
"dev",
]
This change will prevent the health check from causing 'unexpected end of file' errors. Additionally, it's worth noting that this issue will be fixed in RisingWave version 1.6 according to a GitHub pull request.