Fix: MISCONF Redis is configured to save RDB snapshots, but it’s currently unable to persist to disk
Redis blocks writes because its last background snapshot failed. Find the cause in the log (full disk, permissions, failed fork), fix it, run BGSAVE, and writes work again.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
Write commands such as SET or HSET fail with:
(error) MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
Reads still work. With RDB save points configured, the default stop-writes-on-bgsave-error yes makes Redis refuse writes after a background save fails, so you notice that data is no longer reaching disk. The error clears once a snapshot succeeds again.
Step 1: read the real reason
Check before you run this
- Runs with administrator rights. Make sure you understand every line.
redis-cli INFO persistence | grep -E 'rdb_last_bgsave_status|rdb_changes_since_last_save|rdb_last_bgsave_time_sec'
redis-cli CONFIG GET dir
redis-cli CONFIG GET dbfilename
sudo journalctl -u redis-server -n 100 --no-pager # or the logfile set in redis.conf
rdb_last_bgsave_status:err confirms the failed save. The log line written at the time of the failure names the cause. The service may be called redis-server, redis or valkey depending on the package; CONFIG GET logfile shows the log path if it is not the journal.
Step 2: fix the cause (most likely first)
- Disk full or quota reached. Check the filesystem that holds
dirwithdf -h /var/lib/redis(use yourdir). A snapshot needs room for a complete new file next to the old one before the rename. Free space or movedirto a larger volume. - Permissions. The Redis user must be able to create files in
dir:sudo -u redis touch /var/lib/redis/.write-test && sudo rm /var/lib/redis/.write-test. Fix ownership withchown redis:redison the directory. Check thatdirwas not changed at runtime withCONFIG SET dirto a path Redis cannot write; that is also a sign of an exposed, compromised instance. - The fork failed or the child was killed. RDB saving forks a child process. Under memory pressure the fork can fail (the log mentions fork or “Cannot allocate memory”), or the kernel OOM killer can end the child (
dmesg | grep -i oom). Give the host more free memory, setmaxmemorybelow the available RAM, and follow the overcommit advice Redis prints in its log at startup. - Read-only or failing disk. Kernel messages in
dmesgabout I/O errors or a filesystem remounted read-only mean the storage itself needs attention first.
Step 3: prove it works
redis-cli BGSAVE
sleep 5
redis-cli INFO persistence | grep rdb_last_bgsave_status # want: ok
redis-cli SET misconf:test ok EX 60
Once rdb_last_bgsave_status is ok, writes are accepted again without a restart.
The emergency switch, and why to be careful
Redis’s own knowledge base describes a workaround that lets writes through while the disk problem persists:
redis-cli CONFIG SET stop-writes-on-bgsave-error no
This does not fix anything: Redis keeps accepting writes it cannot save, and a restart or crash loses them. Use it only to keep a pure cache running, or for a short time while you fix the disk, and only with monitoring on rdb_last_bgsave_status. Set it back to yes afterwards. If the instance is only a cache and you never need its data after a restart, the cleaner choice is to disable snapshots entirely with save "".
AOF variant
With AOF enabled, a failing write to the append-only file produces a related error that starts with MISCONF Errors writing to the AOF file: followed by the system error. The causes and checks are the same: disk space, permissions and disk health, plus aof_last_write_status in INFO persistence.
Official documentation
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0237 Use Redis as a cache: TTLs, maxmemory and an eviction health report Set a memory limit and an eviction policy so Redis behaves like a cache, give keys TTLs, then run a bash report… Intermediate · Step by step · Linux, macOS Script Administration & persistence · Basics 15 Oct 2026
- 0238 Redis persistence and high availability: RDB, AOF, replicas and Sentinel Redis keeps data in memory and writes it to disk with RDB snapshots, an append-only file, or both. Replicas copy data to… Intermediate · Explains an idea · Linux Article Administration & persistence 15 Oct 2026
- 0239 Fix: (error) NOAUTH Authentication required. (and securing Redis with ACLs) Redis requires a login and your client sent a command without one. Pass the right user and password, and use the moment… Advanced · Fixes an error · Linux Article Administration & persistence · Security & access 15 Oct 2026
- 0259 Speed up a slow database query with a Redis cache: cache-aside in Python, measured and locked down Put Redis in front of a slow query in a small Python app: cache-aside reads, TTLs with jitter, invalidation on writes, an… Intermediate · Guided project · Linux Article Administration & persistence · Basics 15 Oct 2026
Repos in the wild
- Redis server source code (redis/redis) redis/redis The official repository of Redis Open Source: the in-memory data structure server, redis-cli, Sentinel and the example redis.conf. GitHub
- Valkey: open source key-value datastore (valkey-io/valkey) valkey-io/valkey Valkey is a BSD-licensed key-value data structure server, forked from Redis just before its 2024 license change and backed by the Linux Foundation. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +3,705 chars