Diagnostic Queries
Symptoms
An SSL/TLS connection failed at the system-call level with an unexpected EOF — the peer closed the socket without a clean TLS shutdown. The driver reports SQLSTATE 08006 (connection_failure).
- The TLS socket hit EOF unexpectedly.
- Often a backend crash or a middlebox resetting the connection.
- Distinct from a TLS negotiation failure.
What the server log shows
ERROR: SSL SYSCALL error: EOF detected
Why PostgreSQL raises this — what the manual says
As Section 18.9 Secure TCP/IP Connections with SSL explains:
The TLS layer hit an end-of-file at the system-call level, meaning the underlying TCP connection was closed before the SSL session ended cleanly — usually a crashed backend, a firewall reset, or an abrupt network interruption.
An EOF detected SSL SYSCALL error means the TCP socket carrying the TLS session was closed abruptly (no close-notify). The encrypted session cannot continue, so the client reports 08006.
Common causes
- A backend crash/termination on the encrypted session.
- A firewall/load balancer resetting the connection.
- Network instability dropping the TLS socket.
How to fix it
- Reconnect and retry; handle dropped encrypted connections gracefully.
- Check the server log for backend crashes/terminations.
- Investigate network devices and idle/keepalive settings.
Related & next steps
Reference: PostgreSQL 18 Section 19.9 “SSL”.
Thanks — noted. This helps keep the database accurate.