immich-app / immich

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

[BUG] v.1.57.1 broke the docker compose - file paths changed #2538

Closed Maulwurf16 closed 1 year ago

Maulwurf16 commented 1 year ago

The bug

In v.1.57.0 everything worked. I did an upgrade to v.1.57.1 and left my docker compose file as is. Now the directories seem to be broken.

Here is a part of my micro services log file - see that it searches for the images at upload/upload/imagefile.... There is one "upload" to many. I am using the exakt same docker compose file as in v1.57.0 where it worked fine

[Nest] 1  - 05/23/2023, 5:11:31 PM    WARN [MetadataExtractionProcessor] Unable to run reverse geocoding due to Error: EACCES: permission denied, mkdir '/usr/src/app/node_modules/local-reverse-geocoder/geonames_dump' for asset 92ceecd0-3f1a-4185-81b9-d9f7344c3896 at upload/upload/61ec5320-1d8a-4421-a0d8-cc4f0e70d5e5/5673d8fa-7370-48c1-aa62-7f73ca5ba69c.HEIC

The OS that Immich Server is running on

Synology DSM 7.2

Version of Immich Server

v.157.1

Version of Immich Mobile App

1.57.0

Platform with the issue

Your docker-compose.yml content

version: "3.9"
services:
  immich-redis:
    image: redis
    container_name: Immich-redis
    hostname: immich-redis
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    user: 1026:100
    environment:
      - TZ=Europe/Berlin
    volumes:
      - /volume1/docker/immich/redis:/data
    restart: always

  immich-db:
    image: postgres
    container_name: Immich-db
    hostname: immich-db
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "immich", "-U", "immichuser"]
      interval: 10s
      timeout: 5s
      retries: 5
    user: 1026:100
    volumes:
      - /volume1/docker/immich/db:/var/lib/postgresql/data
    environment:
      - TZ=Europe/Berlin
      - POSTGRES_DB=immich
      - POSTGRES_USER=immichuser
      - POSTGRES_PASSWORD=immichpw
    restart: always

  immich-server:
    image: altran1502/immich-server:release
    entrypoint: ["/bin/sh", "./start-server.sh"]
    container_name: Immich-server
    hostname: immich-server
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    volumes:
      - /volume1/docker/immich/upload:/usr/src/app/upload
    restart: always
    depends_on:
      immich-redis:
        condition: service_healthy
      immich-db:
        condition: service_started
      typesense:
        condition: service_started

  immich-microservices:
    image: altran1502/immich-server:release
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    container_name: Immich-microservices
    hostname: immich-microservices
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    volumes:
      - /volume1/docker/immich/upload:/usr/src/app/upload
      - /volume1/docker/immich/micro:/usr/src/app/.reverse-geocoding-dump
    restart: always
    depends_on:
      immich-redis:
        condition: service_healthy
      immich-db:
        condition: service_started
      typesense:
        condition: service_started

  immich-machine-learning:
    image: altran1502/immich-machine-learning:release
    container_name: Immich-learning
    hostname: immich-machine-learning
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    volumes:
      - /volume1/docker/immich/upload:/usr/src/app/upload
      - /volume1/docker/immich/cache:/cache
    restart: always
    depends_on:
      immich-db:
        condition: service_started

  immich-web:
    image: altran1502/immich-web:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    container_name: Immich-web
    hostname: immich-web
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
    env_file:
      - stack.env
    restart: always
    depends_on:
      - immich-server

  immich-proxy:
    image: altran1502/immich-proxy:release
    logging:
      driver: none
    container_name: Immich-proxy
    hostname: immich-proxy
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: curl -f http://localhost:8080/ || exit 1
    environment:
      - IMMICH_SERVER_URL=http://immich-server:3001
      - IMMICH_WEB_URL=http://immich-web:3000
    ports:
      - 8212:8080
    restart: always
    depends_on:
      - immich-server

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.0
    environment:
      - TYPESENSE_API_KEY=MariushostingMariushostingMari13
      - TYPESENSE_DATA_DIR=/data
    logging:
      driver: none
    volumes:
      - /volume1/docker/immich/typesense:/data
    restart: always

Your .env content

not necessary?

Reproduction steps

1. Use v1.57.0 -> Yay !
2. Upgrade to v1.57.1
3. The Docker Compose now does not work anymore, as the file paths changed
...

Additional information

No response

alextran1502 commented 1 year ago

That is the relative file path, and it looks correct. I suspect your mount has an issue. Can you please restart the stack and attach to the microservices shell and check if there is content in the upload directory?

michelheusschen commented 1 year ago

Looks like the same issue as #2528

Maulwurf16 commented 1 year ago

Thank you for your very fast responses.

Indeed, the file path seems to be correct:

Bildschirmfoto 2023-05-23 um 17 36 42

Also I rebooted the Stack and my micro services Container also says:

[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [NestFactory] Starting Nest application...
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +68ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] BullModule dependencies initialized +1ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] ConfigModule dependencies initialized +15ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +240ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] InfraModule dependencies initialized +14ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] DomainModule dependencies initialized +0ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [InstanceLoader] MicroservicesModule dependencies initialized +1ms
[Nest] 1  - 05/23/2023, 5:29:57 PM    WARN [MetadataExtractionProcessor] Reverse geocoding is enabled
[Nest] 1  - 05/23/2023, 5:29:57 PM   ERROR [MetadataExtractionProcessor] Unable to initialize reverse geocoding: Error: EACCES: permission denied, rmdir '/usr/src/app/.reverse-geocoding-dump/'
Error: EACCES: permission denied, rmdir '/usr/src/app/.reverse-geocoding-dump/'
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [NestApplication] Nest application successfully started +61ms
[Nest] 1  - 05/23/2023, 5:29:57 PM     LOG [ImmichMicroservice] Running Immich Microservices in PRODUCTION environment - version 1.57.1 - Listening on port: 3002

So it really is a problem with the reverse geocoding

alextran1502 commented 1 year ago

I think the .reverse-geocoding-dump is mounted as root that is why you cannot remove it with your GUID and UID 🤔

jrasm91 commented 1 year ago

Maybe we should delete all the files in the directory, instead of deleting the directory itself, which could be a mount.

atifarkas commented 1 year ago

Hi I have a same broken library. I use e: drive for librarys on windows. In docker the mnt\host\e use unknow mount source. How can set back to my or pc e drive? .env and docker-compose.yml file are the same.

image
Maulwurf16 commented 1 year ago

I updated to 1.58.0 and am very happy to say that #2551 seemed to fix the problem - everything works again fine as expected.

@jrasm91 thank you very much