Seing issues connecting to redis on IPv6 only cluster #4264

Closed
opened 2026-02-20 03:02:58 -05:00 by deekerman · 2 comments
Owner

Originally created by @dioguerra on GitHub (Nov 10, 2024).

The bug

immich connecting to redis on IPv6 only cluster fails.

Can create a debug container and connect without problems:

kn media-server debug -it --image=nicolaka/netshoot immich-7b7d4bdb4b-8plsx

host media-server-redis-master.media-server.svc.cluster.local
media-server-redis-master.media-server.svc.cluster.local has IPv6 address fd00:10:96::667c

AND ======

kn media-server debug -it --image=ubuntu immich-7b7d4bdb4b-8plsx

apt update && apt install redis

kn media-server debug -it --image=ubuntu immich-7b7d4bdb4b-8plsx

redis-cli -h media-server-redis-master.media-server.svc
media-server-redis-master.media-server.svc:6379> KEYS *
(empty array)

Although I saw on docs that IPv6 is supported, and some Issues from other users point to problems of redis configuration, i think this is from immich container specifically to the redis module? PostgreSQL seems to resolve to the server without problems...

This is the failure from immich container:

Defaulted container "immich" out of: immich, debugger-bfcxx (ephem), debugger-85vlq (ephem)
Initializing Immich v1.119.0
Detected CPU Cores: 16
Starting api worker
Starting microservices worker
Error: getaddrinfo ENOTFOUND media-server-redis-master.media-server.svc.cluster.local
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) {
  errno: -3007,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'media-server-redis-master.media-server.svc.cluster.local'
}

[....]
missing 'error' handler on this Redis client
microservices worker error: MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.
microservices worker exited with code 1

Configs:
values.yaml

immich:
  fullnameOverride: immich
  env:
  #  TZ: GMT
  #  UMASK: 022
  #  PUID: 1001
  #  PGID: 1001
    IMMICH_PORT: 3001
    DB_HOSTNAME: 'media-server-postgresql.media-server.svc.cluster.local'
    REDIS_HOSTNAME: 'media-server-redis-master.media-server.svc.cluster.local'
  #  IMMICH_PORT: 2283
  #  IMMICH_HOST: "::"
  #  IMMICH_LOG_LEVEL: "verbose"
    #'media-server-redis-master'
  #  REDIS_PORT: 6379
  #  DB_USERNAME: "immich"
  #  DB_DATABASE_NAME: "immich"
  #  DB_PASSWORD: "immich"
  ##  # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance
  ##  IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}'
  immich:
    persistence:
      library:
        #enabled: true
        existingClaim: scrapbook
        #skipuninstall: true
  securityContext:
    runAsGroup: 1001
    runAsUser: 1001
  postgresql:
    enabled: false
    image:
      repository: tensorchord/pgvecto-rs
      tag: pg16-v0.3.0-rootless@sha256:d125f3aec02bfa66764432eae76e1098a3b0c6f8bf13db38f5af1156499c90b5
    global:
      postgresql:
        auth:
          username: immich
          database: immich
          password: immich
  redis:
    enable: false # use our redis installation
  server:
    image:
      tag: latest@sha256:24df1172544370826349159692d177ba22ca773c81857d36996a254c08422b95
      repository: ghcr.io/immich-app/immich-server
      pullPolicy: Always
    ingress:
      main:
        enabled: false
        annotations:
          kubernetes.io/ingress.class: nginx
          cert-manager.io/issuer: "letsencrypt"
          nginx.ingress.kubernetes.io/ssl-redirect: "true"
          nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
          #nginx.ingress.kubernetes.io/proxy-body-size: "0"
        hosts:
        - host: your.dns.com
          paths:
          #- path: "/immich"
          - path: "/"
        tls:
        - secretName: media-server-tls
          hosts:
          - your.dns.net
  machine-learning:
    enabled: false
    image:
      tag: v1.119.0@sha256:fa558ae8752eae335c5bfafeb5716dc60d0882f026350adb45e18ab28fbd36ae
      #tag: v1.117.0-armnn@ arm cpus and mali gpus
      repository: ghcr.io/immich-app/immich-machine-learning
      pullPolicy: Always

values-temp.yaml

immich:
  tolerations:
  - key: "node-role.kubernetes.io/control-plane"
    operator: "Exists"
    effect: "NoSchedule"
  redis:
    enabled: true
    master:
      persistence:
        enabled: false
      tolerations:
      - key: "node-role.kubernetes.io/control-plane"
        operator: "Exists"
        effect: "NoSchedule"
  postgresql:
    enabled: true
    primary:
      persistence:
        enabled: false
      tolerations:
      - key: "node-role.kubernetes.io/control-plane"
        operator: "Exists"
        effect: "NoSchedule"

Chart.yaml

- name: immich
  version: 0.8.4
  repository: https://immich-app.github.io/immich-charts
  condition: immich.enabled

will try to figre out stuff

The OS that Immich Server is running on

Linux cyborg 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux

Version of Immich Server

v.1.119.0

Version of Immich Mobile App

NAN

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

See above

Your .env content

See above

Reproduction steps

See above

Relevant log output

No response

Additional information

No response

