immich_redis and immich_postgres stuck "starting" #3725

Closed
opened 2026-02-05 09:11:49 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @nullagit on GitHub (Jun 28, 2024).

The bug

I tried joining the Discord but they insisted I provide a phone number and I don't want to share my phone number with Discord. This is my first foray with anything related to "Docker" so please keep that in mind when offering any guidance, your patience is appreciated. Thank you in advance for your attention.

I followed the recommended "Docker Compose" installation in the documentation and everything seemed to be ok on the surface, but when I attempted to browse http://my.pc.ip:2283/, the connection timed out / reset. Here are the steps I performed:

~ > docker compose up -d

eb0c714ca78e6d9c3edcdc635be070c080111fe019ca0ab5b909c92aab2bdb6c
aab7ba0cc28341f2f90668593f60cc4f70301a11182da5e1cbf295ba688843dc
6f752ee59cf313deed07db8650405ad1487294df445254accc74060494a53c52
54235bde72843416f48b0da5e4570cfd2ad9b32ef5d9f544bfb961ff63ba1fa5
32fd45c9e436fbf617e1ef3fdad9ba87e07b9f01584ff4787faab3b4630f4e7e
~ >

I noticed eb0c714ca78e-infra was Created but not started:

~ > docker ps -a
CONTAINER ID  IMAGE                                                                                                     COMMAND               CREATED        STATUS                   PORTS                   NAMES
48fd0b61afd3  localhost/podman-pause:4.9.4-1719518483                                                                                         2 minutes ago  Created                                          eb0c714ca78e-infra
aab7ba0cc283  ghcr.io/immich-app/immich-machine-learning:release                                                        ./start.sh            2 minutes ago  Up 2 minutes                                     immich_machine_learning
6f752ee59cf3  docker.io/library/redis@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900           redis-server          2 minutes ago  Up 2 minutes (starting)                          immich_redis
54235bde7284  docker.io/tensorchord/pgvecto-rs@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0  postgres -c share...  2 minutes ago  Up 2 minutes (starting)                          immich_postgres
32fd45c9e436  ghcr.io/immich-app/immich-server:release                                                                  start.sh              2 minutes ago  Up 2 seconds             0.0.0.0:2283->3001/tcp  immich_server
~ > 

So I started it with docker start eb0c714ca78e-infra:

~ > docker ps -a
CONTAINER ID  IMAGE                                                                                                     COMMAND               CREATED        STATUS                   PORTS                   NAMES
48fd0b61afd3  localhost/podman-pause:4.9.4-1719518483                                                                                         3 minutes ago  Up 3 seconds                                     eb0c714ca78e-infra
aab7ba0cc283  ghcr.io/immich-app/immich-machine-learning:release                                                        ./start.sh            3 minutes ago  Up 3 minutes                                     immich_machine_learning
6f752ee59cf3  docker.io/library/redis@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900           redis-server          3 minutes ago  Up 3 minutes (starting)                          immich_redis
54235bde7284  docker.io/tensorchord/pgvecto-rs@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0  postgres -c share...  3 minutes ago  Up 3 minutes (starting)                          immich_postgres
32fd45c9e436  ghcr.io/immich-app/immich-server:release                                                                  start.sh              3 minutes ago  Up 1 second              0.0.0.0:2283->3001/tcp  immich_server
~ > 

This is where I observed "immich_redis" and "immich_postgres" remain "Starting" and it appears as though "immich_server" keeps restarting as the uptime is never more than 2-3 seconds.

I found this in postgres/log/postgresql-2024-06-27_212859.log:

2024-06-27 21:33:46.222 UTC [1266] LOG:  could not receive data from client: Connection reset by peer
2024-06-27 21:33:46.222 UTC [1266] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:33:48.817 UTC [1277] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:33:51.386 UTC [1289] LOG:  could not receive data from client: Connection reset by peer
2024-06-27 21:33:51.406 UTC [1288] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:33:54.028 UTC [1299] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:33:56.666 UTC [1310] LOG:  could not receive data from client: Connection reset by peer
2024-06-27 21:33:56.666 UTC [1310] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:33:59.281 UTC [1322] LOG:  could not receive data from client: Connection reset by peer
2024-06-27 21:33:59.299 UTC [1321] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:34:01.815 UTC [1333] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:34:04.442 UTC [1344] LOG:  unexpected EOF on client connection with an open transaction
2024-06-27 21:34:07.022 UTC [1357] LOG:  could not receive data from client: Connection reset by peer
2024-06-27 21:34:07.056 UTC [1355] LOG:  unexpected EOF on client connection with an open transaction

And that's been my experience with Docker and Immich thus far. I'm not sure where else to look log wise.

Is there a way to run Immich without using Docker? This has been quite the headache trying to figure all this out - as an old gray beard I don't particularly see the advantage of "containerizing" everything. Specifically, I don't understand why it's necessary to have 2 instances of postgres running, one outside and one inside a "container" - it seems superfluous. Pardon my ignorance or if I'm misunderstanding how all this works. In my old brain putting the files in /var/www/immich, editing nginx.conf and setting up the postgres connection details in a conf file just seems like it'd be easier.

The OS that Immich Server is running on

Gentoo Linux 2.15 Kernel 6.6.30-gentoo-x86_64

Version of Immich Server

I Don't Know, The Latest Stable?

Version of Immich Mobile App

n/a

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}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    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-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:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

volumes:
  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=/mnt/zpool/images/immich
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC
TZ=America/New_York

# 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_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

