MISCONF error

Redis stopped accepting writes because it couldn't save your data to disk.

Redis returns this error when it can't save your data to disk. So that you notice, Redis refuses commands that change data until saving works again. Commands that read data still work. The message depends on how Redis saves your data:

  • Snapshots. The last attempt to save a snapshot failed. A snapshot, also called an RDB (Redis Database) file, is a copy of all your data at one point in time:

    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.
    
  • Append-only file. Redis couldn't write to its append-only file (AOF), which logs every change to your data. The message ends with the reason that the operating system gave:

    MISCONF Errors writing to the AOF file: No space left on device
    

How to fix it

  1. Find out why saving failed. The Redis log gives the reason, for example:

    Failed opening the temp RDB file temp-56018.rdb (in server root dir /var/lib/redis) for saving: Permission denied
    

    To confirm the problem, run INFO persistence. rdb_last_bgsave_status:err means that the last snapshot failed, and aof_last_write_status:err means that the last write to the AOF failed.

  2. Fix the cause. These are the most common ones:

    • The disk is full. Free some space on the disk that holds the Redis data directory. To find the directory, run CONFIG GET dir.
    • Redis can't write to its data directory. Check that the user that runs Redis can create files in that directory.
    • Redis couldn't start a snapshot. Redis saves snapshots in a background process that it creates with fork(). On Linux, this can fail when the system is low on memory. The administration guide recommends setting vm.overcommit_memory = 1.
  3. Let Redis save again:

    • For snapshots, run BGSAVE. When the snapshot succeeds, Redis accepts writes again.
    • For the AOF, you don't need to do anything. Redis tries to write the file again every second, and accepts writes again as soon as a write succeeds.

If you can accept snapshots that may be out of date, you can tell Redis to keep accepting writes after a failed snapshot with CONFIG SET stop-writes-on-bgsave-error no. You then won't get this error for snapshots, but you also won't notice when saving stops working. This setting doesn't apply to the AOF. See Persistence.

RATE THIS PAGE
Back to top ↑