I/O error
Production Risk
Critical: disk I/O errors can cause database files or WAL to be corrupted, leading to data loss.
SQLSTATE 58030 is raised when Postgres encounters an I/O error reading from or writing to the filesystem — typically a disk failure, full disk, or filesystem corruption. This is a serious error that may indicate hardware problems.
- 1Disk hardware failure causing read/write errors
- 2Filesystem corruption
- 3NFS or network storage disconnection causing I/O failures
- 4Operating system I/O error when accessing data files or WAL
Disk failure during a database write.
expected output
ERROR: could not read from file "pg_wal/0000000100000001": Input/output error
Fix 1
Check disk health with SMART diagnostics and repair or replace the disk
WHEN When 58030 is caused by hardware failure.
Why this works
Run smartctl or the storage vendor diagnostic tools to assess disk health. If errors are found, replace the disk and restore from backup.
Fix 2
Check available disk space
WHEN When the I/O error may be caused by a full disk.
SELECT pg_size_pretty(pg_database_size(current_database()));
Why this works
A full disk causes write failures. Free space or expand storage, then investigate why disk usage grew unexpectedly.
✕ Continue running Postgres on a disk showing I/O errors
I/O errors indicate storage hardware problems; continuing risks data corruption.
Class 58 — System Error
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev