Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 3 tasks
purandarrao opened this issue Sep 30, 2023 · 10 comments
Closed
2 of 3 tasks

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

purandarrao opened this issue Sep 30, 2023 · 10 comments
Labels
bug Something isn't working needs triage Bug that needs triage from maintainer

Comments

@purandarrao
Copy link

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:
#2931 (comment)

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;
@purandarrao purandarrao added bug Something isn't working needs triage Bug that needs triage from maintainer labels Sep 30, 2023
@itangqiao
Copy link

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

@DanielEcho
Copy link

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
Copy link

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

@itangqiao
Copy link

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.

@purandarrao
Copy link
Author

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

@f-x1-1
Copy link

f-x1-1 commented 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)

@shierro
Copy link

shierro commented Mar 8, 2024

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

@Tywele
Copy link

Tywele commented 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

@lsrom
Copy link

lsrom commented 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'
}
```

@daahny
Copy link

daahny commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Bug that needs triage from maintainer
Projects
None yet
Development

No branches or pull requests

8 participants