[BUG] Unable to load web UI - logs show connect timeout redis #1387

Closed
opened 2026-02-05 01:36:33 +03:00 by OVERLORD · 19 comments
Owner

Originally created by @purandarrao on GitHub (Oct 1, 2023).

The bug

This is a fresh setup on ubuntu.

Below are the logs:

immich_microservices     | Error: connect ETIMEDOUT
immich_microservices     |     at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
immich_microservices     |     at Object.onceWrapper (node:events:628:28)
immich_microservices     |     at Socket.emit (node:events:514:28)
immich_microservices     |     at Socket._onTimeout (node:net:571:8)
immich_microservices     |     at listOnTimeout (node:internal/timers:569:17)
immich_microservices     |     at process.processTimers (node:internal/timers:512:7) {
immich_microservices     |   errorno: 'ETIMEDOUT',
immich_microservices     |   code: 'ETIMEDOUT',
immich_microservices     |   syscall: 'connect'
immich_microservices     | }
immich_server            | [Nest] 7  - 09/30/2023, 9:09:43 PM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
immich_server            | Error: Connection terminated due to connection timeout
immich_server            |     at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:132:73)
immich_server            |     at Object.onceWrapper (node:events:628:28)
immich_server            |     at Connection.emit (node:events:514:28)
immich_server            |     at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:63:12)
immich_server            |     at Socket.emit (node:events:514:28)
immich_server            |     at TCP.<anonymous> (node:net:323:12)
immich_server            | Error: connect ETIMEDOUT
immich_server            |     at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)
immich_server            |     at Object.onceWrapper (node:events:628:28)
immich_server            |     at Socket.emit (node:events:514:28)
immich_server            |     at Socket._onTimeout (node:net:571:8)
immich_server            |     at listOnTimeout (node:internal/timers:569:17)
immich_server            |     at process.processTimers (node:internal/timers:512:7) {
immich_server            |   errorno: 'ETIMEDOUT',
immich_server            |   code: 'ETIMEDOUT',
immich_server            |   syscall: 'connect'
immich_server            | }

I have tried restart the setup multiple times but same problem.

The OS that Immich Server is running on

Ubuntu 22.04.1 LTS

Version of Immich Server

v1.79.0

Version of Immich Mobile App

v1.79.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

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
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    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
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    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

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    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
    restart: always

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

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    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

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    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=/home/kakde/external/Photos/immich

# 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=testimmich
DB_PASSWORD=testimmich

# 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.docker-compose up -d
2.Access UI http://localhost:2283 - doesn't load.
3.immich-server logs shows as provided in description.

Additional information

I tried steps suggested here:
https://github.com/immich-app/immich/issues/2931#issuecomment-1605396092

But since this is a fresh setup I get error saying "assets" table not found when run:

