immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.98k stars 2.18k forks source link

External libraries scan not working properly #9440

Closed JoostdeJonge123 closed 4 months ago

JoostdeJonge123 commented 4 months ago

The bug

Hi, I've Immich running as I want at the moment, but I'm running into an issue. I want to use my existing photo library via External Library, which is based on an external device.

When entering the path as //mnt/foto/2023 everything is working perfectly When entering the past as //mnt/foto it is not scanning (jobs stay empty)

With CLI to //mnt/foto I can perfectly see all sub folders, also with all the files inside.

Any help is appreciated. (not sure if this is a bug)

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.103.1

Version of Immich Mobile App

not used

Platform with the issue

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

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
      - /etc/localtime:/etc/localtime:ro
      - fotoopz:/mnt/foto
    env_file:
      - stack.env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    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: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - fotoopz:/mnt/foto
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
    restart: always

  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}
    # 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, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
      - fotoopz:/mnt/foto
    env_file:
      - stack.env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
      - fotoopz:/mnt/foto
    restart: always

volumes:
  model-cache:

  fotoopz:
    driver: local
    driver_opts:
      type: cifs
      device: //192.168.1.10/foto
      o: username=foto,password=xxxx,uid=1000,gid=1000,vers=2.1

Your .env content

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

Reproduction steps

1. create external library with mounting to //mnt/foto, scanning will not work
2. create external library with moundint to //mnt/foto/2023 (or any other folder), is working perfectly
3.
...

Relevant log output

No response

Additional information

No response

alextran1502 commented 4 months ago

Do you have a double forward slash in your path? I think it should be single forward slash i.e. /mnt/foto

JoostdeJonge123 commented 4 months ago

Oops, typo in my bug report. I use "/mnt/foto" in Immich....

JoostdeJonge123 commented 4 months ago

Looking into logfiles, I get the error "Error: ENOSPC: System limit for number of file watchers reached" that perhaps gives some ideas?

alextran1502 commented 4 months ago

Yep, you will have to increase the number of max file watch on your system https://stackoverflow.com/questions/53930305/nodemon-error-system-limit-for-number-of-file-watchers-reached

JoostdeJonge123 commented 4 months ago

(thanks for your quick replies) What limit should I use, increasing to 131070 does not directly fix it...