Thanks to Itamar Haber and asktyagi's comments/answer, I think I pieced together what was happening.
When I previously used the ReJSON
module, it wrote some data to the DB. By default, Redis will backup its data to disk from time to time (I was under the wrong assumption that it operated entirely in RAM). So what happened is once I reverted back to the stock config and stopped using the module, Redis could not start and recover from the backup since it couldn't parse the data left behind by the now missing module. Hence the error.
The reason uninstalling and reinstalling didn't help is that the new Redis installation would still find the backup file left behind by the previous installation and try to recover that data. The file was dump.rdb
in my home directory. Perhaps a script moved it there from Redis working directory during uninstall and another script restored it to Redis working directory during install?. So to get Redis back to normal, I think I had to do any one of the following:
- Move/delete the
dump.rdb
file, so there would be no data to restore
- Start Redis with the module that wrote the data
- Start Redis with no config, or a config that would not find
dump.rdb
Here is the relevant section of the configuration. It shows how with its default config Redis was able to find the data dump from the previous installation
################################ SNAPSHOTTING ################################
#
# Save the DB on disk:
#
# save <seconds> <changes>
#
# Will save the DB if both the given number of seconds and the given
# number of write operations against the DB occurred.
#
# In the example below the behaviour will be to save:
# after 900 sec (15 min) if at least 1 key changed
# after 300 sec (5 min) if at least 10 keys changed
# after 60 sec if at least 10000 keys changed
#
# Note: you can disable saving completely by commenting out all "save" lines.
#
# It is also possible to remove all the previously configured save
# points by adding a save directive with a single empty string argument
# like in the following example:
#
# save ""
save 900 1
save 300 10
save 60 10000
# The filename where to dump the DB
dbfilename dump.rdb
# The working directory.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir /var/lib/redis
Thanks to all for your help. Wish I had figured this out earlier; I ended up wiping the OS and starting from scratch out of frustration.