[BUG] External libraries not read depending on account external path #1377

Closed
opened 2026-02-05 01:33:13 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @Rihcus on GitHub (Sep 26, 2023).

The bug

Recently when trying immich I noitced when my account external path was set to /mnt/media/ the internal library /mnt/media/Camera wasn't being detected.

When changed /mnt/media/ to /mnt/media (removing the backslash) the external library was properly detected.

SCR-20230925-ubqz

The OS that Immich Server is running on

macOS 12.6.2 21G320 x86_64

Version of Immich Server

v1.79.1

Version of Immich Mobile App

N/A

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:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /Volumes/MACHD/PhotoLibrary/Library/Photos/Oneplus8/OP8_Camera_Backup/Camera:/mnt/media/Camera:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  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:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /Volumes/MACHD/PhotoLibrary/Library/Photos/Oneplus8/OP8_Camera_Backup/Camera:/mnt/media/Camera:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: always

  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:
      - tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  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
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

Your .env content

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

# The location where your uploaded files are stored
UPLOAD_LOCATION=/Volumes/MACHD/PhotoLibrary/immich-upload

# 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
TYPESENSE_API_KEY=some-random-text
DB_PASSWORD=postgres

# 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

Reproduction steps

1. Set the external path in account to /mnt/media/
2. Create a new external library set it to /mnt/media/Camera
3. Scan the external library (no files detected)
4. Change external path in account to /mnt/media/ to /mnt/media
5. Rescan the external library and files are detected
...

Additional information

No response

Originally created by @Rihcus on GitHub (Sep 26, 2023). ### The bug Recently when trying immich I noitced when my account external path was set to /mnt/media/ the internal library /mnt/media/Camera wasn't being detected. When changed /mnt/media/ to /mnt/media (removing the backslash) the external library was properly detected. ![SCR-20230925-ubqz](https://github.com/immich-app/immich/assets/30292597/477b9add-63d0-4dab-a7b1-9f8a3e158f31) ### The OS that Immich Server is running on macOS 12.6.2 21G320 x86_64 ### Version of Immich Server v1.79.1 ### Version of Immich Mobile App N/A ### 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: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /Volumes/MACHD/PhotoLibrary/Library/Photos/Oneplus8/OP8_Camera_Backup/Camera:/mnt/media/Camera:ro env_file: - .env depends_on: - redis - database - typesense restart: always 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: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /Volumes/MACHD/PhotoLibrary/Library/Photos/Oneplus8/OP8_Camera_Backup/Camera:/mnt/media/Camera:ro env_file: - .env depends_on: - redis - database - typesense restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: always immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: always 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: - tsdata:/data restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data restart: always 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 ports: - 2283:8080 depends_on: - immich-server - immich-web restart: always volumes: pgdata: model-cache: tsdata: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/Volumes/MACHD/PhotoLibrary/immich-upload # 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 TYPESENSE_API_KEY=some-random-text DB_PASSWORD=postgres # 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 ``` ### Reproduction steps ```bash 1. Set the external path in account to /mnt/media/ 2. Create a new external library set it to /mnt/media/Camera 3. Scan the external library (no files detected) 4. Change external path in account to /mnt/media/ to /mnt/media 5. Rescan the external library and files are detected ... ``` ### Additional information _No response_
Author
Owner

@etnoy commented on GitHub (Sep 26, 2023):

Maybe related to #4239

@etnoy commented on GitHub (Sep 26, 2023): Maybe related to #4239
Author
Owner

@ohjables commented on GitHub (Oct 5, 2023):

I have mounted /mnt/media/photos in both the microservice and the server, set my external path to /mnt/media/photos/jake and then added an external library with a couple paths pointing to /mnt/media/photos/jake/jake-google and a few others. I've logged into the containers and can browse to these directories, but when i scan these directories, nothing shows up. There isnt anything in the logs either. There are a lot of files in these directories (like 4-600k photos and videos) so i assume it'll take a while to get through them all, but i dont see anything in the logs, and all the counts show 0. Would this happen to be related to #4239 as well or is something else up?

@ohjables commented on GitHub (Oct 5, 2023): I have mounted `/mnt/media/photos` in both the microservice and the server, set my external path to `/mnt/media/photos/jake` and then added an external library with a couple paths pointing to `/mnt/media/photos/jake/jake-google` and a few others. I've logged into the containers and can browse to these directories, but when i scan these directories, nothing shows up. There isnt anything in the logs either. There are a lot of files in these directories (like 4-600k photos and videos) so i assume it'll take a while to get through them all, but i dont see anything in the logs, and all the counts show 0. Would this happen to be related to #4239 as well or is something else up?
Author
Owner

@mahdi1234 commented on GitHub (Oct 6, 2023):

I'm facing same problem, it seems to scan only two libraries and then nothing more. I even went from multiple mount points to single to make sure there's no typo. Cannot see any logs anywhere, if there's something to look for let me know.

@mahdi1234 commented on GitHub (Oct 6, 2023): I'm facing same problem, it seems to scan only two libraries and then nothing more. I even went from multiple mount points to single to make sure there's no typo. Cannot see any logs anywhere, if there's something to look for let me know.
Author
Owner

