Redis has RDB snapshots enabled but cannot write to disk due to permission issues, disk space, or memory constraints. This prevents write operations and requires fixing the underlying persistence issue.
Redis has detected a failure in its background save (BGSAVE) operation and has automatically disabled write operations to prevent silent data loss. This error occurs when Redis is configured to persist data to disk via RDB snapshots but the save operation fails. The `stop-writes-on-bgsave-error` setting causes Redis to reject any command that modifies data until the persistence issue is resolved. This is a protective mechanism—if Redis allowed writes without being able to save them, you would lose data on restart.
Examine your Redis log file to identify the root cause. The log usually contains the exact reason the save operation failed.
# On Linux/macOS
redis-cli info
# Or check log file directly (location varies by installation)
cat /var/log/redis/redis-server.log
tail -f /var/log/redis/redis-server.logLook for messages about "No space left on device", "Permission denied", or "Cannot allocate memory".
Ensure the Redis data directory has sufficient free space for the RDB snapshot file.
# Check disk usage
df -h /path/to/redis/data
# See size of current RDB file
ls -lh /path/to/redis/data/dump.rdb
# Clean up old snapshots if safe
rm -f /path/to/redis/data/dump.rdb.bakAs a rule of thumb, ensure at least 1.5x the estimated Redis memory usage is available on disk (because BGSAVE needs space for both the current data and the new snapshot during the operation).
Ensure the Redis process (usually user "redis") has write access to the data directory.
# Check current permissions
ls -ld /path/to/redis/data
# Fix permissions (redis user must own/write to this directory)
sudo chown redis:redis /path/to/redis/data
sudo chmod 755 /path/to/redis/data
# Verify the redis process user
ps aux | grep redisThe directory must be writable by the user running the Redis process.
If you see "Cannot allocate memory" in logs, Linux's memory overcommit restriction may prevent BGSAVE fork().
# Check current setting
cat /proc/sys/vm/overcommit_memory
# Set to 1 to allow overcommit (recommended for Redis)
sudo sysctl -w vm.overcommit_memory=1
# Make permanent by adding to /etc/sysctl.conf
echo "vm.overcommit_memory=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pSetting to 1 allows the Linux kernel to allocate memory even if it would theoretically exceed physical RAM, which is necessary for Redis child processes.
Once the underlying issue is resolved, restart Redis to re-enable writes.
# Graceful restart
redis-cli shutdown
sudo systemctl start redis-server
# Or with brew on macOS
brew services restart redis
# Verify it's running
redis-cli ping
# Should return: PONGAfter restart, confirm writes are working: redis-cli SET testkey testvalue
The stop-writes-on-bgsave-error config option (enabled by default) is a safety feature. Disabling it with config set stop-writes-on-bgsave-error no will allow writes even if persistence fails, but this risks silent data loss. Only disable this if: (1) persistence is not critical for your use case, (2) you have other backup strategies, or (3) you are using Redis purely as a cache. For production systems, fix the underlying persistence issue instead. In Docker containers, ensure the data volume has sufficient space and correct permissions. For cloud Redis services (Upstash, ElastiCache), check your plan's storage limits and upgrade if needed. The BGSAVE operation requires forking the Redis process; if your system memory is severely constrained, increasing available RAM or reducing Redis max memory may be necessary.
ERR fsync error
How to fix "ERR fsync error" in Redis
CLUSTERDOWN The cluster is down
How to fix 'CLUSTERDOWN The cluster is down' in Redis
ERR Job for redis-server.service failed because a timeout was exceeded
Job for redis-server.service failed because a timeout was exceeded
ERR Unbalanced XREAD list of streams
How to fix "ERR Unbalanced XREAD list" in Redis
ERR syntax error
How to fix "ERR syntax error" in Redis