How to fix error "(error) MISCONF Redis is configured to save RDB snapshots"?

Last updated 22, Mar 2024

Question

The default config in Redis OSS causes this error whenever I try to write a new key. How to resolve the issue?

127.0.0.1:6379> sadd mykey:name john1
(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.

Answer

There are issues when persisting to disk. While such errors must be troubleshot at the system level, a workaround to achieve write operations and make them happen is to set in the config or at runtime the following configuration to allow writes.

config set stop-writes-on-bgsave-error no

References

Check the documentation in the Redis configuration files for your Redis Server's version, where you can find an explanation:

# However if you have setup your proper monitoring of the Redis server
# and persistence, you may want to disable this feature so that Redis will
# continue to work as usual even if there are problems with disk,
# permissions, and so forth.