immich icon indicating copy to clipboard operation
immich copied to clipboard

Utilities, review duplicates, throw a simple "Error Not found or no asset delete access (immich Server Error" when deduplicate (delete) images that are in the locked folder

Open Fox350 opened this issue 6 months ago • 6 comments

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

  • [x] Yes

The bug

Utilities, review duplicates, throw a simple "Error Not found or no asset delete access (immich Server Error" when deduplicate (delete) images that are in the locked folder. Easy to reproduce and I would just suggest to implement a logic to warn the user that actions cannot be done because thoses images are in the locked folder. Also, mass deduplicate all fail because of this without giving out why.
It would be a user experience improvement. Continue your great work Immich is awesome team :)

Image

The OS that Immich Server is running on

Ubuntu server 25.04 / Portainer docker

Version of Immich Server

1.34

Version of Immich Mobile App

1.34

Platform with the issue

  • [x] Server
  • [x] Web
  • [x] 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:
    #   file: hwaccel.transcoding.yml
    #   service: cpu
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /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
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.ml.yml
    #   service: cpu
    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:ff21bc0f8194dc9c105b769aeabf9585fea6a8ed649c0781caeac5cb3c247884
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # DB_STORAGE_TYPE: 'HDD'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    restart: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/mnt/immich_data
DB_DATA_LOCATION=./postgres
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

Have pictures scanned for duplicates Move pictures in locked folders Utilities, review duplicate, try to deduplicate all or just a set of photo in the locked folder

Relevant log output


Additional information

No response

Fox350 avatar May 31 '25 16:05 Fox350

because those images are in the locked folder.

This would be disclosing information we may not want to be disclosing. It's in a similar vein to a login form that shouldn't say "password wrong" but rather "password wrong or email address does not exist".

danieldietzler avatar May 31 '25 16:05 danieldietzler

Well, locked assets shouldn't be in the dedup utility at all, right?

bo0tzz avatar May 31 '25 16:05 bo0tzz

I think mentioning that pictures are not manageable because they are in the locked folder would be the right thing to do without Any details about thoses.

Envoyé à partir de Outlook pour Androidhttps://aka.ms/AAb9ysg


From: bo0tzz @.> Sent: Saturday, May 31, 2025 12:57:29 PM To: immich-app/immich @.> Cc: Fox350 @.>; Author @.> Subject: Re: [immich-app/immich] Utilities, review duplicates, throw a simple "Error Not found or no asset delete access (immich Server Error" when deduplicate (delete) images that are in the locked folder (Issue #18813)

[https://avatars.githubusercontent.com/u/11602424?s=20&v=4]bo0tzz left a comment (immich-app/immich#18813)https://github.com/immich-app/immich/issues/18813#issuecomment-2925436905

Well, locked assets shouldn't be in the dedup utility at all, right?

— Reply to this email directly, view it on GitHubhttps://github.com/immich-app/immich/issues/18813#issuecomment-2925436905, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASVQARJM4UILST2OFQR7YQL3BHNPTAVCNFSM6AAAAAB6KB3ZGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMRVGQZTMOJQGU. You are receiving this because you authored the thread.Message ID: @.***>

Fox350 avatar May 31 '25 17:05 Fox350

I can also confirm this functionality. Unfortunately for me, the first photo set in the duplicate utility includes locked photos, so I cannot de-duplicate any photos.

To me it feels like the duplicate utility should just skip any photos that are in the locked folder.

endthestart avatar Jun 04 '25 23:06 endthestart

    if (asset.visibility === AssetVisibility.HIDDEN) {
      this.logger.debug(`Asset ${id} is not visible, skipping`);
      return JobStatus.SKIPPED;
    }

Code

I'm new to this code base so please excuse me if I'm way off here. I looked in duplicate.service.ts and found the code snippet above. It seems to me that the duplicate service does skip HIDDEN photos already. So I looked a bit more and found this snippet:

enum AssetVisibilityEnum { timeline, hidden, archive, locked }

It seems that I could add the following snippet to the duplicate service to prevent locked photos from being included in the duplicate utility:

    if (asset.visibility === AssetVisibility.LOCKED) {
      this.logger.debug(`Asset ${id} is locked, skipping`);
      return JobStatus.SKIPPED;
    }

If this is close, I can start working on a PR. Or if there is another way to address this issue please let me know.

endthestart avatar Jun 04 '25 23:06 endthestart

I ran into this problem, but found after unlocking my locked folder the missing files showed up in the duplicate utility and I could trash one (and move on). This seems like the right behaviour to me, as I would still like to remove duplicates from my locked folder, it would just help if it prompted to "unlock locked folder to review this file" or similar?

trugty avatar Jun 16 '25 20:06 trugty

Fixed in #18699

jrasm91 avatar Sep 11 '25 18:09 jrasm91