select a."originalPath", count(a.id)
from assets a
group by a."originalPath"
having count(a.id) > 1;
Originally created by @purandarrao on GitHub (Oct 1, 2023). ### The bug This is a fresh setup on ubuntu. Below are the logs: ``` immich_microservices | Error: connect ETIMEDOUT immich_microservices | at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) immich_microservices | at Object.onceWrapper (node:events:628:28) immich_microservices | at Socket.emit (node:events:514:28) immich_microservices | at Socket._onTimeout (node:net:571:8) immich_microservices | at listOnTimeout (node:internal/timers:569:17) immich_microservices | at process.processTimers (node:internal/timers:512:7) { immich_microservices | errorno: 'ETIMEDOUT', immich_microservices | code: 'ETIMEDOUT', immich_microservices | syscall: 'connect' immich_microservices | } immich_server | [Nest] 7 - 09/30/2023, 9:09:43 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... immich_server | Error: Connection terminated due to connection timeout immich_server | at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:132:73) immich_server | at Object.onceWrapper (node:events:628:28) immich_server | at Connection.emit (node:events:514:28) immich_server | at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:63:12) immich_server | at Socket.emit (node:events:514:28) immich_server | at TCP.<anonymous> (node:net:323:12) immich_server | Error: connect ETIMEDOUT immich_server | at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) immich_server | at Object.onceWrapper (node:events:628:28) immich_server | at Socket.emit (node:events:514:28) immich_server | at Socket._onTimeout (node:net:571:8) immich_server | at listOnTimeout (node:internal/timers:569:17) immich_server | at process.processTimers (node:internal/timers:512:7) { immich_server | errorno: 'ETIMEDOUT', immich_server | code: 'ETIMEDOUT', immich_server | syscall: 'connect' immich_server | } ``` I have tried restart the setup multiple times but same problem. ### The OS that Immich Server is running on Ubuntu 22.04.1 LTS ### Version of Immich Server v1.79.0 ### Version of Immich Mobile App v1.79.0 ### Platform with the issue - [X] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" 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 env_file: - .env depends_on: - redis - database - typesense 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 env_file: - .env depends_on: - redis - database - typesense 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 immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env 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 restart: always redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 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 immich-proxy: container_name: immich_proxy image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release} environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL ports: - 2283:8080 depends_on: - immich-server - immich-web 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=/home/kakde/external/Photos/immich # 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=testimmich DB_PASSWORD=testimmich # 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.docker-compose up -d 2.Access UI http://localhost:2283 - doesn't load. 3.immich-server logs shows as provided in description. ``` ### Additional information I tried steps suggested here: https://github.com/immich-app/immich/issues/2931#issuecomment-1605396092 But since this is a fresh setup I get error saying "assets" table not found when run: ``` select a."originalPath", count(a.id) from assets a group by a."originalPath" having count(a.id) > 1; ```
Author
Owner

@itangqiao commented on GitHub (Oct 9, 2023):

same , 502

syscall: 'connect'

2023/10/09 12:09:58 | stderr | code: 'ETIMEDOUT',
2023/10/09 12:09:58 | stderr | errorno: 'ETIMEDOUT',
2023/10/09 12:09:58 | stderr | at process.processTimers (node:internal/timers:512:7) {
2023/10/09 12:09:58 | stderr | at listOnTimeout (node:internal/timers:569:17)
2023/10/09 12:09:58 | stderr | at Socket._onTimeout (node:net:571:8)
2023/10/09 12:09:58 | stderr | at Socket.emit (node:events:514:28)
2023/10/09 12:09:58 | stderr | at Object.onceWrapper (node:events:628:28)
2023/10/09 12:09:58 | stderr | at Socket. (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41)
2023/10/09 12:09:58 | stderr | Error: connect ETIMEDOUT
2023/10/09 12:09:58 | stderr | }
2023/10/09 12:09:58 | stderr | syscall: 'connect'
2023/10/09 12:09:58 | stderr | code: 'ETIMEDOUT',
2023/10/09 12:09:58 | stderr | errorno: 'ETIMEDOUT',
2023/10/09 12:09:58 | stderr | at process.processTimers (node:internal/timers:512:7) {
2023/10/09 12:09:58 | stderr | at listOnTimeout (node:internal/timers:569:17)
2023/10/09 12:09:58 | stderr | at Socket._onTimeout (node:net:571:8)
2023/10/09 12:09:58 | stderr | at Socket.emit (node:events:514:28)
2023/10/09 12:09:58 | stderr | at Object.onceWrapper (node:events:628:28)
2023/10/09 12:09:58 | stderr | at Socket. (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41)
2023/10/09 12:09:58 | stderr | Error: connect ETIMEDOUT
2023/10/09 12:09:58 | stderr | }

