imagegenius / docker-immich

Monolithic (Single) Docker Container for Immich
GNU General Public License v3.0
612 stars 27 forks source link

Unable to import external libraries #253

Closed bloodyburger closed 10 months ago

bloodyburger commented 11 months ago

Installed docker and started immich via docker compose. Mounted external library which is mounted via rclone in host machine. I can see the files inside immich docker at /import but when I add them in UI doesn't recognise any files.

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
      - /mnt/hh10tb/od1:/import
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    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
      - /etc/localtime:/etc/localtime:ro
      - /mnt/hh10tb/od1:/import
    env_file:
      - .env
    depends_on:
      - redis
 #     - database
      - typesense
    restart: always

I have added the path /import in admin settings and using the same path in profile page as well. What am I missing?

martabal commented 11 months ago

Make sure you have the correct permissions

bloodyburger commented 11 months ago

I am able to see the files within immich docker, does that not tell the permissions are ok? or do I have to check anything else?

martabal commented 11 months ago

Nope, it does not mean your permissions are ok. Set the same permissions for /import as the files in /photos

bloodyburger commented 11 months ago

I do not see any /photos

martabal commented 11 months ago

Oh wait, I just realized, you're not using the AIO image; I don't think it's a permission issue then. Did you correctly follow the instructions in the README ?

bloodyburger commented 11 months ago

you may be right, I used the docker-compose from official site, let me try replacing with this one.

bloodyburger commented 11 months ago

I used the below docker-compose but why am I seeing no migrations found. I do not see any database created as well.

[mod-init] Attempting to run Docker Modification Logic
[mod-init] Adding imagegenius/mods:universal-redis to container
[mod-init] Downloading imagegenius/mods:universal-redis from registry-1.docker.io
[mod-init] Installing imagegenius/mods:universal-redis
[mod-init] imagegenius/mods:universal-redis applied to container
[migrations] started
[migrations] no migrations found

╔═══════════════════════════════╗
       __  _____ _____       __
      / / |_   _/ ____|     / /
     / /    | || |  __     / /
    / /     | || | |_ |   / /
   / /     _| || |__| |  / /
  /_/     |_____\_____| /_/

  Baseimage from linuxserver.io
╠═══════════════════════════════╣
  To support this applications developer(s) visit:
  Immich: https://immich.app/docs/overview/support-the-project
╠═══════════════════════════════╣
  User/Group ID:
  User UID: 1000
  User GID: 1000
╚═══════════════════════════════╝
---
version: "2.1"
services:
  immich:
    image: ghcr.io/imagegenius/immich:latest
    container_name: immich
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - DB_HOSTNAME=my_postgres
      - DB_USERNAME=postgres
      - DB_PASSWORD=12345678
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=localhost
      - DISABLE_MACHINE_LEARNING=false #optional
      - DISABLE_TYPESENSE=false #optional
      - DB_PORT=5432 #optional
      - REDIS_PORT=6379 #optional
      - REDIS_PASSWORD= #optional
      - MACHINE_LEARNING_WORKERS=4 #optional
      - MACHINE_LEARNING_WORKER_TIMEOUT=120 #optional
      - DOCKER_MODS=imagegenius/mods:universal-redis
    volumes:
      - ./config:/config
      - ./photos:/photos
      - ./ml:/config/machine-learning #optional
      - /mnt/hh10tb:/import:ro #optional
    ports:
      - 8080:8080
    restart: unless-stopped
# This container requires an external application to be run separately to be run separately.
# Redis:
  redis:
    image: redis
    ports:
      - 6379:6379
    container_name: redis

networks:
  default:
    external:
       name: charkoal
bloodyburger commented 11 months ago

I'm using SWAG to reverse proxy to this container

martabal commented 11 months ago

Yeah don't worry with what comes before the logo, the important part is what's after User GID: 1000. Everything looks good to me, is it working for you ?

bloodyburger commented 11 months ago

I know something is silly but can't get my mind to figure it out right now


2023/12/11 18:29:14 [error] 831#831: *1096 connect() failed (111: Connection refused) while connecting to upstream, client: 1.2.3.4, server: immich.*, request: "GET / HTTP/2.0", upstream: "http://172.18.0.24:8080/502.html", host: "immich.x.y"```
martabal commented 11 months ago

Can you try without your reverse proxy, directly with the ip address and port ?

bloodyburger commented 11 months ago

I tried on a new server and was able to start the server. But when I mount an external location, I do not see the message that the server started [Nest] 513 - 12/11/2023, 2:01:13 PM LOG [ImmichServer] Immich Server is listening on http://[::1]:8080 [v1.90.2] [PRODUCTION]. Does it take time if I mount an external folder with 1TB of images.

bloodyburger commented 11 months ago

It's the same on old server as well, if I remove the bind mount to external location, all works fine and able to access the UI once I see the message that the server is started. BUt once I add the external volume, the Immich Server doesn't start.

martabal commented 11 months ago

Weird, it's supposed to be instant. Make sure you use the latest docker version.

bloodyburger commented 11 months ago

I'm on latest and verified in 2 separate machines, it took a while to recognise the external mount which had lot of files and finally it booted. It's working now but if I restart the docker it will take 2-3 hours to start the server again.

bloodyburger commented 10 months ago

So it depends on the library size, I waited a bit longer and all good now.