Immich-SERVER keeps restarting on Synology DS220+ running in Portainer #5327

Closed
opened 2026-02-05 11:20:40 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @autoentropy on GitHub (Feb 5, 2025).

The bug

Trying to run Immich on my Synology DS220+ in portainer following this guide How to Install Immich on Your Synology NAS

Everything seems to be running smoothly but the actuall webserver continues to restart and I cannot figure out why. Can anybody provide some guidance?

[Nest] 17  - 02/04/2025, 5:05:29 PM     LOG [Api:Bootstrap] Immich Server is listening on http://[::1]:2283 [v1.125.7] [production] 
microservices worker error: TypeError: Cannot read properties of undefined (reading 'replace'), stack: TypeError: Cannot read properties of undefined (reading 'replace')
    at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48)
    at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17)
    at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5)
    at Socket.emit (node:events:524:28)
    at emitErrorNT (node:internal/streams/destroy:170:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
microservices worker exited with code 1
Killing api process

The OS that Immich Server is running on

DiskStation Manager (DSM)

Version of Immich Server

v1.125.7

Version of Immich Mobile App

none

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

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=America/Phoenix
    volumes:
      - /volume1/docker/immich/redis:/data:rw
    restart: on-failure:5

  immich-db:
    image: tensorchord/pgvecto-rs:pg16-v0.2.0
    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
    volumes:
      - /volume1/docker/immich/db:/var/lib/postgresql/data:rw
    environment:
      - TZ=America/Phoenix
      - POSTGRES_DB=immich
      - POSTGRES_USER=immichuser
      - POSTGRES_PASSWORD=immichpw
    restart: on-failure:5

  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    container_name: Immich-SERVER
    hostname: immich-server
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    ports:
      - 8212:2283
    volumes:
      - /volume1/docker/immich/upload:/usr/src/app/upload:rw
    restart: on-failure:5
    depends_on:
      immich-redis:
        condition: service_healthy
      immich-db:
        condition: service_started

  immich-machine-learning:
    image: ghcr.io/immich-app/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:rw
      - /volume1/docker/immich/cache:/cache:rw
      - /volume1/docker/immich/matplotlib:/matplotlib:rw
    environment:
      - MPLCONFIGDIR=/matplotlib
    restart: on-failure:5
    depends_on:
      immich-db:
        condition: service_started

Your .env content

NODE_ENV=production
TZ=Europe/Bucharest
###################################################################################
# Database
###################################################################################

DB_HOSTNAME=immich-db
DB_USERNAME=immichuser
DB_PASSWORD=immichpw
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=5432

###################################################################################
# Redis
###################################################################################

REDIS_HOSTNAME=immich-redis

# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Log message level - [simple|verbose]
###################################################################################

LOG_LEVEL=log

###################################################################################
# JWT SECRET
###################################################################################

# This JWT_SECRET is used to sign the authentication keys for user login
# You should set it to a long randomly generated value
# You can use this command to generate one: openssl rand -base64 128
JWT_SECRET=xia7jNMRT50PgcShC0BTuFxTLPamoYnQO8OKH8jUff4iD0AdtbC8HTZp/Rv4LSdpV7kXbYTvxNrw24NzJJiag2nisYbUmEV8XbJEEboag98z+6KR5djhPPC4/oztoSJHOB2rpPXjv4VNwCAT0PvTKUo3gSY8rDja85DGugYqJ0c=

###################################################################################
# Reverse Geocoding
####################################################################################

# DISABLE_REVERSE_GEOCODING=false

# 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.
# For example PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>"

PUBLIC_LOGIN_PAGE_MESSAGE=

####################################################################################
# Alternative Service Addresses - Optional
#
# This is an advanced feature for users who may be running their immich services on different hosts.
# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers.
# Note: immich-microservices is bound to 3002, but no references are made
####################################################################################

IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

####################################################################################
# OAuth Setting - Optional
#
# These setting will enable OAuth login for your instance of Immich
# Folow the instructions in the page https://immich.app/docs/usage/oauth to set up your OAuth provider
####################################################################################

# OAUTH_ENABLED=false
# OAUTH_ISSUER_URL=
# OAUTH_CLIENT_ID=
# OAUTH_CLIENT_SECRET=
# OAUTH_BUTTON_TEXT=Login with OAuth
# OAUTH_AUTO_REGISTER=true
# OAUTH_SCOPE="openid profile email"

Reproduction steps

  1. Start server container in portainer

Relevant log output


Additional information

No response

Originally created by @autoentropy on GitHub (Feb 5, 2025). ### The bug Trying to run Immich on my Synology DS220+ in portainer following this guide [How to Install Immich on Your Synology NAS ](https://mariushosting.com/how-to-install-immich-on-your-synology-nas/) Everything seems to be running smoothly but the actuall webserver continues to restart and I cannot figure out why. Can anybody provide some guidance? ``` [Nest] 17 - 02/04/2025, 5:05:29 PM LOG [Api:Bootstrap] Immich Server is listening on http://[::1]:2283 [v1.125.7] [production] microservices worker error: TypeError: Cannot read properties of undefined (reading 'replace'), stack: TypeError: Cannot read properties of undefined (reading 'replace') at queryError (/usr/src/app/node_modules/postgres/cjs/src/connection.js:389:48) at errored (/usr/src/app/node_modules/postgres/cjs/src/connection.js:384:17) at Socket.error (/usr/src/app/node_modules/postgres/cjs/src/connection.js:376:5) at Socket.emit (node:events:524:28) at emitErrorNT (node:internal/streams/destroy:170:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at process.processTicksAndRejections (node:internal/process/task_queues:90:21) microservices worker exited with code 1 Killing api process ``` ### The OS that Immich Server is running on DiskStation Manager (DSM) ### Version of Immich Server v1.125.7 ### Version of Immich Mobile App none ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML 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=America/Phoenix volumes: - /volume1/docker/immich/redis:/data:rw restart: on-failure:5 immich-db: image: tensorchord/pgvecto-rs:pg16-v0.2.0 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 volumes: - /volume1/docker/immich/db:/var/lib/postgresql/data:rw environment: - TZ=America/Phoenix - POSTGRES_DB=immich - POSTGRES_USER=immichuser - POSTGRES_PASSWORD=immichpw restart: on-failure:5 immich-server: image: ghcr.io/immich-app/immich-server:release container_name: Immich-SERVER hostname: immich-server user: 1026:100 security_opt: - no-new-privileges:true env_file: - stack.env ports: - 8212:2283 volumes: - /volume1/docker/immich/upload:/usr/src/app/upload:rw restart: on-failure:5 depends_on: immich-redis: condition: service_healthy immich-db: condition: service_started immich-machine-learning: image: ghcr.io/immich-app/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:rw - /volume1/docker/immich/cache:/cache:rw - /volume1/docker/immich/matplotlib:/matplotlib:rw environment: - MPLCONFIGDIR=/matplotlib restart: on-failure:5 depends_on: immich-db: condition: service_started ``` ### Your .env content ```Shell NODE_ENV=production TZ=Europe/Bucharest ################################################################################### # Database ################################################################################### DB_HOSTNAME=immich-db DB_USERNAME=immichuser DB_PASSWORD=immichpw DB_DATABASE_NAME=immich # Optional Database settings: # DB_PORT=5432 ################################################################################### # Redis ################################################################################### REDIS_HOSTNAME=immich-redis # Optional Redis settings: # REDIS_PORT=6379 # REDIS_DBINDEX=0 # REDIS_PASSWORD= # REDIS_SOCKET= ################################################################################### # Log message level - [simple|verbose] ################################################################################### LOG_LEVEL=log ################################################################################### # JWT SECRET ################################################################################### # This JWT_SECRET is used to sign the authentication keys for user login # You should set it to a long randomly generated value # You can use this command to generate one: openssl rand -base64 128 JWT_SECRET=xia7jNMRT50PgcShC0BTuFxTLPamoYnQO8OKH8jUff4iD0AdtbC8HTZp/Rv4LSdpV7kXbYTvxNrw24NzJJiag2nisYbUmEV8XbJEEboag98z+6KR5djhPPC4/oztoSJHOB2rpPXjv4VNwCAT0PvTKUo3gSY8rDja85DGugYqJ0c= ################################################################################### # Reverse Geocoding #################################################################################### # DISABLE_REVERSE_GEOCODING=false # 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. # For example PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>demo@demo.de</i><br>Password: <i>demo</i>" PUBLIC_LOGIN_PAGE_MESSAGE= #################################################################################### # Alternative Service Addresses - Optional # # This is an advanced feature for users who may be running their immich services on different hosts. # It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers. # Note: immich-microservices is bound to 3002, but no references are made #################################################################################### IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001 IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 #################################################################################### # OAuth Setting - Optional # # These setting will enable OAuth login for your instance of Immich # Folow the instructions in the page https://immich.app/docs/usage/oauth to set up your OAuth provider #################################################################################### # OAUTH_ENABLED=false # OAUTH_ISSUER_URL= # OAUTH_CLIENT_ID= # OAUTH_CLIENT_SECRET= # OAUTH_BUTTON_TEXT=Login with OAuth # OAUTH_AUTO_REGISTER=true # OAUTH_SCOPE="openid profile email" ``` ### Reproduction steps 1. Start server container in portainer ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Feb 5, 2025):

Hello, can you please try using the official docker-compose file from our website?

@alextran1502 commented on GitHub (Feb 5, 2025): Hello, can you please try using the official docker-compose file from our website?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5327