#Database backups are zero-byte files ending in .tmp.

1 messages · Page 1 of 1 (latest)

bleak glacier
#

I'm running 1.141.1 via Docker Compose on a Debian testing host.

I noticed that my database backups directory looks like:

$ ls -l /mnt/TANK/IMMICH/backups
...
-rw-r--r-- 1 root root 0 Aug 29 19:00 immich-db-backup-20250830T020000-v1.139.4-pg14.19.sql.gz.tmp
-rw-r--r-- 1 root root 0 Aug 30 21:39 immich-db-backup-20250831T043903-v1.140.1-pg14.19.sql.gz.tmp
-rw-r--r-- 1 root root 0 Sep  6 10:17 immich-db-backup-20250906T171756-v1.140.1-pg14.19.sql.gz.tmp
-rw-r--r-- 1 root root 0 Sep  9 11:02 immich-db-backup-20250909T180230-v1.141.1-pg14.19.sql.gz.tmp
-rw-r--r-- 1 root root 0 Sep  9 13:02 immich-db-backup-20250909T200247-v1.141.1-pg14.19.sql.gz.tmp

The string db-backup doesn't appear in either my immich_server or immich_postgres logs.

The following works:

docker exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres | gzip > /mnt/TANK/IMMICH/backups/dump.sql.gz

I'm running the backups via a cron job, but this seems like something I should be able to troubleshoot. Let me know how I can help!

limpid houndBOT
#

:wave: Hey @bleak glacier,

Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich immich.

References

#

Checklist

I have...

  1. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time).
  2. :ballot_box_with_check: read applicable release notes.
  3. :ballot_box_with_check: reviewed the FAQs for known issues.
  4. :ballot_box_with_check: reviewed Github for known issues.
  5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy).
  6. :ballot_box_with_check: uploaded the relevant information (see below).
  7. :ballot_box_with_check: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable

(an item can be marked as "complete" by reacting with the appropriate number)

Information

In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:

  • Your docker-compose.yml and .env files.
  • Logs from all the containers and their status (see above).
  • All the troubleshooting steps you've tried so far.
  • Any recent changes you've made to Immich or your system.
  • Details about your system (both software/OS and hardware).
  • Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h).
  • The version of the Immich server, mobile app, and other relevant pieces.
  • Any other information that you think might be relevant.

Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

bleak glacier
#

My docker compose configuration:

  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    cpu_shares: 256
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    # Manually set up VAAPI.
    networks:
      - frontend
      - backend
    devices:
      - /dev/dri:/dev/dri
    environment:
      - REDIS_HOSTNAME=immich_redis
      - DB_URL=${IMMICH_DB_URL}
    volumes:
      - ${IMMICH_UPLOAD_LOCATION}:/usr/src/app/upload
      # Allow read/write so that we can write sidecar metadata.
      - /mnt/TANK/PHOTOS:/usr/src/app/external
      - /etc/localtime:/etc/localtime:ro
    ports:
      - '2283:2283'
    depends_on:
      - immich-redis
      - immich-database
    restart: always
    healthcheck:
      disable: false

  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}
    cpu_shares: 128
    # 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
    networks:
      - backend
    volumes:
      - immich-model-cache:/cache
    restart: always
    healthcheck:
      disable: false

  immich-redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:8-bookworm@sha256:fec42f399876eb6faf9e008570597741c87ff7662a54185593e74b09ce83d177
    networks:
      - backend
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always
#

Continued:

  immich-database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
    cpu_shares: 128
    networks:
      - backend
    environment:
      POSTGRES_PASSWORD: ${IMMICH_DB_PASSWORD}
      POSTGRES_USER: ${IMMICH_DB_USERNAME}
      POSTGRES_DB: ${IMMICH_DB_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
      - ${IMMICH_DB_LOCATION}:/var/lib/postgresql/data
    restart: always

volumes:
  immich-model-cache:

Environment:

IMMICH_UPLOAD_LOCATION=/mnt/TANK/IMMICH
IMMICH_DB_LOCATION=/srv/immich/postgres
IMMICH_DB_PASSWORD=[REDACTED]
IMMICH_DB_USERNAME=postgres
IMMICH_DB_NAME=immich

IMMICH_DB_URL="postgresql://${IMMICH_DB_USERNAME}:${IMMICH_DB_PASSWORD}@immich-database:5432/${IMMICH_DB_NAME}"
teal trout
#

Backups are broken with DB_URL

#

Might be fixed in 1.142

bleak glacier
#

Also in compose:

networks:
  frontend:
    name: frontend
    driver: bridge
  backend:
    name: backend
    driver: bridge
#

I am currently running 1.141.1. I'll upgrade and see what happens.

limpid houndBOT
bleak glacier
#

I just ran docker compose pull and docker compose up, and triggered a database dump, let's see what happens.