Redis: Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix <filename>
Redis can't load the AOF on startup because it's truncated or corrupted, so the server refuses to start.
Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix <filename>Unexpected end of file reading the append only fileBad file format reading the append only fileFatal error loading the AOFAOF loaded anyway because aof-load-truncated is enabled Meaning
Back up the file, then repair with redis-check-aof --fix appendonly.aof (for Redis 7 multi-part AOF use the manifest dir files). Truncation from a crash/disk-full is the usual cause; with aof-load-truncated yes Redis can start loading a truncated tail automatically. Verify disk space and hardware afterwards.
Common causes
- Crash or power loss during write
- Disk full while appending
- File truncated by copying/restoring
- Manual edit/corruption
- Different Redis version format
⚡ Quick fix
cp appendonly.aof appendonly.aof.bak && redis-check-aof --fix appendonly.aof- Enable
aof-load-truncated yes - Restore from RDB or replica if repair loses too much
Detailed fix by platform
Linux
redis-check-aof --fix /var/lib/redis/appendonlydir/appendonly.aof.1.incr.aof
How to diagnose
- File — Truncated?
- Disk — Was full?
- Backup — Taken?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- BullMQ: Missing lock for job / job stalled more than allowable limit BullMQ: Error: Missing lock for job 42. moveToFinished / job stalled more than allowable limit
- Can't save in background: fork: Cannot allocate memory Redis: # Can't save in background: fork: Cannot allocate memory / WARNING overcommit_memory is set to 0!
- Failed opening the temp RDB file / Permission denied writing dump.rdb Redis: # Failed opening the temp RDB file temp-1234.rdb (in server root dir /var/lib/redis) for saving: Permission denied
Most viewed in Redis
- READONLY You can't write against a read only replica Redis: READONLY You can't write against a read only replica
- OOM command not allowed Redis: OOM command not allowed when used memory > 'maxmemory'
- Celery with Redis: tasks run twice (visibility_timeout) Celery: Task executed twice / Restoring unacked messages — Redis broker visibility_timeout shorter than task ETA
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026