Everything gets lost after shut down of NAS device (External Library only) #3008

Closed
opened 2026-02-05 07:24:01 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @bettimms on GitHub (Apr 23, 2024).

The bug

Once i shut down the device, everything related to external libraries gets lost and the process is reset.

The OS that Immich Server is running on

Portainer CE

Version of Immich Server

v1.102.3

Version of Immich Mobile App

v1.102.0 build.148

Platform with the issue

  • Server
  • Web
  • Mobile

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
      - ${EXTERNAL_PATH}:/usr/src/app/external
    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
      - ${EXTERNAL_PATH}:/usr/src/app/external
    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
    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
    restart: always

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/home/ImmichPhotos
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
DB_DATA_LOCATION=./postgres
REDIS_HOSTNAME=immich_redis
EXTERNAL_PATH=/home/myname/MyPhoto

Reproduction steps

1. I'm running this in Flashstor NAS device and using Portainer CE to deploy. Currently I'm using only with "External libraries".
Everything synchronises and I see all the photos loaded from External Library and everything seems as expected. 
2. I shut down the NAS device.
3. When I turn it ON again, everything is gone and it takes me from "Get Started" button where I've to create again the user and setup everything from scratch and run the jobs.


PS: I set upload location outside the container to utilize the full NAS space and to not be depended on container. My doubts are on db location maybe shall be set the same as upload location.

Relevant log output

No response

Additional information

No response

Originally created by @bettimms on GitHub (Apr 23, 2024). ### The bug Once i shut down the device, everything related to external libraries gets lost and the process is reset. ### The OS that Immich Server is running on Portainer CE ### Version of Immich Server v1.102.3 ### Version of Immich Mobile App v1.102.0 build.148 ### Platform with the issue - [x] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # 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 - ${EXTERNAL_PATH}:/usr/src/app/external 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 - ${EXTERNAL_PATH}:/usr/src/app/external 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 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 restart: always volumes: model-cache: ``` ### Your .env content ```Shell UPLOAD_LOCATION=/home/ImmichPhotos IMMICH_VERSION=release DB_PASSWORD=postgres DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich DB_DATA_LOCATION=./postgres REDIS_HOSTNAME=immich_redis EXTERNAL_PATH=/home/myname/MyPhoto ``` ### Reproduction steps ```bash 1. I'm running this in Flashstor NAS device and using Portainer CE to deploy. Currently I'm using only with "External libraries". Everything synchronises and I see all the photos loaded from External Library and everything seems as expected. 2. I shut down the NAS device. 3. When I turn it ON again, everything is gone and it takes me from "Get Started" button where I've to create again the user and setup everything from scratch and run the jobs. PS: I set upload location outside the container to utilize the full NAS space and to not be depended on container. My doubts are on db location maybe shall be set the same as upload location. ``` ### Relevant log output _No response_ ### Additional information _No response_
Author
Owner

@bettimms commented on GitHub (Apr 23, 2024):

Seems the problem is as I anticipated. The database location should be in the same level with upload location.
Changing .env as below solved the issue:

UPLOAD_LOCATION=/home/ImmichPhotos
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
DB_DATA_LOCATION=/home/ImmichPhotos/postgres
REDIS_HOSTNAME=immich_redis
EXTERNAL_PATH=/home/myname/MyPhoto
@bettimms commented on GitHub (Apr 23, 2024): Seems the problem is as I anticipated. The database location should be in the same level with upload location. Changing .env as below solved the issue: ``` UPLOAD_LOCATION=/home/ImmichPhotos IMMICH_VERSION=release DB_PASSWORD=postgres DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich DB_DATA_LOCATION=/home/ImmichPhotos/postgres REDIS_HOSTNAME=immich_redis EXTERNAL_PATH=/home/myname/MyPhoto ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3008