Immich treats restored to phone assets as duplicates... again #3788

Closed
opened 2026-02-20 02:15:42 -05:00 by deekerman · 3 comments
Owner

Originally created by @DX37 on GitHub (Sep 8, 2024).

The bug

Bug started since v1.113.0, I think. I removed and manually restored my assets directly from Immich library to "DCIM\Camera". The app calculates hash, but backup treats these assets as "Remaining photos". When backup starting, this photo's amount and "Total amount" decreases, but "Backed up photos" amount not increases, and "Duplicated photos" amount increases exactly to "Remaining photos" amount. When "Duplicated assets" clear button is pressed, this amount comes back to "Remaining photos" and backup process begins again...

The OS that Immich Server is running on

Arch Linux

Version of Immich Server

v1.114.0

Version of Immich Mobile App

v1.114.0 on Android 15 QPR1 Beta 1.1

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
      file: hwaccel.transcoding.yml
      service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - /srv/4tb/samba/public/media/photo:/mnt/media/4tb_photos:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    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}
#    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
    #extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #  file: hwaccel.ml.yml
    #  service: openvino # 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

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

UPLOAD_LOCATION=/srv/ssd/immich

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

# Connection secrets for postgres and typesense. You should change these to random passwords
DB_PASSWORD=<redacted>

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

REDIS_HOSTNAME=immich_redis

PUBLIC_LOGIN_PAGE_MESSAGE=DX37 Immich
TZ=Asia/Novosibirsk
#LOG_LEVEL=debug

Reproduction steps

  1. Delete backed up assets from phone
  2. Restore (copy) assets to your phone directly from Immich library through SMB and connected to USB phone
  3. Refresh Immich main page in the configured the app (with or without app data cleaned up before)
  4. Wait for hash calculation process complete
  5. Go to Backup page and see that all directly restored assets treated as not backed up
  6. Start backup and see that these assets uploading again, but "Total" and "Remaining" decreasing, "Backed photos" is zero and not increasing, "Duplicated" assets is increasing exactly as amount of backed up again assets

Relevant log output

No response

Additional information

No response

Originally created by @DX37 on GitHub (Sep 8, 2024). ### The bug Bug started since v1.113.0, I think. I removed and manually restored my assets directly from Immich library to "DCIM\Camera". The app calculates hash, but backup treats these assets as "Remaining photos". When backup starting, this photo's amount and "Total amount" decreases, but "Backed up photos" amount not increases, and "Duplicated photos" amount increases exactly to "Remaining photos" amount. When "Duplicated assets" clear button is pressed, this amount comes back to "Remaining photos" and backup process begins again... ### The OS that Immich Server is running on Arch Linux ### Version of Immich Server v1.114.0 ### Version of Immich Mobile App v1.114.0 on Android 15 QPR1 Beta 1.1 ### Platform with the issue - [ ] Server - [ ] Web - [X] Mobile ### 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} extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding file: hwaccel.transcoding.yml service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro - /srv/4tb/samba/public/media/photo:/mnt/media/4tb_photos:ro env_file: - .env ports: - 2283:3001 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} # image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino #extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: openvino # 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 redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1 interval: 5m start_interval: 30s start_period: 5m command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"] restart: always volumes: pgdata: model-cache: ``` ### Your .env content ```Shell UPLOAD_LOCATION=/srv/ssd/immich # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secrets for postgres and typesense. You should change these to random passwords DB_PASSWORD=<redacted> # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis PUBLIC_LOGIN_PAGE_MESSAGE=DX37 Immich TZ=Asia/Novosibirsk #LOG_LEVEL=debug ``` ### Reproduction steps 1. Delete backed up assets from phone 2. Restore (copy) assets to your phone directly from Immich library through SMB and connected to USB phone 3. Refresh Immich main page in the configured the app (with or without app data cleaned up before) 4. Wait for hash calculation process complete 5. Go to Backup page and see that all directly restored assets treated as not backed up 6. Start backup and see that these assets uploading again, but "Total" and "Remaining" decreasing, "Backed photos" is zero and not increasing, "Duplicated" assets is increasing exactly as amount of backed up again assets ### Relevant log output _No response_ ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Sep 8, 2024):

I think this is currently working as expected, as the app doesn't yet consider the hash when deciding whether files should be uploaded and so these look like completely new assets to it. The server will reject them as duplicates when uploading.

@bo0tzz commented on GitHub (Sep 8, 2024): I think this is currently working as expected, as the app doesn't yet consider the hash when deciding whether files should be uploaded and so these look like completely new assets to it. The server will reject them as duplicates when uploading.
Author
Owner

@DX37 commented on GitHub (Sep 8, 2024):

The server will reject them as duplicates when uploading.

Then why the app still fully uploads them to server, only then to reject them?

@DX37 commented on GitHub (Sep 8, 2024): > The server will reject them as duplicates when uploading. Then why the app still **fully** uploads them to server, only then to reject them?
Author
Owner

@bo0tzz commented on GitHub (Sep 8, 2024):

Because that mechanism hasn't been updated to use the hash yet, like I mentioned. That's being tracked in #2567

@bo0tzz commented on GitHub (Sep 8, 2024): Because that mechanism hasn't been updated to use the hash yet, like I mentioned. That's being tracked in #2567
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#3788
No description provided.