SQLSTATE 58030 ERROR Class 58: System Error

io_error could not fsync file “…”: Input/output error — 58030

PostgreSQL error "could not fsync file "…": Input/output error" (SQLSTATE 58030): what it means, common causes, and how to fix it.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Diagnostic Queries

Symptoms

PostgreSQL tried to flush a file to disk with fsync() and the operating system returned an I/O error. PostgreSQL raises SQLSTATE 58030 (io_error) and this often triggers a PANIC.

  • The OS reported a hardware/filesystem I/O failure on fsync.
  • Strongly suggests failing storage or a full/broken volume.
  • May cause the server to PANIC and restart.

What the server log shows

PANIC:  could not fsync file "base/16384/24576": Input/output error

Why PostgreSQL raises this — what the manual says

As Section 28.6 WAL Internals explains:

The server could not flush a file to durable storage because the underlying device returned an I/O error; since WAL and data files depend on successful fsync for crash safety, PostgreSQL treats a failed flush as fatal rather than risk silent data loss.

An Input/output error from fsync() means the storage layer could not durably persist data. Because durability is no longer guaranteed, PostgreSQL reports 58030 and frequently PANICs to avoid corruption.

Common causes

  • Failing disk, controller, or storage backend.
  • A filesystem error or a volume that went read-only/offline.
  • Network storage (NFS/SAN) dropping I/O.

How to fix it

  1. Investigate hardware and OS logs (dmesg, SMART) for disk failures immediately.
  2. Restore from backup if files are damaged; do not ignore the error.
  3. Move to healthy storage; verify the volume is writable and durable.

Related & next steps

Reference: PostgreSQL 18 Section 30.5 “WAL Internals”.

Was this helpful?