@alextran1502 commented on GitHub (Oct 6, 2023):

I'm facing same problem, it seems to scan only two libraries and then nothing more. I even went from multiple mount points to single to make sure there's no typo. Cannot see any logs anywhere, if there's something to look for let me know.

@mahdi1234 Do you mind sharing the screenshot of the mount paths in docker-compose, admin panel and user setting?

@alextran1502 commented on GitHub (Oct 6, 2023): > I'm facing same problem, it seems to scan only two libraries and then nothing more. I even went from multiple mount points to single to make sure there's no typo. Cannot see any logs anywhere, if there's something to look for let me know. @mahdi1234 Do you mind sharing the screenshot of the mount paths in docker-compose, admin panel and user setting?
Author
Owner

@mahdi1234 commented on GitHub (Oct 6, 2023):

@alextran1502 sure, here's what I use

docker

cat ./docker-compose.yml | grep mi9
      - /mnt/NAS/samba/mi9_sync:/mnt/media:ro
      - /mnt/NAS/samba/mi9_sync:/mnt/media:ro

admin external path

/mnt/media

user libraries

/mnt/media/photo_mido/archive/2022 - works
/mnt/media/photo_mido/archive/2023 - works
/mnt/media/photo/archive/2020 - doesn't work

real FS

ls -la /mnt/NAS/samba/mi9_sync/
  3 mahdi mahdi 126976 Oct  4 14:59 photo
  3 mahdi mahdi  32768 Oct  1 15:18 photo_mido
ls -la /mnt/NAS/samba/mi9_sync/photo/archive/
 2 mahdi mahdi  98304 Oct 16  2022 2020
 2 mahdi mahdi 135168 Jun 25  2022 2021
 2 mahdi mahdi 114688 Feb 18  2023 2022
 2 mahdi mahdi  81920 Jul 20 15:20 2023

hopefully no stupid typo :)

@mahdi1234 commented on GitHub (Oct 6, 2023): @alextran1502 sure, here's what I use docker ``` cat ./docker-compose.yml | grep mi9 - /mnt/NAS/samba/mi9_sync:/mnt/media:ro - /mnt/NAS/samba/mi9_sync:/mnt/media:ro ``` admin external path `/mnt/media` user libraries ``` /mnt/media/photo_mido/archive/2022 - works /mnt/media/photo_mido/archive/2023 - works /mnt/media/photo/archive/2020 - doesn't work ``` real FS ``` ls -la /mnt/NAS/samba/mi9_sync/ 3 mahdi mahdi 126976 Oct 4 14:59 photo 3 mahdi mahdi 32768 Oct 1 15:18 photo_mido ``` ``` ls -la /mnt/NAS/samba/mi9_sync/photo/archive/ 2 mahdi mahdi 98304 Oct 16 2022 2020 2 mahdi mahdi 135168 Jun 25 2022 2021 2 mahdi mahdi 114688 Feb 18 2023 2022 2 mahdi mahdi 81920 Jul 20 15:20 2023 ``` hopefully no stupid typo :)
Author
Owner

@etnoy commented on GitHub (Oct 6, 2023):

Try to enter the immich-server container and run ls -ls /mnt/media/photo/archive/2020

@etnoy commented on GitHub (Oct 6, 2023): Try to enter the immich-server container and run ls -ls /mnt/media/photo/archive/2020
Author
Owner

@mahdi1234 commented on GitHub (Oct 6, 2023):

@etnoy it was giving permission denied ... I had to set it to 775 i.e. giving (extra to before) both Read and Execute to Other. Not sure this is how it should be or not. Now adding library anew it started indexing. Alone adding Read did not help.

@mahdi1234 commented on GitHub (Oct 6, 2023): @etnoy it was giving permission denied ... I had to set it to 775 i.e. giving (extra to before) both Read and Execute to Other. Not sure this is how it should be or not. Now adding library anew it started indexing. Alone adding Read did not help.
Author
Owner

@etnoy commented on GitHub (Oct 7, 2023):

Correct, a directory needs to have the execute bit set for you to read it.

Glad you got it working!

@etnoy commented on GitHub (Oct 7, 2023): Correct, a directory needs to have the execute bit set for you to read it. Glad you got it working!
Author
Owner

@mahdi1234 commented on GitHub (Oct 7, 2023):

Maybe adding this info about folder rights here https://immich.app/docs/features/libraries might help others? And thanks for help.

@mahdi1234 commented on GitHub (Oct 7, 2023): Maybe adding this info about folder rights here https://immich.app/docs/features/libraries might help others? And thanks for help.
Author
Owner

@etnoy commented on GitHub (Oct 7, 2023):

It's assumed that permissions are set correctly. I'll add a comment about troubleshooting by going into the container

@etnoy commented on GitHub (Oct 7, 2023): It's assumed that permissions are set correctly. I'll add a comment about troubleshooting by going into the container
Author
Owner

@etnoy commented on GitHub (Oct 7, 2023):

PR up: https://github.com/immich-app/immich/pull/4377

@etnoy commented on GitHub (Oct 7, 2023): PR up: https://github.com/immich-app/immich/pull/4377
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1377