Originally created by @dioguerra on GitHub (Nov 10, 2024). ### The bug immich connecting to redis on IPv6 only cluster fails. Can create a debug container and connect without problems: ``` kn media-server debug -it --image=nicolaka/netshoot immich-7b7d4bdb4b-8plsx host media-server-redis-master.media-server.svc.cluster.local media-server-redis-master.media-server.svc.cluster.local has IPv6 address fd00:10:96::667c AND ====== kn media-server debug -it --image=ubuntu immich-7b7d4bdb4b-8plsx apt update && apt install redis kn media-server debug -it --image=ubuntu immich-7b7d4bdb4b-8plsx redis-cli -h media-server-redis-master.media-server.svc media-server-redis-master.media-server.svc:6379> KEYS * (empty array) ``` Although I saw on docs that IPv6 is supported, and some Issues from other users point to problems of redis configuration, i think this is from immich container specifically to the redis module? PostgreSQL seems to resolve to the server without problems... This is the failure from immich container: ``` Defaulted container "immich" out of: immich, debugger-bfcxx (ephem), debugger-85vlq (ephem) Initializing Immich v1.119.0 Detected CPU Cores: 16 Starting api worker Starting microservices worker Error: getaddrinfo ENOTFOUND media-server-redis-master.media-server.svc.cluster.local at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) { errno: -3007, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'media-server-redis-master.media-server.svc.cluster.local' } [....] missing 'error' handler on this Redis client microservices worker error: MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details. microservices worker exited with code 1 ``` Configs: values.yaml ```yaml immich: fullnameOverride: immich env: # TZ: GMT # UMASK: 022 # PUID: 1001 # PGID: 1001 IMMICH_PORT: 3001 DB_HOSTNAME: 'media-server-postgresql.media-server.svc.cluster.local' REDIS_HOSTNAME: 'media-server-redis-master.media-server.svc.cluster.local' # IMMICH_PORT: 2283 # IMMICH_HOST: "::" # IMMICH_LOG_LEVEL: "verbose" #'media-server-redis-master' # REDIS_PORT: 6379 # DB_USERNAME: "immich" # DB_DATABASE_NAME: "immich" # DB_PASSWORD: "immich" ## # -- You should provide your own secret outside of this helm-chart and use `postgresql.global.postgresql.auth.existingSecret` to provide credentials to the postgresql instance ## IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}' immich: persistence: library: #enabled: true existingClaim: scrapbook #skipuninstall: true securityContext: runAsGroup: 1001 runAsUser: 1001 postgresql: enabled: false image: repository: tensorchord/pgvecto-rs tag: pg16-v0.3.0-rootless@sha256:d125f3aec02bfa66764432eae76e1098a3b0c6f8bf13db38f5af1156499c90b5 global: postgresql: auth: username: immich database: immich password: immich redis: enable: false # use our redis installation server: image: tag: latest@sha256:24df1172544370826349159692d177ba22ca773c81857d36996a254c08422b95 repository: ghcr.io/immich-app/immich-server pullPolicy: Always ingress: main: enabled: false annotations: kubernetes.io/ingress.class: nginx cert-manager.io/issuer: "letsencrypt" nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/force-ssl-redirect: "true" #nginx.ingress.kubernetes.io/proxy-body-size: "0" hosts: - host: your.dns.com paths: #- path: "/immich" - path: "/" tls: - secretName: media-server-tls hosts: - your.dns.net machine-learning: enabled: false image: tag: v1.119.0@sha256:fa558ae8752eae335c5bfafeb5716dc60d0882f026350adb45e18ab28fbd36ae #tag: v1.117.0-armnn@ arm cpus and mali gpus repository: ghcr.io/immich-app/immich-machine-learning pullPolicy: Always ``` values-temp.yaml ```yaml immich: tolerations: - key: "node-role.kubernetes.io/control-plane" operator: "Exists" effect: "NoSchedule" redis: enabled: true master: persistence: enabled: false tolerations: - key: "node-role.kubernetes.io/control-plane" operator: "Exists" effect: "NoSchedule" postgresql: enabled: true primary: persistence: enabled: false tolerations: - key: "node-role.kubernetes.io/control-plane" operator: "Exists" effect: "NoSchedule" ``` Chart.yaml ``` - name: immich version: 0.8.4 repository: https://immich-app.github.io/immich-charts condition: immich.enabled ``` will try to figre out stuff ### The OS that Immich Server is running on Linux cyborg 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux ### Version of Immich Server v.1.119.0 ### Version of Immich Mobile App NAN ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML See above ``` ### Your .env content ```Shell See above ``` ### Reproduction steps See above ### Relevant log output _No response_ ### Additional information _No response_
Author
Owner

@mmomjian commented on GitHub (Nov 10, 2024):

I believe the solution is outlined in #10397

@mmomjian commented on GitHub (Nov 10, 2024): I believe the solution is outlined in #10397
Author
Owner

@dioguerra commented on GitHub (Nov 10, 2024):

Thank you for pointing out to that page.

For all fellows searching for this issue, and because there is lot's of pointers but nobody presents anything. For a single client configuration it should be something like:

echo '{"host": "media-server-redis-master.media-server.svc.cluster.local", "db": 0, "family": 6}' | base64 -w0

add fields:

username
password

if configured

Then set:

REDIS_URL: ioredis://<base64>

@dioguerra commented on GitHub (Nov 10, 2024): Thank you for pointing out to that page. For all fellows searching for this issue, and because there is lot's of pointers but nobody presents anything. For a single client configuration it should be something like: ```bash echo '{"host": "media-server-redis-master.media-server.svc.cluster.local", "db": 0, "family": 6}' | base64 -w0 ``` add fields: ``` username password ``` if configured Then set: `REDIS_URL: ioredis://<base64>`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#4264
No description provided.