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
- Investigate hardware and OS logs (dmesg, SMART) for disk failures immediately.
- Restore from backup if files are damaged; do not ignore the error.
- Move to healthy storage; verify the volume is writable and durable.
Related & next steps
Reference: PostgreSQL 18 Section 30.5 “WAL Internals”.
Thanks — noted. This helps keep the database accurate.