Prometheus logs `opening storage failed: ... unexpected EOF` / `corruption in segment` and won't start
AdvancedTroubleshootingPrometheus storage, memory and cardinality
Answer
Likely causes → WAL corruption after an unclean shutdown, node crash, full disk, or a storage layer that does not honour fsync (NFS).
Diagnose →
kubectl logs prometheus-k8s-0 -c prometheus --previous | grep -i 'wal\|corrupt'
ls -la /prometheus/wal/
df -h /prometheus
Fix → Recent versions attempt WAL repair automatically and truncate at the corrupt record. If it still fails, back up the directory, then move the bad segment(s) out of wal/ (you lose recent un-compacted samples, up to ~2h) and restart.
Prevent → Use local SSD or block volumes (EBS), never NFS; keep disk headroom; give pods a long terminationGracePeriodSeconds so the WAL closes cleanly.
More on Prometheus storage, memory and cardinality
Prometheus pod restarts with `OOMKilled` every few hoursIntermediateA query fails with `query processing would load too many samples into memory in query execution`IntermediateHead series jumped from 2M to 9M after a deployAdvancedPrometheus is in CrashLoopBackOff with `no space left on device`BeginnerPrometheus takes 15 minutes to become ready after a restartAdvancedPrometheus is killed by the liveness probe during startup in a loopIntermediate