Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 3 tasks
bettimms opened this issue Apr 23, 2024 · 1 comment
Closed
2 of 3 tasks

Comments

@bettimms
Copy link

bettimms commented 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

@bettimms
Copy link
Author

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

bo0tzz added a commit that referenced this issue Apr 23, 2024
We've already had a case in #9033 of someone forgetting to change it and losing the data on reboot.
alextran1502 pushed a commit that referenced this issue Apr 23, 2024
We've already had a case in #9033 of someone forgetting to change it and losing the data on reboot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant