immich-app / immich

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

[BUG] Server not starting after updating to least version #6068

Closed AndyXheli closed 8 months ago

AndyXheli commented 8 months ago

The bug

oot@immich:/var/immich-app# docker compose pull && docker compose up [+] Running 5/5 ⠿ immich-microservices Pulled 0.5s ⠿ redis Pulled 0.2s ⠿ immich-machine-learning Pulled 0.5s ⠿ database Pulled 0.2s ⠿ immich-server Pulled 0.6s [+] Running 6/6 ⠿ Network immich_default Created 0.1s ⠿ Container immich_redis Created 0.1s ⠿ Container immich_postgres Created 0.0s ⠿ Container immich_machine_learning Created 0.1s ⠿ Container immich_server Created 0.0s ⠿ Container immich_microservices Created 0.0s Attaching to immich_machine_learning, immich_microservices, immich_postgres, immich_redis, immich_server immich_redis | 1:C 30 Dec 2023 18:17:38.398 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo immich_redis | 1:C 30 Dec 2023 18:17:38.398 # Redis version=6.2.14, bits=64, commit=00000000, modified=0, pid=1, just started immich_redis | 1:C 30 Dec 2023 18:17:38.398 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf immich_redis | 1:M 30 Dec 2023 18:17:38.399 monotonic clock: POSIX clock_gettime immich_redis | 1:M 30 Dec 2023 18:17:38.399 Running mode=standalone, port=6379. immich_redis | 1:M 30 Dec 2023 18:17:38.399 # Server initialized immich_redis | 1:M 30 Dec 2023 18:17:38.399 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. immich_redis | 1:M 30 Dec 2023 18:17:38.400 * Ready to accept connections immich_postgres | immich_postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization immich_postgres | immich_postgres | 2023-12-30 18:17:38.596 UTC [1] LOG: starting PostgreSQL 14.10 (Debian 14.10-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit immich_postgres | 2023-12-30 18:17:38.596 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 immich_postgres | 2023-12-30 18:17:38.596 UTC [1] LOG: listening on IPv6 address "::", port 5432 immich_postgres | 2023-12-30 18:17:38.598 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" immich_postgres | 2023-12-30 18:17:38.603 UTC [27] LOG: database system was shut down at 2023-12-30 18:16:06 UTC immich_postgres | 2023-12-30 18:17:38.612 UTC [1] LOG: database system is ready to accept connections immich_machine_learning | [12/30/23 18:17:39] INFO Starting gunicorn 21.2.0 immich_machine_learning | [12/30/23 18:17:39] INFO Listening at: http://0.0.0.0:3003 (9) immich_machine_learning |[12/30/23 18:17:39]INFO Using worker: app.config.CustomUvicornWorker immich_machine_learning | [12/30/23 18:17:39] INFO Booting worker with pid: 33 immich_server | /usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78 immich_server | throw new Error(Config validation error: ${error.message}); immich_server | ^ immich_server | immich_server | Error: Config validation error: "LOG_LEVEL" must be one of [verbose, debug, log, warn, error, fatal] immich_server | at ConfigModule.forRoot (/usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78:23) immich_server | at Object. (/usr/src/app/dist/infra/infra.module.js:49:27) immich_server | at Module._compile (node:internal/modules/cjs/loader:1376:14) immich_server | at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) immich_server | at Module.load (node:internal/modules/cjs/loader:1207:32) immich_server | at Module._load (node:internal/modules/cjs/loader:1023:12) immich_server | at Module.require (node:internal/modules/cjs/loader:1235:19) immich_server | at require (node:internal/modules/helpers:176:18) immich_server | at Object. (/usr/src/app/dist/infra/index.js:20:14) immich_server | at Module._compile (node:internal/modules/cjs/loader:1376:14) immich_server | immich_server | Node.js v20.10.0 immich_microservices | /usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78 immich_microservices | throw new Error(Config validation error: ${error.message}); immich_microservices | ^ immich_microservices | immich_microservices | Error: Config validation error: "LOG_LEVEL" must be one of [verbose, debug, log, warn, error, fatal] immich_microservices | at ConfigModule.forRoot (/usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78:23) immich_microservices | at Object. (/usr/src/app/dist/infra/infra.module.js:49:27) immich_microservices | at Module._compile (node:internal/modules/cjs/loader:1376:14) immich_microservices | at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) immich_microservices | at Module.load (node:internal/modules/cjs/loader:1207:32) immich_microservices | at Module._load (node:internal/modules/cjs/loader:1023:12) immich_microservices | at Module.require (node:internal/modules/cjs/loader:1235:19) immich_microservices | at require (node:internal/modules/helpers:176:18) immich_microservices | at Object. (/usr/src/app/dist/infra/index.js:20:14) immich_microservices | at Module._compile (node:internal/modules/cjs/loader:1376:14) immich_microservices | immich_microservices | Node.js v20.10.0 immich_microservices exited with code 0 immich_server exited with code 0 immich_microservices | /usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78 immich_microservices | throw new Error(Config validation error: ${error.message}); immich_microservices | ^ immich_microservices | immich_microservices | Error: Config validation error: "LOG_LEVEL" must be one of [verbose, debug, log, warn, error, fatal] immich_microservices | at ConfigModule.forRoot (/usr/src/app/node_modules/@nestjs/config/dist/config.module.js:78:23) immich_microservices | at Object. (/usr/src/app/dist/infra/infra.module.js:49:27) immich_microservices | at Module._compile (node:internal/modules/cjs/loader:1376:14) immich_microservices | at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) immich_microservices | at Module.load (node:internal/modules/cjs/loader:1207:32) immich_microservices | at Module._load (node:internal/modules/cjs/loader:1023:12) immich_microservices | at Module.require (node:internal/modules/cjs/loader:1235:19) immich_microservices | at require (node:internal/modules/helpers:176:18) immich_microservices | at Object. (/usr/src/app/dist/infra/index.js:20:14) immich_microservices | at Module._compile (node:internal/modules/cjs/loader:1376:14) immich_microservices | immich_microservices | Node.js v20.10.0

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

NA

Version of Immich Mobile App

NA

Platform with the issue

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:
      - 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:
    #   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
    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
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

###################################################################################
# Database
###################################################################################

DB_HOSTNAME=immich_postgres
DB_USERNAME=immich_admin
DB_PASSWORD=
DB_DATABASE_NAME=immich-db

# Optional Database settings:
# DB_PORT=5432

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

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=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=

###################################################################################
# Upload File Location
#
# This is the location where uploaded files are stored.
###################################################################################

UPLOAD_LOCATION=/var/immich-app-data/

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

LOG_LEVEL=simple

###################################################################################
# Typesense
###################################################################################
# TYPESENSE_ENABLED=false
TYPESENSE_API_KEY=some-random-text
# TYPESENSE_HOST: typesense
# TYPESENSE_PORT: 8108
# TYPESENSE_PROTOCOL: http

###################################################################################
# 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.
# 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="Photos and Videos Backup Server"

####################################################################################
# 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

####################################################################################
# Alternative API's External Address - Optional
#
# This is an advanced feature used to control the public server endpoint returned to clients during Well-known discovery.
# You should only use this if you want mobile apps to access the immich API over a custom URL. Do not include trailing slash.
# NOTE: At this time, the web app will not be affected by this setting and will continue to use the relative path: /api
# Examples: http://localhost:3001, http://immich-api.example.com, etc
####################################################################################

#IMMICH_API_URL_EXTERNAL=http://localhost:3001

###################################################################################
# Immich Version - Optional
#
# This allows all immich docker images to be pinned to a specific version. By default,
# the version is "release" but could be a specific version, like "v1.59.0".
###################################################################################

#IMMICH_VERSION=

Reproduction steps

1. docker compose pull && docker compose up -d
2.
3.
...

Additional information

No response

bo0tzz commented 8 months ago

Please fix the LOG_LEVEL var in your .env file, as indicated by the error message.

AndyXheli commented 8 months ago

@bo0tzz Thank you! Got it