<bug> Database Dump Crashing Server #8058

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

Originally created by @Dwindle2234 on GitHub (Dec 15, 2025).

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

  • Yes

The bug

DB backup job either by Cron or manually triggering causes server to crash. No changes to permissions or otherwise - just broke last night (I think I did pull this latest version that same day). Restarting immich and all is well again, but there's no data dump for me to backup to the cloud.

microservices worker error: Error: EINVAL: invalid argument, open '/usr/src/app/upload/backups/immich-db-backup-20251215T190848-v2.3.1-pg14.17.sql.gz.tmp', stack: Error: EINVAL: invalid argument, open '/usr/src/app/upload/backups/immich-db-backup-20251215T190848-v2.3.1-pg14.17.sql.gz.tmp' microservices worker exited with code 1 Killing api process

I have 'Amount of previous dumps to keep' set to 1.

Deleting the one backup that was in there (taken 2 days again) hasn't helped. I have TB to spare - there's been no change to permissions.

I'm assuming this must be a bug.

The OS that Immich Server is running on

Unraid 7.2.0

Version of Immich Server

v.2.3.1

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

N/A

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    #mem_limit: 2g
    # 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}:/usr/src/app/upload
      - ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
      - ${IMPORT_LOCATION}:/upload
      - /etc/localtime:/etc/localtime:ro
      #- /mnt/user/photo:/mnt/media/photo:ro
      - /mnt/user/home-vid:/mnt/media/home-vid:ro
      #- /mnt/cache/temp/immich-logs:/app/logs
    env_file:
      - .env
    #ports:
    #  - '2283:2283'   #local version not required
    #command: sh -c "immich-server 2>&1 | tee /app/logs/immich-server.log"
    depends_on:
      - redis
      - database
    restart: unless-stopped
    logging:
      driver: syslog
      options:
        syslog-address: "udp://192.168.50.12:514"
        tag: "immich-server"

    healthcheck:
      disable: false
    #deploy:
    #  resources:
    #    limits:
    #      cpus: '4.0'

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] 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, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    #mem_limit: 2g
    volumes:
      - /mnt/cache/temp/immich-model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false
    #deploy:
    #  resources:
    #    limits:
    #      cpus: '4.0'

  redis:
    container_name: immich_redis
    mem_limit: 200m
    image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    #mem_limit: 0.5g
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
      # 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:

networks:
  default:
    external: true
    name: nginx_net

Your .env content

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

#App URL
IMMICH_URL="https://XXXXXX"

# Your pre-existing API token
IMMICH_TOKEN="XXX"


# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/user/immich

# The location that we watch to auto upload to XXX account
IMPORT_LOCATION=/mnt/cache/temp/immich

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=/mnt/cache/appdata/immich

# The location of the thumnails
THUMB_LOCATION=/mnt/cache/temp/immich-thumbs

# 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=Europe/London

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

# 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=XXXXX

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

Reproduction steps

...

Relevant log output


Additional information

No response

Originally created by @Dwindle2234 on GitHub (Dec 15, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug DB backup job either by Cron or manually triggering causes server to crash. No changes to permissions or otherwise - just broke last night (I think I did pull this latest version that same day). Restarting immich and all is well again, but there's no data dump for me to backup to the cloud. `microservices worker error: Error: EINVAL: invalid argument, open '/usr/src/app/upload/backups/immich-db-backup-20251215T190848-v2.3.1-pg14.17.sql.gz.tmp', stack: Error: EINVAL: invalid argument, open '/usr/src/app/upload/backups/immich-db-backup-20251215T190848-v2.3.1-pg14.17.sql.gz.tmp' microservices worker exited with code 1 Killing api process` I have 'Amount of previous dumps to keep' set to 1. Deleting the one backup that was in there (taken 2 days again) hasn't helped. I have TB to spare - there's been no change to permissions. I'm assuming this must be a bug. ### The OS that Immich Server is running on Unraid 7.2.0 ### Version of Immich Server v.2.3.1 ### Version of Immich Mobile App N/A ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Device make and model N/A ### Your docker-compose.yml content ```YAML name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} #mem_limit: 2g # 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}:/usr/src/app/upload - ${THUMB_LOCATION}:/usr/src/app/upload/thumbs - ${IMPORT_LOCATION}:/upload - /etc/localtime:/etc/localtime:ro #- /mnt/user/photo:/mnt/media/photo:ro - /mnt/user/home-vid:/mnt/media/home-vid:ro #- /mnt/cache/temp/immich-logs:/app/logs env_file: - .env #ports: # - '2283:2283' #local version not required #command: sh -c "immich-server 2>&1 | tee /app/logs/immich-server.log" depends_on: - redis - database restart: unless-stopped logging: driver: syslog options: syslog-address: "udp://192.168.50.12:514" tag: "immich-server" healthcheck: disable: false #deploy: # resources: # limits: # cpus: '4.0' immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] 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, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable #mem_limit: 2g volumes: - /mnt/cache/temp/immich-model-cache:/cache env_file: - .env restart: always healthcheck: disable: false #deploy: # resources: # limits: # cpus: '4.0' redis: container_name: immich_redis mem_limit: 200m image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11 healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres #mem_limit: 0.5g image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs # 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: networks: default: external: true name: nginx_net ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables #App URL IMMICH_URL="https://XXXXXX" # Your pre-existing API token IMMICH_TOKEN="XXX" # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/user/immich # The location that we watch to auto upload to XXX account IMPORT_LOCATION=/mnt/cache/temp/immich # The location where your database files are stored. Network shares are not supported for the database DB_DATA_LOCATION=/mnt/cache/appdata/immich # The location of the thumnails THUMB_LOCATION=/mnt/cache/temp/immich-thumbs # 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=Europe/London # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=v2 # 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=XXXXX # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. 2. 3. ... ### Relevant log output ```shell ``` ### 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#8058