1. docker compose up -d
2. try to access my.pc.ip:2283 on my PC
3. connection failed

Relevant log output

No response

Additional information

No response

Originally created by @nullagit on GitHub (Jun 28, 2024). ### The bug I tried joining the Discord but they insisted I provide a phone number and I don't want to share my phone number with Discord. This is my first foray with anything related to "Docker" so please keep that in mind when offering any guidance, your patience is appreciated. Thank you in advance for your attention. I followed the recommended "Docker Compose" installation in the documentation and everything seemed to be ok on the surface, but when I attempted to browse http://my.pc.ip:2283/, the connection timed out / reset. Here are the steps I performed: ``` ~ > docker compose up -d eb0c714ca78e6d9c3edcdc635be070c080111fe019ca0ab5b909c92aab2bdb6c aab7ba0cc28341f2f90668593f60cc4f70301a11182da5e1cbf295ba688843dc 6f752ee59cf313deed07db8650405ad1487294df445254accc74060494a53c52 54235bde72843416f48b0da5e4570cfd2ad9b32ef5d9f544bfb961ff63ba1fa5 32fd45c9e436fbf617e1ef3fdad9ba87e07b9f01584ff4787faab3b4630f4e7e ~ > ``` I noticed eb0c714ca78e-infra was Created but not started: ``` ~ > docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48fd0b61afd3 localhost/podman-pause:4.9.4-1719518483 2 minutes ago Created eb0c714ca78e-infra aab7ba0cc283 ghcr.io/immich-app/immich-machine-learning:release ./start.sh 2 minutes ago Up 2 minutes immich_machine_learning 6f752ee59cf3 docker.io/library/redis@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900 redis-server 2 minutes ago Up 2 minutes (starting) immich_redis 54235bde7284 docker.io/tensorchord/pgvecto-rs@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 postgres -c share... 2 minutes ago Up 2 minutes (starting) immich_postgres 32fd45c9e436 ghcr.io/immich-app/immich-server:release start.sh 2 minutes ago Up 2 seconds 0.0.0.0:2283->3001/tcp immich_server ~ > ``` So I started it with `docker start eb0c714ca78e-infra`: ``` ~ > docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 48fd0b61afd3 localhost/podman-pause:4.9.4-1719518483 3 minutes ago Up 3 seconds eb0c714ca78e-infra aab7ba0cc283 ghcr.io/immich-app/immich-machine-learning:release ./start.sh 3 minutes ago Up 3 minutes immich_machine_learning 6f752ee59cf3 docker.io/library/redis@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900 redis-server 3 minutes ago Up 3 minutes (starting) immich_redis 54235bde7284 docker.io/tensorchord/pgvecto-rs@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 postgres -c share... 3 minutes ago Up 3 minutes (starting) immich_postgres 32fd45c9e436 ghcr.io/immich-app/immich-server:release start.sh 3 minutes ago Up 1 second 0.0.0.0:2283->3001/tcp immich_server ~ > ``` This is where I observed "immich_redis" and "immich_postgres" remain "Starting" and it appears as though "immich_server" keeps restarting as the uptime is never more than 2-3 seconds. I found this in postgres/log/postgresql-2024-06-27_212859.log: ``` 2024-06-27 21:33:46.222 UTC [1266] LOG: could not receive data from client: Connection reset by peer 2024-06-27 21:33:46.222 UTC [1266] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:33:48.817 UTC [1277] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:33:51.386 UTC [1289] LOG: could not receive data from client: Connection reset by peer 2024-06-27 21:33:51.406 UTC [1288] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:33:54.028 UTC [1299] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:33:56.666 UTC [1310] LOG: could not receive data from client: Connection reset by peer 2024-06-27 21:33:56.666 UTC [1310] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:33:59.281 UTC [1322] LOG: could not receive data from client: Connection reset by peer 2024-06-27 21:33:59.299 UTC [1321] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:34:01.815 UTC [1333] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:34:04.442 UTC [1344] LOG: unexpected EOF on client connection with an open transaction 2024-06-27 21:34:07.022 UTC [1357] LOG: could not receive data from client: Connection reset by peer 2024-06-27 21:34:07.056 UTC [1355] LOG: unexpected EOF on client connection with an open transaction ``` And that's been my experience with Docker and Immich thus far. I'm not sure where else to look log wise. Is there a way to run Immich without using Docker? This has been quite the headache trying to figure all this out - as an old gray beard I don't particularly see the advantage of "containerizing" everything. Specifically, I don't understand why it's necessary to have 2 instances of postgres running, one outside and one inside a "container" - it seems superfluous. Pardon my ignorance or if I'm misunderstanding how all this works. In my old brain putting the files in /var/www/immich, editing nginx.conf and setting up the postgres connection details in a conf file just seems like it'd be easier. ### The OS that Immich Server is running on Gentoo Linux 2.15 Kernel 6.6.30-gentoo-x86_64 ### Version of Immich Server I Don't Know, The Latest Stable? ### Version of Immich Mobile App n/a ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # 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} # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding 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-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: - .env restart: always redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900 healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: test: pg_isready --dbname='${DB_DATABASE_NAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1 interval: 5m start_interval: 30s start_period: 5m command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"] restart: always volumes: 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=/mnt/zpool/images/immich # The location where your database files are stored DB_DATA_LOCATION=./postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC TZ=America/New_York # 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_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps ```bash 1. docker compose up -d 2. try to access my.pc.ip:2283 on my PC 3. connection failed ``` ### Relevant log output _No response_ ### 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#3725