[BUG] Change of Docker Root Folder & Immich #1726

Closed
opened 2026-02-05 03:23:22 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Artnal on GitHub (Dec 6, 2023).

The bug

Hi there,

Because of the space that /var/lib/docker was taking on the OS drive, I decided to move it to another drive. The process went fine, I took the approach to edit '/lib/systemd/system/docker.service' rather than create a symlink, as it seems to be a bad idea with docker.

This approach has worked fine for every container except Immich, which now refuses to lauch (worked perfectly before). The error message I get is the following:

Error response from daemon: error evaluating symlinks from mount source "/var/lib/docker/volumes/immich_tsdata/_data": lstat /var/lib/docker: no such file or directory

If I understand it correctly, the /var/lib/docker/ is hardcoded somewhere in the Immich config? How should I go about fixing this error?

Thanks a lot!

The OS that Immich Server is running on

Debian Bookworm

Version of Immich Server

1.89.0

Version of Immich Mobile App

1.89.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

#
# 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
    env_file:
      - .env
    ports:
      - [XXX]:3001
    depends_on:
      - redis
      - database
      - typesense
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    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
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - tsdata:/data
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:80cc8518800438c684a53ed829c621c94afd1087aaeb59b0d4343ed3e7bcf6c5
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:50d9be76e9a90da4c781554955e0ffc79d9d5c4226838e64b36aacc97cbc35ad
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=[XXX]

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=[XXX]
DB_PASSWORD=[XXX]

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=[XXX]

REDIS_HOSTNAME=immich_redis

# Optional Redis settings:

# Note: these parameters are not automatically passed to the Redis Container
# to do so, please edit the docker-compose.yml file as well. Redis is not configured
# via environment variables, only redis.conf or the command line

# REDIS_PORT=[XXX]
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Reverse Geocoding
#
# Reverse geocoding is done locally which has a small impact on memory usage
# This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable
# This ranges from 0-3 with 3 being the most precise
# 3 - Cities > 500 population: ~200MB RAM
# 2 - Cities > 1000 population: ~150MB RAM
# 1 - Cities > 5000 population: ~80MB RAM
# 0 - Cities > 15000 population: ~40MB RAM
####################################################################################

DISABLE_REVERSE_GEOCODING=false
REVERSE_GEOCODING_PRECISION=3

####################################################################################
# WEB - Optional
#
# Custom message on the login page, should be written in HTML form.

Reproduction steps

1. "sudo systemctl stop docker"
2. "sudo systemctl stop docker.socket"
3. "sudo mv /var/lib/docker [New Path]"
4. "sudo nano /lib/systemd/system/docker.service"
5. Edit "ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock" to "ExecStart=/usr/bin/dockerd --data-root [New Path] -H fd:// --containerd=/run/containerd/containerd.sock"
6. "sudo systemctl daemon-reload"
7. "sudo systemctl start docker"

Additional information

No response

Originally created by @Artnal on GitHub (Dec 6, 2023). ### The bug Hi there, Because of the space that /var/lib/docker was taking on the OS drive, I decided to move it to another drive. The process went fine, I took the approach to edit '/lib/systemd/system/docker.service' rather than create a symlink, as it seems to be a bad idea with docker. This approach has worked fine for every container except Immich, which now refuses to lauch (worked perfectly before). The error message I get is the following: > Error response from daemon: error evaluating symlinks from mount source "/var/lib/docker/volumes/immich_tsdata/_data": lstat /var/lib/docker: no such file or directory If I understand it correctly, the /var/lib/docker/ is hardcoded somewhere in the Immich config? How should I go about fixing this error? Thanks a lot! ### The OS that Immich Server is running on Debian Bookworm ### Version of Immich Server 1.89.0 ### Version of Immich Mobile App 1.89.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" # # 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 env_file: - .env ports: - [XXX]:3001 depends_on: - redis - database - typesense labels: - "com.centurylinklabs.watchtower.enable=false" 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 env_file: - .env depends_on: - redis - database - typesense labels: - "com.centurylinklabs.watchtower.enable=false" restart: always immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env labels: - "com.centurylinklabs.watchtower.enable=false" restart: always typesense: container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - TYPESENSE_DATA_DIR=/data # remove this to get debug messages - GLOG_minloglevel=1 volumes: - tsdata:/data labels: - "com.centurylinklabs.watchtower.enable=false" restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:80cc8518800438c684a53ed829c621c94afd1087aaeb59b0d4343ed3e7bcf6c5 labels: - "com.centurylinklabs.watchtower.enable=false" restart: always database: container_name: immich_postgres image: postgres:14-alpine@sha256:50d9be76e9a90da4c781554955e0ffc79d9d5c4226838e64b36aacc97cbc35ad env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data labels: - "com.centurylinklabs.watchtower.enable=false" restart: always volumes: pgdata: model-cache: tsdata: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=[XXX] # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secrets for postgres and typesense. You should change these to random passwords TYPESENSE_API_KEY=[XXX] DB_PASSWORD=[XXX] # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich # Optional Database settings: # DB_PORT=[XXX] REDIS_HOSTNAME=immich_redis # Optional Redis settings: # Note: these parameters are not automatically passed to the Redis Container # to do so, please edit the docker-compose.yml file as well. Redis is not configured # via environment variables, only redis.conf or the command line # REDIS_PORT=[XXX] # REDIS_DBINDEX=0 # REDIS_PASSWORD= # REDIS_SOCKET= ################################################################################### # Reverse Geocoding # # Reverse geocoding is done locally which has a small impact on memory usage # This memory usage can be altered by changing the REVERSE_GEOCODING_PRECISION variable # This ranges from 0-3 with 3 being the most precise # 3 - Cities > 500 population: ~200MB RAM # 2 - Cities > 1000 population: ~150MB RAM # 1 - Cities > 5000 population: ~80MB RAM # 0 - Cities > 15000 population: ~40MB RAM #################################################################################### DISABLE_REVERSE_GEOCODING=false REVERSE_GEOCODING_PRECISION=3 #################################################################################### # WEB - Optional # # Custom message on the login page, should be written in HTML form. ``` ### Reproduction steps ```bash 1. "sudo systemctl stop docker" 2. "sudo systemctl stop docker.socket" 3. "sudo mv /var/lib/docker [New Path]" 4. "sudo nano /lib/systemd/system/docker.service" 5. Edit "ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock" to "ExecStart=/usr/bin/dockerd --data-root [New Path] -H fd:// --containerd=/run/containerd/containerd.sock" 6. "sudo systemctl daemon-reload" 7. "sudo systemctl start docker" ``` ### Additional information _No response_
Author
Owner

@Artnal commented on GitHub (Dec 6, 2023):

nvm, I continued fiddling around until I found the solution. In addition to the changes to /lib/systemd/system/docker.service, I also needed to create a symlink to solve the problem:

  1. 'ln -s [New Path] /var/lib/docker'
  2. Stop container, restart it
@Artnal commented on GitHub (Dec 6, 2023): nvm, I continued fiddling around until I found the solution. In addition to the changes to /lib/systemd/system/docker.service, I also needed to create a symlink to solve the problem: 1. 'ln -s [New Path] /var/lib/docker' 2. Stop container, restart it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1726