@itangqiao commented on GitHub (Oct 9, 2023): same , 502 syscall: 'connect' -- 2023/10/09 12:09:58 | stderr | code: 'ETIMEDOUT', 2023/10/09 12:09:58 | stderr | errorno: 'ETIMEDOUT', 2023/10/09 12:09:58 | stderr | at process.processTimers (node:internal/timers:512:7) { 2023/10/09 12:09:58 | stderr | at listOnTimeout (node:internal/timers:569:17) 2023/10/09 12:09:58 | stderr | at Socket._onTimeout (node:net:571:8) 2023/10/09 12:09:58 | stderr | at Socket.emit (node:events:514:28) 2023/10/09 12:09:58 | stderr | at Object.onceWrapper (node:events:628:28) 2023/10/09 12:09:58 | stderr | at Socket.<anonymous> (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41) 2023/10/09 12:09:58 | stderr | Error: connect ETIMEDOUT 2023/10/09 12:09:58 | stderr | } 2023/10/09 12:09:58 | stderr | syscall: 'connect' 2023/10/09 12:09:58 | stderr | code: 'ETIMEDOUT', 2023/10/09 12:09:58 | stderr | errorno: 'ETIMEDOUT', 2023/10/09 12:09:58 | stderr | at process.processTimers (node:internal/timers:512:7) { 2023/10/09 12:09:58 | stderr | at listOnTimeout (node:internal/timers:569:17) 2023/10/09 12:09:58 | stderr | at Socket._onTimeout (node:net:571:8) 2023/10/09 12:09:58 | stderr | at Socket.emit (node:events:514:28) 2023/10/09 12:09:58 | stderr | at Object.onceWrapper (node:events:628:28) 2023/10/09 12:09:58 | stderr | at Socket.<anonymous> (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41) 2023/10/09 12:09:58 | stderr | Error: connect ETIMEDOUT 2023/10/09 12:09:58 | stderr | }
Author
Owner

@DanielEcho commented on GitHub (Oct 9, 2023):

same
[Nest] 7 - 10/09/2023, 12:42:14 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)...
Error: Connection terminated due to connection timeout
at Connection. (/usr/src/app/node_modules/pg/lib/client.js:132:73)
at Object.onceWrapper (node:events:628:28)
at Connection.emit (node:events:514:28)
at Socket. (/usr/src/app/node_modules/pg/lib/connection.js:63:12)
at Socket.emit (node:events:514:28)
at TCP. (node:net:323:12)
[Nest] 7 - 10/09/2023, 12:42:14 PM ERROR [ExceptionHandler] Connection terminated due to connection timeout
Error: Connection terminated due to connection timeout
at Connection. (/usr/src/app/node_modules/pg/lib/client.js:132:73)
at Object.onceWrapper (node:events:628:28)
at Connection.emit (node:events:514:28)
at Socket. (/usr/src/app/node_modules/pg/lib/connection.js:63:12)
at Socket.emit (node:events:514:28)
at TCP. (node:net:323:12)

@DanielEcho commented on GitHub (Oct 9, 2023): same [Nest] 7 - 10/09/2023, 12:42:14 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)... Error: Connection terminated due to connection timeout at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:628:28) at Connection.emit (node:events:514:28) at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:63:12) at Socket.emit (node:events:514:28) at TCP.<anonymous> (node:net:323:12) [Nest] 7 - 10/09/2023, 12:42:14 PM ERROR [ExceptionHandler] Connection terminated due to connection timeout Error: Connection terminated due to connection timeout at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:628:28) at Connection.emit (node:events:514:28) at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:63:12) at Socket.emit (node:events:514:28) at TCP.<anonymous> (node:net:323:12)
Author
Owner

@DanielEcho commented on GitHub (Oct 9, 2023):

i solved this problem self.
try to stop your firewall.

@DanielEcho commented on GitHub (Oct 9, 2023): i solved this problem self. try to stop your firewall.
Author
Owner

@itangqiao commented on GitHub (Oct 9, 2023):

i solved this problem self. try to stop your firewall.↳

You're right, bro!
I turned off the firewall and turned it on again. It works! That's Stranger Things.

@itangqiao commented on GitHub (Oct 9, 2023): > i solved this problem self. try to stop your firewall.↳ You're right, bro! I turned off the firewall and turned it on again. It works! That's Stranger Things.
Author
Owner

@purandarrao commented on GitHub (Oct 10, 2023):

I restarted disaled and also tried restart firewall service, but didn't work.
It started to work after I finally restarted ubuntu server itself after following the steps here https://serverfault.com/questions/129086/how-to-start-stop-iptables-on-ubuntu
Thanks @DanielEcho @itangqiao

