0

After restart docker container with redis:6.2.5-alpine3.14 it can't start with error:

[offset 55130] Internal error in RDB reading offset 0, function at rdb.c:411 -> Invalid LZF compressed string

Everything is OK after Redis storage was cleaned up:

# ls -la /redis/
total 68
drwxr-xr-x.  2 polkitd 1000    43 Oct  4 19:22 .
drw-r-----. 14 root    root   179 Sep  8 19:51 ..
-rw-r--r--.  1 polkitd 1000 63907 Oct  4 19:13 dump.rdb
-rw-r--r--.  1 polkitd root  4096 Oct  4 19:22 .dump.rdb.swp

Could somebody explain what can be a reason of this issue?

Oleg Neumyvakin
  • 629
  • 6
  • 16

1 Answers1

1

This means that the RDB database is corrupted. You should stop the container and restore the file from a backup. If you can't restore it, you can rename/move it to have a corrupted backup in case you want to restore it partially, then start the redis container.

If this is happening often, check if AOF (Append Only File) is better for you. You can have both RDB and AOF at the same time. For more details read also Redis persistence demystified.

To check the consistency of the RDB files you can use:

redis-check-dump dump.rdb

See 4.3.1 Verifying snapshots and append-only files for more details.

If you use a cluster, you can recover one of the nodes with:

rladmin recover list  # To see the list of all files to be recovered

rladmin recover all
rladmin recover db <database_id|name>    # To recover only one DB
recover db only_configuration <db_name>  # To recover only the DB config

rladmin status     # To check which DBs were recovered

Also in a cluster it's possible to recover the the DB with:

rladmin cluster recover ....

See: cluster recover documentation

Mircea Vutcovici
  • 17,619
  • 4
  • 56
  • 83