I spotted this error in [[Redis]] because the [[Kubernetes]] pod for the cache kept restarting and would eventually either fail with an error or fail with the status `CrashLoopBackOff`.
I tried deleting the [[Creating Kubernetes manifests|manifest]] and applying the last known functioning copy of the same manifest, but it still began to error out.
Upon looking into the logs of the pod by running `kubectl logs cache-pod_name`, I saw this:
```bash
[offset 0] Checking RDB file dump.rdb
[offset 26] AUX FIELD redis-ver = '6.2.4'
[offset 40] AUX FIELD redis-bits = '64'
[offset 52] AUX FIELD ctime = '1629399716'
[offset 67] AUX FIELD used-mem = '30402496'
[offset 83] AUX FIELD aof-preamble = '0'
[offset 85] Selecting DB ID 1
--- RDB ERROR DETECTED ---
[offset 12294831] Internal error in RDB reading offset 0, function at rdb.c:411 -> Invalid LZF compressed string
[additional info] While doing: read-object-value
[additional info] Reading key ':1:2ea9cd3875e4f3e19880adc029a8bd93efe72a70'
[additional info] Reading type 0 (string)
[info] 58597 keys read
[info] 0 expires
[info] 0 already expired
1:M 19 Aug 2021 19:51:23.980 # Terminating server after rdb file reading failure.
```
Upon research, I discovered that a solution for this was to delete `/var/lib/docker/volumes/mailcowdockerized_redis-vol-1/_data/dump.rdb`. [^github] It appears that `dump.rdb` sometimes get corrupted. This may have been caused by the fact that I had been messing around with the manifest of the cache without reapplying the persistent data manifest as well. So, to fix this:
- I deleted the `cache-deployment.yaml`.
- I applied the cache deployment, the cache service, and the persistent volume: `kubectl apply -f cache-deployment.yaml,cache-service.yaml,redis-data-persistentvolumeclaim.yaml`
I believe that deleting the persistent volume claim solved the issue.
[^github]: _GitHub - Redis container "RDB ERROR DETECTED"._ Retrieved from https://github.com/mailcow/mailcow-dockerized/issues/2760