Redis RDB corruption causing Redis to crashloop and immich unresponsive #6783

Closed
opened 2026-02-05 12:32:13 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @mason-larobina on GitHub (Aug 8, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

The Redis container fails to start when encountering corrupted data (common when Docker containers restart unexpectedly or during low-memory situations).

This breaks Immich functionality as the app service fails to connect to Redis. Recovery is cumbersome because:

  1. The default unnamed Redis volume path is not discoverable for beginners to delete the dump.rdb
  2. Redis persistence is enabled by default despite Immich using Redis only for ephemeral data

Proposed Solutions:

  1. Disable Redis persistence by default
  2. Use named volumes explicitly. This makes data location obvious in Docker volume lists and easier to wipe when needed.

In my case I used a named volume in the docker-compose.yml to change the redis data directory to './redis:/data' which moved away from the corrupt data.rdb and now Immich is operational for me again.

The OS that Immich Server is running on

Archlinux

Version of Immich Server

v1.137.3

Version of Immich Mobile App

v1.137.2 build.3002

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/data
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11
    volumes:
      - ${REDIS_DATA_LOCATION}:/data
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      DB_STORAGE_TYPE: 'HDD'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always

volumes:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=./library
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

REDIS_DATA_LOCATION=./redis

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=Australia/Perth

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=v1.137.3

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=81...

# https://immich.app/docs/install/environment-variables/
# https://github.com/immich-app/immich/discussions/11862
MACHINE_LEARNING_MODEL_TTL=0
MACHINE_LEARNING_PRELOAD__CLIP__VISUAL=ViT-L-16-SigLIP2-512__webli

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

Unknown. I just found immich unresponsive and throwing up unable to fetch resource errors.

Relevant log output

immich_redis  | [offset 0] Checking RDB file dump.rdb
immich_redis  | [offset 27] AUX FIELD valkey-ver = '8.1.3'
immich_redis  | [offset 41] AUX FIELD redis-bits = '64'
immich_redis  | [offset 53] AUX FIELD ctime = '1754198054'
immich_redis  | [offset 68] AUX FIELD used-mem = '7666384'
immich_redis  | [offset 80] AUX FIELD aof-base = '0'
immich_redis  | [offset 82] Selecting DB ID 0
immich_redis  | --- RDB ERROR DETECTED ---
immich_redis  | [offset 787404] Internal error in RDB reading offset 0, function at rdb.c:454 -> Invalid LZF compressed string
immich_redis  | [additional info] While doing: read-object-value
immich_redis  | [additional info] Reading key 'immich_bull:backgroundTask:events'
immich_redis  | [additional info] Reading type 21 (stream-v3)
immich_redis  | [info] 30 keys read
immich_redis  | [info] 8 expires
immich_redis  | [info] 8 already expired
immich_redis  | 1:M 07 Aug 2025 13:15:41.848 # Terminating server after rdb file reading failure.

Additional information

No response

Originally created by @mason-larobina on GitHub (Aug 8, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug The Redis container fails to start when encountering corrupted data (common when Docker containers restart unexpectedly or during low-memory situations). This breaks Immich functionality as the app service fails to connect to Redis. Recovery is cumbersome because: 1. The default unnamed Redis volume path is not discoverable for beginners to delete the `dump.rdb` 2. Redis persistence is enabled by default despite Immich using Redis only for ephemeral data **Proposed Solutions:** 1. Disable Redis persistence by default 2. Use named volumes explicitly. This makes data location obvious in Docker volume lists and easier to wipe when needed. In my case I used a named volume in the `docker-compose.yml` to change the redis data directory to './redis:/data' which moved away from the corrupt data.rdb and now Immich is operational for me again. ### The OS that Immich Server is running on Archlinux ### Version of Immich Server v1.137.3 ### Version of Immich Mobile App v1.137.2 build.3002 ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding volumes: # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file - ${UPLOAD_LOCATION}:/data - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - '2283:2283' depends_on: - redis - database restart: always healthcheck: disable: false immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - model-cache:/cache env_file: - .env restart: always healthcheck: disable: false redis: container_name: immich_redis image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11 volumes: - ${REDIS_DATA_LOCATION}:/data healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:32324a2f41df5de9efe1af166b7008c3f55646f8d0e00d9550c16c9822366b4a environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' DB_STORAGE_TYPE: 'HDD' volumes: # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file - ${DB_DATA_LOCATION}:/var/lib/postgresql/data shm_size: 128mb restart: always volumes: model-cache: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The location where your database files are stored DB_DATA_LOCATION=./postgres REDIS_DATA_LOCATION=./redis # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List TZ=Australia/Perth # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=v1.137.3 # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=81... # https://immich.app/docs/install/environment-variables/ # https://github.com/immich-app/immich/discussions/11862 MACHINE_LEARNING_MODEL_TTL=0 MACHINE_LEARNING_PRELOAD__CLIP__VISUAL=ViT-L-16-SigLIP2-512__webli # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps Unknown. I just found immich unresponsive and throwing up unable to fetch resource errors. ### Relevant log output ```shell immich_redis | [offset 0] Checking RDB file dump.rdb immich_redis | [offset 27] AUX FIELD valkey-ver = '8.1.3' immich_redis | [offset 41] AUX FIELD redis-bits = '64' immich_redis | [offset 53] AUX FIELD ctime = '1754198054' immich_redis | [offset 68] AUX FIELD used-mem = '7666384' immich_redis | [offset 80] AUX FIELD aof-base = '0' immich_redis | [offset 82] Selecting DB ID 0 immich_redis | --- RDB ERROR DETECTED --- immich_redis | [offset 787404] Internal error in RDB reading offset 0, function at rdb.c:454 -> Invalid LZF compressed string immich_redis | [additional info] While doing: read-object-value immich_redis | [additional info] Reading key 'immich_bull:backgroundTask:events' immich_redis | [additional info] Reading type 21 (stream-v3) immich_redis | [info] 30 keys read immich_redis | [info] 8 expires immich_redis | [info] 8 already expired immich_redis | 1:M 07 Aug 2025 13:15:41.848 # Terminating server after rdb file reading failure. ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6783