// Redis error reference

MISCONF: Persistence is failing, writes stopped

Redis can't write its snapshot or AOF to disk. With RDB on, stop-writes-on-bgsave-error refuses writes to avoid silent data loss; a broken AOF refuses writes regardless.

Error prefix
MISCONF
Catégorie
Memory and persistence
Message d'erreur
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.

Ce que cela signifie

MISCONF is Redis protecting durability. A background save failed (full disk, missing permissions, a dying volume) or the AOF is unwritable, and because stop-writes-on-bgsave-error defaults to yes, every command that could modify data is refused until persistence works again. Reads continue, which is what makes this error confusing: the server looks healthy and only writes fail.

The AOF variant reads MISCONF Errors writing to the AOF file: ... and names the reason. Both variants mean the same thing: Redis is telling you its durability promise is broken, not that your command is wrong. The fix is almost always on the disk: space, permissions, or the dir and dbfilename configuration.

Causes courantes

  • The disk holding the snapshot or AOF is full or has gone read-only.
  • The user Redis runs as lacks write permission on dir, which is common after moving the data directory.
  • The background-save child keeps failing, for instance on a host too loaded to fork, and the last save stays in error state.

Find the cause

INFO persistence
# rdb_last_bgsave_status:err stops writes only while save points are set (CONFIG GET save is not empty) and stop-writes-on-bgsave-error is yes; aof_last_write_status:err stops writes whatever those settings are
CONFIG GET dir
CONFIG GET stop-writes-on-bgsave-error
# Space and permissions in the actual save directory:
df -h
ls -la <dir-from-CONFIG-GET>

Persistence status fields to check

rdb_last_bgsave_statusok or err; err is what activates the write stop.
aof_last_write_statusok or err for the append-only side; the AOF variant of MISCONF names it.
rdb_changes_since_last_saveHow much data exists only in memory right now.
stop-writes-on-bgsave-errorThe switch that turns a failed RDB save into refused writes, only while save points are set; yes by default. It does not affect AOF write errors.

Comment le corriger

  1. Read the exact persistence state; the status fields say which side failed:

    INFO persistence
    # rdb_last_bgsave_status, aof_last_write_status
  2. Check the disk and the directory Redis saves into:

    CONFIG GET dir
    CONFIG GET dbfilename
    CONFIG GET appendonly
    df -h
  3. Clear the cause, then force a save; writes resume once the status is ok:

    BGSAVE
    INFO persistence | grep rdb_last_bgsave_status

Other ways to handle it

If this instance is a cache backed by another system of record, stop-writes-on-bgsave-error no removes the RDB write stop, accepting that a crash may lose the unsaved slice; it does not clear an AOF write error: a documented trade rather than an accident. Monitoring rdb_last_bgsave_status turns the problem into an ops alert instead of user-visible errors.

Reproduisez-le en toute sécurité

Run against a scratch instance: the directory is made unwritable on purpose so the background save fails the way it does on a full disk.

mkdir -p /private/tmp/redis-nowrite && chmod 000 /private/tmp/redis-nowrite
redis-server --port 7307 --save '' &
redis-cli -p 7307 CONFIG SET dir /private/tmp/redis-nowrite
redis-cli -p 7307 CONFIG SET save '1 1'
redis-cli -p 7307 SET x 1
# after about a second, once the failing save is recorded:
redis-cli -p 7307 SET y 2
# (error) MISCONF Redis is configured to save RDB snapshots, ...
chmod 755 /private/tmp/redis-nowrite && redis-cli -p 7307 BGSAVE   # heals the status

Questions

Why are reads fine while writes fail?

The write stop is deliberate: Redis refuses to take writes it may not be able to save, while continuing to serve the data it already has.

I do not need persistence. Can I ignore MISCONF?

Turn persistence off properly (an empty save directive and appendonly no) instead of leaving a broken saver plus stop-writes-on-bgsave-error no. Then the state cannot surprise you later.

Erreurs liées

More memory and persistence errors

Le code et le texte du message sont issus de Redis documentation and source code. Parcourir la liste complète Redis error list ou Rechercher toutes les erreurs de base de données.

// moins d'erreurs, corrections plus rapides

Work on Redis in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Redis and the other databases you use.

Texte et données de cette page : CC BY 4.0, en citant SQLly (sqlly.app). Code et extraits SQL : MIT. Détails de la licence Le texte des messages d’erreur cité appartient à l’éditeur de la base de données.