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
의미
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.
일반적인 원인
- 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_status | ok or err; err is what activates the write stop. |
|---|---|
| aof_last_write_status | ok or err for the append-only side; the AOF variant of MISCONF names it. |
| rdb_changes_since_last_save | How much data exists only in memory right now. |
| stop-writes-on-bgsave-error | The 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. |
해결 방법
-
Read the exact persistence state; the status fields say which side failed:
INFO persistence # rdb_last_bgsave_status, aof_last_write_status
-
Check the disk and the directory Redis saves into:
CONFIG GET dir CONFIG GET dbfilename CONFIG GET appendonly df -h
-
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.
안전하게 재현하세요
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
질문
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.
관련 오류
SQLITE_IOERRSQLite: 디스크 I/O 오류58P01PostgreSQL: undefined fileSQLITE_READONLYSQLite: 읽기 전용 데이터베이스에 쓰기 시도
More memory and persistence errors
코드와 메시지 텍스트의 출처는 다음과 같습니다 Redis documentation and source code. 전체 목록은 Redis error list 또는 모든 데이터베이스 오류 검색.
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.
이 페이지의 텍스트와 데이터: CC BY 4.0, 출처: SQLly (sqlly.app). 코드와 SQL 스니펫: MIT. 라이선스 세부 정보 인용된 오류 메시지 텍스트의 권리는 해당 데이터베이스 공급업체에 있습니다.