Redis is configured to save RDB snapshots but is unable to persist on disk
Production Risk
High. This error halts all write operations, effectively making the database read-only and potentially causing cascading failures in applications.
This critical error indicates that Redis is configured to take RDB snapshots but the last attempt to save to disk failed. To prevent data loss divergence, Redis blocks all write commands until the issue is resolved.
- 1Insufficient disk space on the volume where the RDB file is saved.
- 2Incorrect file permissions; the Redis process does not have write access to its working directory or the RDB file.
- 3A hardware fault with the underlying storage.
- 4The Redis process was terminated (e.g., by OOM killer) during a save operation.
A client attempts to execute a SET command after a background save (BGSAVE) has failed due to disk space issues.
# BGSAVE fails in the background... # Later, a client sends: SET user:1 "john"
expected output
(error) MISCONF Redis is configured to save RDB snapshots, but is currently unable to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
Fix 1
Resolve the underlying disk issue
WHEN This is the primary and most important fix
# Check disk space df -h # Check directory permissions ls -ld /var/lib/redis
Why this works
Freeing up disk space or fixing permissions will allow the next snapshot attempt to succeed. Once a BGSAVE completes successfully, Redis will automatically re-enable writes.
Fix 2
Dynamically disable the stop-writes-on-bgsave-error feature
WHEN As a temporary measure to restore service while fixing the root cause
CONFIG SET stop-writes-on-bgsave-error no
Why this works
This command tells Redis to allow writes even if RDB snapshotting is failing. This is dangerous as it means a crash could lead to significant data loss, but it can restore service availability in an emergency.
✕ Ignore the error and only use the temporary fix
Disabling 'stop-writes-on-bgsave-error' exposes you to major data loss. It's a temporary patch, not a solution. The root cause of the save failure must be fixed.
redis.conf 'stop-writes-on-bgsave-error' directive
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev