Failing during start: database system is starting up #2300

Closed
opened 2026-02-05 05:56:54 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @miasinterestinglife on GitHub (Feb 28, 2024).

The bug

When starting up immich, everything appears normal until the following errors appear:

immich_postgres | 2024-02-28 19:16:14.696 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 | 2024-02-28 19:16:14.696 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
immich_postgres | 2024-02-28 19:16:14.696 UTC [1] LOG: listening on IPv6 address "::", port 5432
immich_postgres | 2024-02-28 19:16:26.421 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
immich_postgres | 2024-02-28 19:16:35.963 UTC [27] LOG: database system was interrupted; last known up at 2024-02-28 19:11:09 UTC
immich_postgres | [2024-02-28T19:16:35Z INFO service::utils::clean] Delete outdated directory "pg_vectors/indexes/60197".
immich_postgres | 2024-02-28 19:17:40.431 UTC [31] FATAL: the database system is starting up
immich_postgres | 2024-02-28 19:17:43.441 UTC [32] FATAL: the database system is starting up
immich_postgres | 2024-02-28 19:17:46.448 UTC [33] FATAL: the database system is starting up

and then i get a bunch of errors from immich_server, like this:
immich_server | [Nest] 7 - 02/28/2024, 7:18:04 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
immich_server | error: the database system is starting up
immich_server | at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98)
immich_server | at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29)
immich_server | at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38)
immich_server | at Socket. (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42)
immich_server | at Socket.emit (node:events:518:28)
immich_server | at addChunk (node:internal/streams/readable:559:12)
immich_server | at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
immich_server | at Readable.push (node:internal/streams/readable:390:5)
immich_server | at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

I've tried docker compose pull multiple times, restarted with docker compose down and docker compose up and even restarted the entire server with no success.

The OS that Immich Server is running on

Ubuntu 23.04 Server

Version of Immich Server

v1.96.0

Version of Immich Mobile App

v1.95.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:
      - 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:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    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

# 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=./library

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

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=postgres

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

REDIS_HOSTNAME=immich_redis

Reproduction steps

1.
2.
3.
...

Additional information

No response

Originally created by @miasinterestinglife on GitHub (Feb 28, 2024). ### The bug When starting up immich, everything appears normal until the following errors appear: immich_postgres | 2024-02-28 19:16:14.696 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 | 2024-02-28 19:16:14.696 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 immich_postgres | 2024-02-28 19:16:14.696 UTC [1] LOG: listening on IPv6 address "::", port 5432 immich_postgres | 2024-02-28 19:16:26.421 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" immich_postgres | 2024-02-28 19:16:35.963 UTC [27] LOG: database system was interrupted; last known up at 2024-02-28 19:11:09 UTC immich_postgres | [2024-02-28T19:16:35Z INFO service::utils::clean] Delete outdated directory "pg_vectors/indexes/60197". immich_postgres | 2024-02-28 19:17:40.431 UTC [31] FATAL: the database system is starting up immich_postgres | 2024-02-28 19:17:43.441 UTC [32] FATAL: the database system is starting up immich_postgres | 2024-02-28 19:17:46.448 UTC [33] FATAL: the database system is starting up and then i get a bunch of errors from immich_server, like this: immich_server | [Nest] 7 - 02/28/2024, 7:18:04 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... immich_server | error: the database system is starting up immich_server | at Parser.parseErrorMessage (/usr/src/app/node_modules/pg-protocol/dist/parser.js:287:98) immich_server | at Parser.handlePacket (/usr/src/app/node_modules/pg-protocol/dist/parser.js:126:29) immich_server | at Parser.parse (/usr/src/app/node_modules/pg-protocol/dist/parser.js:39:38) immich_server | at Socket.<anonymous> (/usr/src/app/node_modules/pg-protocol/dist/index.js:11:42) immich_server | at Socket.emit (node:events:518:28) immich_server | at addChunk (node:internal/streams/readable:559:12) immich_server | at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) immich_server | at Readable.push (node:internal/streams/readable:390:5) immich_server | at TCP.onStreamRead (node:internal/stream_base_commons:190:23) I've tried `docker compose pull` multiple times, restarted with `docker compose down` and `docker compose up` and even restarted the entire server with no success. ### The OS that Immich Server is running on Ubuntu 23.04 Server ### Version of Immich Server v1.96.0 ### Version of Immich Mobile App v1.95.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: - 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:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc restart: always database: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 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 ```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=./library # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash 1. 2. 3. ... ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#2300