5 July 2018

Redis on Windows fix: Redis is configured to save RDB snapshots

If you use the redis on windows, you may have run into the following error:

Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

We encountered this when running with the ASP.NET Redis Session Provider on our development machines, and José figured out the fix. The root of the issue, as documented in this stack overflow post, is that you need to tell redis where to save the db. You can do this with the following commands:
> redis-cli
CONFIG SET dir ./
CONFIG SET dbfilename dump.rdb
CONFIG REWRITE 
The final CONFIG REWRITE command will save your configuration to a config file, so it persists on service restart.

As a side note, this only appeared when we installed redis from chocolately; if you install it from MS Open Tech it is correctly configured out-of-the-box.