Bad file format reading the append only file / AOF corrupted Redis Origin: Data OSI layer 7 · Application Last updated 5 Nov 2026

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.

Exact message you may see 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
Seen on: Redis Linux

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

  1. cp appendonly.aof appendonly.aof.bak && redis-check-aof --fix appendonly.aof
  2. Enable aof-load-truncated yes
  3. Restore from RDB or replica if repair loses too much

Detailed fix by platform

Linux

  1. redis-check-aof --fix /var/lib/redis/appendonlydir/appendonly.aof.1.incr.aof

How to diagnose

  1. File — Truncated?
  2. Disk — Was full?
  3. 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:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

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 (Redis)BullMQ: Missing lock …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! (Redis)Can't save in backgro…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 (Redis)Failed opening the te…LOADING Redis is loading the dataset in memory — Redis: (error) LOADING Redis is loading the dataset in memory (Redis)LOADING Redis is load…MISCONF — Redis: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk (Redis)MISCONFRedis in Docker loses data on restart (no volume) — Docker: Redis data gone after container restart — dump.rdb not persisted to a volume (Redis)Redis in Docker loses…Redis::CannotConnectError (Sidekiq/Rails) — Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Ruby / Rails)Redis::CannotConnectE…Wrong signature trying to load DB from file / RDB checksum error — Redis: # Wrong signature trying to load DB from file / # Short read or OOM loading DB. Unrecoverable error, aborting now (Redis)Wrong signature tryin…Bad file …

Explore the map of this error Full error map →

🧠 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.