#how to set file path to a external library in Windows

1 messages ยท Page 1 of 1 (latest)

merry matrix
#

Hi, I am new to docker and immich and want to add the file path "L:\immPhoto" as a read only external library.
Following are my configuration files:

docker-compose.yml

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
      - L:\immPhoto:/L/immPhoto:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .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:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - L:\immPhoto:/L/immPhoto:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env

I did the following in Web Interface:
Settings -> Libraries -> Create External Library -> Import Path "L:\immPhoto"

I am getting the following error when i press Scan all Libraries: "WARN [LibraryService] User has no external path set, cannot refresh library" Thanks ๐Ÿ™‚

empty stirrupBOT
#

:wave: Hey @merry matrix,

Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich immich.

References

Checklist

  1. :blue_square: I have verified I'm on the latest release(note that mobile app releases may take some time).
  2. :blue_square: I have read applicable release notes.
  3. :blue_square: I have reviewed the FAQs for known issues.
  4. :blue_square: I have reviewed Github for known issues.
  5. :blue_square: I have tried accessing Immich via local ip (without a custom reverse proxy).
  6. :blue_square: I have uploaded the relevant logs, docker compose, and .env files using the buttons below or the /upload command.
  7. :blue_square: I have tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable

(an item can be marked as "complete" by reacting with the appropriate number)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

merry matrix
#

Update:
I have added the path to the User directory (see Image below) and the error "WARN [LibraryService] User has no external path set, cannot refresh library" is gone but unfortunately the pictures in the external library/path are still not getting scanned.

shy warren
#

try a more common linux path L:\immPhoto:/mnt/media:ro

merry matrix
#

@shy warren Thank you for the fast reply. i added "L:\immPhoto:/mnt/media:ro" in the "docker-compose.yml" config under server & microservices.
In Web UI:

  1. Admin -> User ->External Path -> L:\
  2. User -> Acoount Settings -> Libraries -> Create External Library -> Import Path "L:\immPhoto"
    Unfortunately its still showing 0 assets
    below is an extract from the container shell:
root@abc:/usr/src/app# ls L:/immPhoto
ls: cannot access 'L:/immPhoto': No such file or directory
#

I really appreciate your help

shy warren
#

the user's external path will be /mnt/media instead of L:/...

#

user /mnt/media for both user's external path and the library path

merry matrix
#

@shy warren Unfortunately it still cannot access the directory

shy warren
#

Can you go into the server's container shell and do lsblk

merry matrix
#
root@50cf5cd9527f:/usr/src/app# lsblk
NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0   7:0    0 459.6M  1 loop
loop1   7:1    0 290.2M  1 loop
loop2   7:2    0 697.4M  1 loop
sda     8:0    0 389.8M  1 disk
sdb     8:16   0     2G  0 disk [SWAP]
sdc     8:32   0     1T  0 disk
sdd     8:48   0     1T  0 disk /etc/hosts
                                /etc/hostname
                                /etc/resolv.conf
sde     8:64   0     1T  0 disk /usr/share/zoneinfo/Etc/UTC
shy warren
#

Have you restart the stack after change the docker-compose file?

merry matrix
#

yes

#

here are the config:

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
      - L:\immPhoto:/mnt/media:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .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:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - L:\immPhoto:/mnt/media:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always
shy warren
#

ok, let stop the stack/containers

#

then restart it

merry matrix
#

no, it did not help

#

so, i think i have found a partial cause of the problem. Till now i was restarting the containers from the docker desktop GUI but i when i try to restart the contrainers using using docker compose cmd it says:

[+] Running 3/5
 โœ” Container immich_postgres          Created                                                                      0.0s
 โœ” Container immich_machine_learning  Created                                                                      0.0s
 โœ” Container immich_redis             Created                                                                      0.0s
 โ ‹ Container immich_server            Recreate                                                                     0.1s
 โ ‹ Container immich_microservices     Recreate                                                                     0.1s
Error response from daemon: invalid volume specification: 'L:\immPhoto:/mnt/media:ro'
shy warren
#

you have the extra ' somewhere in the compose file

merry matrix
shy warren
#

try with just L:\immPhoto:/mnt/media:ro

merry matrix
#

i will try again tomorrow

#
[+] Running 3/5
 โœ” Container immich_postgres          Created                                                                      0.0s
 โœ” Container immich_machine_learning  Created                                                                      0.0s
 โœ” Container immich_redis             Created                                                                      0.0s
 โ ‹ Container immich_server            Recreate                                                                     0.1s
 โ ‹ Container immich_microservices     Recreate                                                                     0.1s
Error response from daemon: invalid volume specification: 'L:\immPhoto:/mnt/media:ro' 
shy warren
#

Can you try "L:\immPhoto:/mnt/media:ro"

cloud horizon
#

Try using forward slashes instead of backwards ones for the windows drive path

merry matrix
#

I found the issue I was trying to launch the container from Ubuntu bash (Which does not work). Today I tried launching the immich container using windows Powershell and it works.
Thankyou @shy warren @cloud horizon for your assistance and time.