[BUG] UNTRACKS FILES after deleting external library #1571

Closed
opened 2026-02-05 02:23:45 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @techn0pia on GitHub (Nov 6, 2023).

The bug

Current state:

  • if I remove an external library, Thumbnails are remaining as "UNTRACKS FILES" in the /usr/src/app/upload/thumbs folder

Desired state:

  • if I remove an external library, Thumbnails should be cleaned automatically or via "Repair" button
image

The OS that Immich Server is running on

Ubuntu 22.10

Version of Immich Server

v1.84.0

Version of Immich Mobile App

no app used

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ["start.sh", "immich"]
    volumes:
      - /usb/immich/upload:/usr/src/app/upload
      - /usb/nextcloud/data/sebastian/files/Photos:/mnt/media/Photos:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
      - typesense
    restart: always
    networks:
     immich-backbone: 
     immich-proxy:       
    extra_hosts:
     - "download.geonames.org:172.23.0.101"      
  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: ["start.sh", "microservices"]
    volumes:
      - /usb/immich/upload:/usr/src/app/upload
      - /usb/nextcloud/data/user/files/Photos:/mnt/media/Photos:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
      - typesense
    restart: always
    networks:
     immich-backbone: 
     immich-proxy:
    extra_hosts:
     - "download.geonames.org:172.23.0.101" 
  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - /data/immich/model-cache:/cache
    env_file:
      - stack.env
    restart: always
    networks:
     immich-backbone: 
     immich-proxy:
    extra_hosts:
     - "download.geonames.org:172.23.0.101"           
  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - stack.env
    restart: always
    networks:
     immich-backbone:
     immich-proxy:     
    extra_hosts:
     - "download.geonames.org:172.23.0.101" 
  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - /data/immich/tsdata:/data    
    restart: always
    networks:
     immich-backbone: 
     
  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always
    networks:
     immich-backbone: 
     
  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - /data/immich/postgresql:/var/lib/postgresql/data
    restart: always
    networks:
     immich-backbone: 

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    depends_on:
      - immich-server
      - immich-web
    restart: always
    networks:
     immich-backbone: 
     immich-proxy:
    
networks:
  immich-backbone:
   external: true
  immich-proxy:
   name: immich-proxy
   external: true

Your .env content

IMMICH_VERSION=release

Reproduction steps

- setting up external library for a user, e.g. /mnt/media/Photos
- deleting external library via GUI
- Thumbnails generated for the external library are now "UNTRACKS FILES" and cannot be repaired via GUI

Additional information

No response

Originally created by @techn0pia on GitHub (Nov 6, 2023). ### The bug Current state: - if I remove an external library, Thumbnails are remaining as "UNTRACKS FILES" in the /usr/src/app/upload/thumbs folder Desired state: - if I remove an external library, Thumbnails should be cleaned automatically or via "Repair" button <img width="671" alt="image" src="https://github.com/immich-app/immich/assets/119968680/120253e3-9790-4c4c-9cc3-2c03db25bb01"> ### The OS that Immich Server is running on Ubuntu 22.10 ### Version of Immich Server v1.84.0 ### Version of Immich Mobile App no app used ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: ["start.sh", "immich"] volumes: - /usb/immich/upload:/usr/src/app/upload - /usb/nextcloud/data/sebastian/files/Photos:/mnt/media/Photos:ro - /etc/localtime:/etc/localtime:ro env_file: - stack.env depends_on: - redis - database - typesense restart: always networks: immich-backbone: immich-proxy: extra_hosts: - "download.geonames.org:172.23.0.101" immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: ["start.sh", "microservices"] volumes: - /usb/immich/upload:/usr/src/app/upload - /usb/nextcloud/data/user/files/Photos:/mnt/media/Photos:ro - /etc/localtime:/etc/localtime:ro env_file: - stack.env depends_on: - redis - database - typesense restart: always networks: immich-backbone: immich-proxy: extra_hosts: - "download.geonames.org:172.23.0.101" immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - /data/immich/model-cache:/cache env_file: - stack.env restart: always networks: immich-backbone: immich-proxy: extra_hosts: - "download.geonames.org:172.23.0.101" immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - stack.env restart: always networks: immich-backbone: immich-proxy: extra_hosts: - "download.geonames.org:172.23.0.101" typesense: container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - TYPESENSE_DATA_DIR=/data # remove this to get debug messages - GLOG_minloglevel=1 volumes: - /data/immich/tsdata:/data restart: always networks: immich-backbone: redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always networks: immich-backbone: database: container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 env_file: - stack.env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - /data/immich/postgresql:/var/lib/postgresql/data restart: always networks: immich-backbone: immich-proxy: container_name: immich_proxy image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release} environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL depends_on: - immich-server - immich-web restart: always networks: immich-backbone: immich-proxy: networks: immich-backbone: external: true immich-proxy: name: immich-proxy external: true ``` ### Your .env content ```Shell IMMICH_VERSION=release ``` ### Reproduction steps ```bash - setting up external library for a user, e.g. /mnt/media/Photos - deleting external library via GUI - Thumbnails generated for the external library are now "UNTRACKS FILES" and cannot be repaired via GUI ``` ### Additional information _No response_
Author
Owner