@purandarrao commented on GitHub (Oct 10, 2023): I restarted disaled and also tried restart firewall service, but didn't work. It started to work after I finally restarted ubuntu server itself after following the steps here https://serverfault.com/questions/129086/how-to-start-stop-iptables-on-ubuntu Thanks @DanielEcho @itangqiao
Author
Owner

@f-x1-1 commented on GitHub (Feb 27, 2024):

Same issue here on unraid using immich docker container. After updating the docker-container.yml, immich stopped working for me, I have tried to install it muliple times, cant make it work.

Error: connect ETIMEDOUT at Socket.<anonymous> (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:632:28) at Socket.emit (node:events:518:28) at Socket._onTimeout (node:net:589:8) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } [Nest] 222 - 02/27/2024, 7:26:27 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... Error: Connection terminated due to connection timeout at Connection.<anonymous> (/app/immich/server/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:632:28) at Connection.emit (node:events:518:28) at Socket.<anonymous> (/app/immich/server/node_modules/pg/lib/connection.js:63:12) at Socket.emit (node:events:518:28) at TCP.<anonymous> (node:net:337:12) [Nest] 222 - 02/27/2024, 7:26:27 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)... Error: Connection terminated due to connection timeout at Connection.<anonymous> (/app/immich/server/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:632:28) at Connection.emit (node:events:518:28) at Socket.<anonymous> (/app/immich/server/node_modules/pg/lib/connection.js:63:12) at Socket.emit (node:events:518:28) at TCP.<anonymous> (node:net:337:12)

@f-x1-1 commented on GitHub (Feb 27, 2024): Same issue here on unraid using immich docker container. After updating the docker-container.yml, immich stopped working for me, I have tried to install it muliple times, cant make it work. `Error: connect ETIMEDOUT at Socket.<anonymous> (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:632:28) at Socket.emit (node:events:518:28) at Socket._onTimeout (node:net:589:8) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } [Nest] 222 - 02/27/2024, 7:26:27 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... Error: Connection terminated due to connection timeout at Connection.<anonymous> (/app/immich/server/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:632:28) at Connection.emit (node:events:518:28) at Socket.<anonymous> (/app/immich/server/node_modules/pg/lib/connection.js:63:12) at Socket.emit (node:events:518:28) at TCP.<anonymous> (node:net:337:12) [Nest] 222 - 02/27/2024, 7:26:27 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (2)... Error: Connection terminated due to connection timeout at Connection.<anonymous> (/app/immich/server/node_modules/pg/lib/client.js:132:73) at Object.onceWrapper (node:events:632:28) at Connection.emit (node:events:518:28) at Socket.<anonymous> (/app/immich/server/node_modules/pg/lib/connection.js:63:12) at Socket.emit (node:events:518:28) at TCP.<anonymous> (node:net:337:12)`
Author
Owner

@shierro commented on GitHub (Mar 8, 2024):

same issue here, on ubuntu 22.04, latest docker & compose

@shierro commented on GitHub (Mar 8, 2024): same issue here, on ubuntu 22.04, latest docker & compose
Author
Owner

@Tywele commented on GitHub (May 2, 2024):

I experience the same issue on Fedora 39 Server Edition. Trying to install Immich via Ansible.

Here are my tasks:

- name: create Immich network
  community.docker.docker_network:
    name: immich-network
    state: present

- name: deploy Immich-Redis
  community.docker.docker_container:
    name: immich-redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart_policy: always
    networks: 
      - name: immich-network

- name: deploy Immich-Postgres
  community.docker.docker_container:
    name: immich-postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    restart_policy: always
    volumes:
      - "{{ nvme_mount_point }}/immich/postgres:/var/lib/postgresql/data"
    env:
      POSTGRES_DB: "{{ immich_postgres_db_name }}"
      POSTGRES_USER: "{{ immich_postgres_db_user }}"
      POSTGRES_PASSWORD: "{{ immich_postgres_db_password }}"
    networks: 
      - name: immich-network

- name: deploy Immich-Machine-Learning
  community.docker.docker_container:
    name: immich-machine-learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    restart_policy: always
    volumes:
      - "{{ nvme_mount_point }}/immich/model-cache:/cache"
    networks: 
      - name: immich-network
    env:
      DB_DATABASE_NAME: "{{ immich_postgres_db_name }}"
      DB_USERNAME: "{{ immich_postgres_db_user }}"
      DB_PASSWORD: "{{ immich_postgres_db_password }}"

- name: deploy Immich-Microservices
  community.docker.docker_container:
    name: immich-microservices
    image: ghcr.io/immich-app/immich-server:release
    restart_policy: always
    command: ['start.sh', 'microservices']
    volumes:
      - "{{ hdd_mount_point}}/immich/library:/usr/src/app/upload"
      - /etc/localtime:/etc/localtime
    networks: 
      - name: immich-network
    env:
      DB_DATABASE_NAME: "{{ immich_postgres_db_name }}"
      DB_USERNAME: "{{ immich_postgres_db_user }}"
      DB_PASSWORD: "{{ immich_postgres_db_password }}"

- name: deploy Immich-Server
  community.docker.docker_container:
    name: immich-server
    image: ghcr.io/immich-app/immich-server:release
    restart_policy: always
    command: ['start.sh', 'immich']
    volumes:
      - "{{ hdd_mount_point}}/immich/library:/usr/src/app/upload"
      - /etc/localtime:/etc/localtime
    ports:
      - "2283:3001"
    networks: 
      - name: immich-network
    env:
      DB_DATABASE_NAME: "{{ immich_postgres_db_name }}"
      DB_USERNAME: "{{ immich_postgres_db_user }}"
      DB_PASSWORD: "{{ immich_postgres_db_password }}"

And the corresponding variables:

immich_postgres_db_name: immich
immich_postgres_db_user: postgres
immich_postgres_db_password: postgres
@Tywele commented on GitHub (May 2, 2024): I experience the same issue on Fedora 39 Server Edition. Trying to install Immich via Ansible. Here are my tasks: ``` yml - name: create Immich network community.docker.docker_network: name: immich-network state: present - name: deploy Immich-Redis community.docker.docker_container: name: immich-redis image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672 restart_policy: always networks: - name: immich-network - name: deploy Immich-Postgres community.docker.docker_container: name: immich-postgres image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 restart_policy: always volumes: - "{{ nvme_mount_point }}/immich/postgres:/var/lib/postgresql/data" env: POSTGRES_DB: "{{ immich_postgres_db_name }}" POSTGRES_USER: "{{ immich_postgres_db_user }}" POSTGRES_PASSWORD: "{{ immich_postgres_db_password }}" networks: - name: immich-network - name: deploy Immich-Machine-Learning community.docker.docker_container: name: immich-machine-learning image: ghcr.io/immich-app/immich-machine-learning:release restart_policy: always volumes: - "{{ nvme_mount_point }}/immich/model-cache:/cache" networks: - name: immich-network env: DB_DATABASE_NAME: "{{ immich_postgres_db_name }}" DB_USERNAME: "{{ immich_postgres_db_user }}" DB_PASSWORD: "{{ immich_postgres_db_password }}" - name: deploy Immich-Microservices community.docker.docker_container: name: immich-microservices image: ghcr.io/immich-app/immich-server:release restart_policy: always command: ['start.sh', 'microservices'] volumes: - "{{ hdd_mount_point}}/immich/library:/usr/src/app/upload" - /etc/localtime:/etc/localtime networks: - name: immich-network env: DB_DATABASE_NAME: "{{ immich_postgres_db_name }}" DB_USERNAME: "{{ immich_postgres_db_user }}" DB_PASSWORD: "{{ immich_postgres_db_password }}" - name: deploy Immich-Server community.docker.docker_container: name: immich-server image: ghcr.io/immich-app/immich-server:release restart_policy: always command: ['start.sh', 'immich'] volumes: - "{{ hdd_mount_point}}/immich/library:/usr/src/app/upload" - /etc/localtime:/etc/localtime ports: - "2283:3001" networks: - name: immich-network env: DB_DATABASE_NAME: "{{ immich_postgres_db_name }}" DB_USERNAME: "{{ immich_postgres_db_user }}" DB_PASSWORD: "{{ immich_postgres_db_password }}" ``` And the corresponding variables: ``` yml immich_postgres_db_name: immich immich_postgres_db_user: postgres immich_postgres_db_password: postgres ```
Author
Owner

@lsrom commented on GitHub (May 14, 2024):

Same issue on Unraid, pulled latest docker image from ghcr.io/imagegenius/immich:latest.

Error: connect ETIMEDOUT
    at Socket.<anonymous> (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41)
    at Object.onceWrapper (node:events:633:28)
    at Socket.emit (node:events:519:28)
    at Socket._onTimeout (node:net:590:8)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7) {
  errorno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect'
}
```
@lsrom commented on GitHub (May 14, 2024): Same issue on Unraid, pulled latest docker image from ghcr.io/imagegenius/immich:latest. ```` Error: connect ETIMEDOUT at Socket.<anonymous> (/app/immich/server/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:633:28) at Socket.emit (node:events:519:28) at Socket._onTimeout (node:net:590:8) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } ```
Author
Owner

@notthedan commented on GitHub (May 24, 2024):

Was migrating immich to a new VM and came across this issue.

Just renamed my redis container from immich_redis to redis. Seemed to fix the issue.

@notthedan commented on GitHub (May 24, 2024): Was migrating immich to a new VM and came across this issue. Just renamed my redis container from `immich_redis` to `redis`. Seemed to fix the issue.
Author
Owner

@kellandJuniper commented on GitHub (Oct 4, 2024):

Same issue on Ubuntu.

immich_server            | [Nest] 17  - 10/05/2024, 2:41:30 AM   ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)...
immich_server            | Error: Connection terminated unexpectedly
immich_server            |     at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:131:73)
immich_server            |     at Object.onceWrapper (node:events:633:28)
immich_server            |     at Connection.emit (node:events:519:28)
immich_server            |     at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:62:12)
immich_server            |     at Socket.emit (node:events:519:28)
immich_server            |     at TCP.<anonymous> (node:net:339:12)

@kellandJuniper commented on GitHub (Oct 4, 2024): Same issue on Ubuntu. ```bash immich_server | [Nest] 17 - 10/05/2024, 2:41:30 AM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (1)... immich_server | Error: Connection terminated unexpectedly immich_server | at Connection.<anonymous> (/usr/src/app/node_modules/pg/lib/client.js:131:73) immich_server | at Object.onceWrapper (node:events:633:28) immich_server | at Connection.emit (node:events:519:28) immich_server | at Socket.<anonymous> (/usr/src/app/node_modules/pg/lib/connection.js:62:12) immich_server | at Socket.emit (node:events:519:28) immich_server | at TCP.<anonymous> (node:net:339:12) ```
Author
Owner

@Owen000 commented on GitHub (Oct 7, 2024):

Same issue deploying with helm on k8s

@Owen000 commented on GitHub (Oct 7, 2024): Same issue deploying with helm on k8s
Author
Owner

@harryfine commented on GitHub (Oct 10, 2024):

Same here. Using Synology and recommended Portainer install. All containers show running and healthy. Firewall on Synology is disabled. Auto-block on Synology is disabled. Firewall on local Linux PC disabled. Yet, when I try the URL http://192.168.1.103:2283, I get:
}
Error: connect ETIMEDOUT

at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)

at Object.onceWrapper (node:events:633:28)

at Socket.emit (node:events:519:28)

at Socket._onTimeout (node:net:591:8)

at listOnTimeout (node:internal/timers:581:17)

at process.processTimers (node:internal/timers:519:7) {

errorno: 'ETIMEDOUT',

code: 'ETIMEDOUT',

syscall: 'connect'

}

On the browser, it shows the connection was re-set.

@harryfine commented on GitHub (Oct 10, 2024): Same here. Using Synology and recommended Portainer install. All containers show running and healthy. Firewall on Synology is disabled. Auto-block on Synology is disabled. Firewall on local Linux PC disabled. Yet, when I try the URL http://192.168.1.103:2283, I get: } Error: connect ETIMEDOUT at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) at Object.onceWrapper (node:events:633:28) at Socket.emit (node:events:519:28) at Socket._onTimeout (node:net:591:8) at listOnTimeout (node:internal/timers:581:17) at process.processTimers (node:internal/timers:519:7) { errorno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect' } On the browser, it shows the connection was re-set.
Author
Owner

@AC13139 commented on GitHub (Oct 11, 2024):

Same here. Using Synology and recommended Portainer install. All containers show running and healthy. Firewall on Synology is disabled. Auto-block on Synology is disabled. Firewall on local Linux PC disabled. Yet, when I try the URL http://192.168.1.103:2283, I get: } Error: connect ETIMEDOUT

at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41)

at Object.onceWrapper (node:events:633:28)

at Socket.emit (node:events:519:28)

at Socket._onTimeout (node:net:591:8)

at listOnTimeout (node:internal/timers:581:17)

at process.processTimers (node:internal/timers:519:7) {

errorno: 'ETIMEDOUT',

code: 'ETIMEDOUT',

syscall: 'connect'

}

On the browser, it shows the connection was re-set.

It's because the firewall blocks the communications among the immich application containers
Here's how I solve this issue:

  • Get the Gateway and IP address from immich-app container. It could be as 172.9.0.1 / 172.9.0.5
  • Goto Synology Control Panel -> Security -> Firewall, edit the rule, and add a new rule as:
    Ports: All, Source IP: subnet 172.9.0.0 / 255.255.255.0, Action: Allow
  • Adjust the rule order and make sure any Deny rules will not skip this new rule.
  • Save and apply the change
  • Go back to the Container and restart immich-app

For other systems than Synology DSM, the solution concept should be the same - check the rules of host's firewall

@AC13139 commented on GitHub (Oct 11, 2024): > Same here. Using Synology and recommended Portainer install. All containers show running and healthy. Firewall on Synology is disabled. Auto-block on Synology is disabled. Firewall on local Linux PC disabled. Yet, when I try the URL http://192.168.1.103:2283, I get: } Error: connect ETIMEDOUT > > ``` > at Socket.<anonymous> (/usr/src/app/node_modules/ioredis/built/Redis.js:170:41) > > at Object.onceWrapper (node:events:633:28) > > at Socket.emit (node:events:519:28) > > at Socket._onTimeout (node:net:591:8) > > at listOnTimeout (node:internal/timers:581:17) > > at process.processTimers (node:internal/timers:519:7) { > ``` > > errorno: 'ETIMEDOUT', > > code: 'ETIMEDOUT', > > syscall: 'connect' > > } > > On the browser, it shows the connection was re-set. It's because the firewall blocks the communications among the immich application containers Here's how I solve this issue: - Get the Gateway and IP address from immich-app container. It could be as 172.9.0.1 / 172.9.0.5 - Goto Synology Control Panel -> Security -> Firewall, edit the rule, and add a new rule as: _Ports: All, Source IP: subnet 172.9.0.0 / 255.255.255.0, Action: Allow_ - Adjust the rule order and make sure any Deny rules will not skip this new rule. - Save and apply the change - Go back to the Container and restart immich-app For other systems than Synology DSM, the solution concept should be the same - check the rules of host's firewall
Author
Owner

@harryfine commented on GitHub (Oct 15, 2024):

@AndyChenSH you were correct, I disabled the firewall and was able to log in. Now to add the entry. When you say "Get the Gateway and IP address from immich-app container. It could be as 172.9.0.1 / 172.9.0.5", which of the 4 immich containers. Here's as screenshot of my containers. I am VERY new with Docker.
2024-10-15_16-22

