SQLSTATE 08006 FATAL Class 08: Connection Exception

connection_failure SSL SYSCALL error: EOF detected — 08006

PostgreSQL error “SSL SYSCALL error: EOF detected — 08006” (SQLSTATE 08006): what it means, common causes, and how to fix it.

PG 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

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

  1. Reconnect and retry; handle dropped encrypted connections gracefully.
  2. Check the server log for backend crashes/terminations.
  3. Investigate network devices and idle/keepalive settings.

Related & next steps

Reference: PostgreSQL 18 Section 19.9 “SSL”.

Was this helpful?