@davidpan commented on GitHub (Nov 7, 2023):

The thumbnail section does not differentiate between external libraries and the directory structure, which makes retrieving and deleting thumbnail images for external libraries a laborious and time-consuming task.

I added around 500GB of external libraries myself, which resulted in a lengthy database cleanup process when I removed them.

Organizing external libraries into separate subdirectories, similar to the current single user directory, simplifies the program's disk file management process when removing said libraries.

@davidpan commented on GitHub (Nov 7, 2023): The thumbnail section does not differentiate between external libraries and the directory structure, which makes retrieving and deleting thumbnail images for external libraries a laborious and time-consuming task. I added around 500GB of external libraries myself, which resulted in a lengthy database cleanup process when I removed them. Organizing external libraries into separate subdirectories, similar to the current single user directory, simplifies the program's disk file management process when removing said libraries.
Author
Owner

@nodis commented on GitHub (Nov 8, 2023):

I strongly support this suggestion and can consider giving each external library a thumbnail directory

@nodis commented on GitHub (Nov 8, 2023): I strongly support this suggestion and can consider giving each external library a thumbnail directory
Author
Owner

@traktuner commented on GitHub (Nov 13, 2023):

I second this.
I also added a huge external library and removed it. The thumbnail folder is now very large - having a cleaning job which gets rid of unneccesary thumbnails would be golden!

@traktuner commented on GitHub (Nov 13, 2023): I second this. I also added a huge external library and removed it. The thumbnail folder is now very large - having a cleaning job which gets rid of unneccesary thumbnails would be golden!
Author
Owner

@Philshappy commented on GitHub (Nov 15, 2023):

I third this. I noticed the same issue. I usually add a large number of photos using an external library and after review delete photos of no interest. The 2 thumbnails per photo remain in the thumbnail library so it would be really nice for an option to remove them.

@Philshappy commented on GitHub (Nov 15, 2023): I third this. I noticed the same issue. I usually add a large number of photos using an external library and after review delete photos of no interest. The 2 thumbnails per photo remain in the thumbnail library so it would be really nice for an option to remove them.
Author
Owner

@Esokrates commented on GitHub (Nov 30, 2023):

I'm also in the same boat. What is even worse than the thumnails is the transcoded videos which take up huge amounts of space. So I'd also strongly vote for having external libraries thumbnails and transcoded videos to land in their dedicated sub directory which can be cleared when removing the library.

@Esokrates commented on GitHub (Nov 30, 2023): I'm also in the same boat. What is even worse than the thumnails is the transcoded videos which take up huge amounts of space. So I'd also strongly vote for having external libraries thumbnails and transcoded videos to land in their dedicated sub directory which can be cleared when removing the library.
Author
Owner

@jrasm91 commented on GitHub (Dec 1, 2023):

We should just fix the bug and properly clean them up on delete.

@jrasm91 commented on GitHub (Dec 1, 2023): We should just fix the bug and properly clean them up on delete.
Author
Owner

@talan-z commented on GitHub (Jan 6, 2024):

Another reason for a separate external library directory: I do share one external library across 2 users. At the moment, each user generates its own thumbnails. This should be only be done once per library and not by user.

@talan-z commented on GitHub (Jan 6, 2024): Another reason for a separate external library directory: I do share one external library across 2 users. At the moment, each user generates its own thumbnails. This should be only be done once per library and not by user.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1571