@harryfine commented on GitHub (Oct 15, 2024): @AndyChenSH you were correct, I disabled the firewall and was able to log in. Now to add the entry. When you say **"Get the Gateway and IP address from immich-app container. It could be as 172.9.0.1 / 172.9.0.5"**, which of the 4 immich containers. Here's as screenshot of my containers. I am VERY new with Docker. ![2024-10-15_16-22](https://github.com/user-attachments/assets/4934c97e-d761-447a-8d62-02c960002684)
Author
Owner

@LightYear512 commented on GitHub (Oct 24, 2024):

你是对的,我禁用了防火墙并能够登录。现在添加条目。当您说**“从 immich-app 容器中获取网关和 IP 地址。它可以是 172.9.0.1 / 172.9.0.5“**,这是 4 个容器中的哪一个。这是我的容器的屏幕截图。我对 Docker 非常陌生。 2024-10-15_16-22
你可以查看 "IP Address" 列, 这里显示你的 "immich_server" 的 IP地址是 172.23.0.2, 也就是在 172.23.0.0 子网下, 所以 你只需要在编辑防火墙规则时, 子网一栏填写 172.23.0.1 , 其他流程一致

@LightYear512 commented on GitHub (Oct 24, 2024): > 你是对的,我禁用了防火墙并能够登录。现在添加条目。当您说**“从 immich-app 容器中获取网关和 IP 地址。它可以是 172.9.0.1 / 172.9.0.5“**,这是 4 个容器中的哪一个。这是我的容器的屏幕截图。我对 Docker 非常陌生。 ![2024-10-15_16-22](https://private-user-images.githubusercontent.com/15006441/376788309-4934c97e-d761-447a-8d62-02c960002684.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mjk3NTc4MzMsIm5iZiI6MTcyOTc1NzUzMywicGF0aCI6Ii8xNTAwNjQ0MS8zNzY3ODgzMDktNDkzNGM5N2UtZDc2MS00NDdhLThkNjItMDJjOTYwMDAyNjg0LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDEwMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDI0VDA4MTIxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3YjI5ZTBhZmMxMTU4MGUxYzgwYTZjZGVmOGJmYjlkOTI4NmZjODcxZjUwMzQyZmY2MTc5MDM0Y2M3YjA0Y2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ILzUP1ftVOHYX6hcSe9EsMLdl3JrLbhFTFdzRkm0o-Q) 你可以查看 "IP Address" 列, 这里显示你的 "immich_server" 的 IP地址是 172.23.0.2, 也就是在 172.23.0.0 子网下, 所以 你只需要在编辑防火墙规则时, 子网一栏填写 172.23.0.1 , 其他流程一致
Author
Owner

@audas commented on GitHub (Dec 2, 2024):

Has anyone managed to fix this issue or even address it?

Docker on Ubuntu. It appears to be due to trying to restart / re-install it.

@audas commented on GitHub (Dec 2, 2024): Has anyone managed to fix this issue or even address it? Docker on Ubuntu. It appears to be due to trying to restart / re-install it.
Author
Owner

@felix-kyun commented on GitHub (Dec 11, 2024):

Has anyone managed to fix this issue or even address it?

Docker on Ubuntu. It appears to be due to trying to restart / re-install it.

on the host running docker, try to restart iptables. it solved the issue for me.

iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
@felix-kyun commented on GitHub (Dec 11, 2024): > Has anyone managed to fix this issue or even address it? > > Docker on Ubuntu. It appears to be due to trying to restart / re-install it. on the host running docker, try to restart iptables. it solved the issue for me. ```bash iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT iptables -F ```
Author
Owner

@MrColumbo commented on GitHub (Feb 2, 2025):

the fixed worked for me as well but 12 hours later i run int the same issue. Fix (ip tables commands) fixes it again as well .....but i am wondering about the root cause ....

@MrColumbo commented on GitHub (Feb 2, 2025): the fixed worked for me as well but 12 hours later i run int the same issue. Fix (ip tables commands) fixes it again as well .....but i am wondering about the root cause ....
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1387