From eb08853b50142567bd4c33ee3e80a7f47cff6ff6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 28 Mar 2026 22:42:07 +0000 Subject: [PATCH] Fix Redis in immich_cuda: install redis-server directly instead of Docker mods Apply the same Redis fix from the immich addon to immich_cuda: - Remove DOCKER_MODS env var from Dockerfile and config.yaml - Add redis-server to PACKAGES for direct installation - s6-rc service files, redis.conf, and 20-folders.sh were already updated This prevents ECONNRESET errors caused by Docker mods failing to install Redis at runtime (issue #2615). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- immich/CHANGELOG.md | 3 + immich/Dockerfile | 11 +--- immich/config.yaml | 3 +- immich/rootfs/defaults/redis.conf | 64 +++++++++++++++++++ immich/rootfs/etc/cont-init.d/20-folders.sh | 3 +- .../etc/s6-overlay/s6-rc.d/svc-redis/run | 27 ++++++++ .../etc/s6-overlay/s6-rc.d/svc-redis/type | 1 + .../s6-rc.d/user/contents.d/svc-redis | 0 immich_cuda/CHANGELOG.md | 3 + immich_cuda/Dockerfile | 11 +--- immich_cuda/config.yaml | 3 +- 11 files changed, 107 insertions(+), 22 deletions(-) create mode 100644 immich/rootfs/defaults/redis.conf create mode 100644 immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/run create mode 100644 immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/type create mode 100644 immich/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/svc-redis diff --git a/immich/CHANGELOG.md b/immich/CHANGELOG.md index 763243e49..ab871b58e 100644 --- a/immich/CHANGELOG.md +++ b/immich/CHANGELOG.md @@ -1,4 +1,7 @@ +## 2.6.2-2 (2026-03-28) +- Fix Redis startup: install redis-server directly instead of via Docker mods to prevent ECONNRESET errors (issue #2615) + ## 2.6.2 (2026-03-28) - Update to latest version from imagegenius/docker-immich (changelog : https://github.com/imagegenius/docker-immich/releases) diff --git a/immich/Dockerfile b/immich/Dockerfile index bac5a8ee4..95390e30c 100644 --- a/immich/Dockerfile +++ b/immich/Dockerfile @@ -34,13 +34,8 @@ COPY ha_lsio.sh /ha_lsio.sh ARG CONFIGLOCATION="/config" RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh -# Install REDIS -ENV DOCKER_MODS="imagegenius/mods:universal-redis" - -# && chmod 777 -R /docker-mods \ -# && /./docker-mods/* || ls / \ -# && if [ !-f /defaults/redis.conf ]; then echo "Not installed" && exit 1; fi -#ENV DOCKER_MODS="" +# Install REDIS directly instead of via Docker mods for reliability +# (Docker mods can fail to install Redis at runtime, causing ECONNRESET errors) ################## # 3 Install apps # @@ -63,7 +58,7 @@ COPY ha_automodules.sh /ha_automodules.sh RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh # Manual apps -ENV PACKAGES="sudo yamllint pip sed jq" +ENV PACKAGES="sudo yamllint pip sed jq redis-server" # Automatic apps & bashio COPY ha_autoapps.sh /ha_autoapps.sh diff --git a/immich/config.yaml b/immich/config.yaml index 8489793c8..3a11308d1 100644 --- a/immich/config.yaml +++ b/immich/config.yaml @@ -71,7 +71,6 @@ devices: - /dev/nvme2 environment: CI_PORT: "8080" - DOCKER_MODS: imagegenius/mods:universal-redis MACHINE_LEARNING_CACHE_FOLDER: /data/machine-learning MACHINE_LEARNING_WORKERS: "1" MACHINE_LEARNING_WORKER_TIMEOUT: "120" @@ -143,6 +142,6 @@ slug: immich udev: true url: https://github.com/alexbelgium/hassio-addons usb: true -version: "2.6.2" +version: "2.6.2-2" video: true webui: http://[HOST]:[PORT:8080] diff --git a/immich/rootfs/defaults/redis.conf b/immich/rootfs/defaults/redis.conf new file mode 100644 index 000000000..62f9f5504 --- /dev/null +++ b/immich/rootfs/defaults/redis.conf @@ -0,0 +1,64 @@ +## custom configuration file, please be aware that changing options here may break things +## uncomment what you need to adjust, leave commented to use default settings +## see https://redis.io/topics/config for help + +#protected-mode yes +#tcp-backlog 511 +#timeout 0 +#tcp-keepalive 300 +#databases 16 +#save 900 1 +#save 300 10 +#save 60 10000 +#stop-writes-on-bgsave-error yes +#rdbcompression yes +#rdbchecksum yes +#dbfilename dump.rdb +#rdb-del-sync-files no +#replica-serve-stale-data yes +#replica-read-only yes +#repl-diskless-sync no +#repl-diskless-sync-delay 5 +#repl-diskless-load disabled +#repl-disable-tcp-nodelay no +#replica-priority 100 +#acllog-max-len 128 +#lazyfree-lazy-eviction no +#lazyfree-lazy-expire no +#lazyfree-lazy-server-del no +#replica-lazy-flush no +#lazyfree-lazy-user-del no +#oom-score-adj no +#oom-score-adj-values 0 200 800 +#appendonly no +#appendfilename "appendonly.aof" +#appendfsync everysec +#no-appendfsync-on-rewrite no +#auto-aof-rewrite-percentage 100 +#auto-aof-rewrite-min-size 64mb +#aof-load-truncated yes +#aof-use-rdb-preamble yes +#lua-time-limit 5000 +#slowlog-log-slower-than 10000 +#slowlog-max-len 128 +#latency-monitor-threshold 0 +#notify-keyspace-events "" +#hash-max-ziplist-entries 512 +#hash-max-ziplist-value 64 +#list-max-ziplist-size -2 +#list-compress-depth 0 +#set-max-intset-entries 512 +#zset-max-ziplist-entries 128 +#zset-max-ziplist-value 64 +#hll-sparse-max-bytes 3000 +#stream-node-max-bytes 4096 +#stream-node-max-entries 100 +#activerehashing yes +#client-output-buffer-limit normal 0 0 0 +#client-output-buffer-limit replica 256mb 64mb 60 +#client-output-buffer-limit pubsub 32mb 8mb 60 +#hz 10 +#dynamic-hz yes +#aof-rewrite-incremental-fsync yes +#rdb-save-incremental-fsync yes +#jemalloc-bg-thread yes diff --git a/immich/rootfs/etc/cont-init.d/20-folders.sh b/immich/rootfs/etc/cont-init.d/20-folders.sh index 0a4fce329..33a4e1a94 100755 --- a/immich/rootfs/etc/cont-init.d/20-folders.sh +++ b/immich/rootfs/etc/cont-init.d/20-folders.sh @@ -97,9 +97,8 @@ fi # REDIS LOCATION # ################## -echo "sed -i \"s=/config/redis=/data/redis=g\" /etc/s6*/s6*/*/run" >> /docker-mods -echo "sed -i \"s=/config/log/redis=/data/log=g\" /etc/s6*/s6*/*/run" >> /docker-mods mkdir -p /data/redis mkdir -p /data/log +mkdir -p /var/run/redis chmod 755 /data/redis chmod 755 /data/log diff --git a/immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/run b/immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/run new file mode 100644 index 000000000..48d323e25 --- /dev/null +++ b/immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/run @@ -0,0 +1,27 @@ +#!/usr/bin/with-contenv bash + +# Create Redis directories +mkdir -p \ + /data/redis \ + /data/log \ + /var/run/redis + +# Copy default redis.conf if not present +if [[ ! -f /data/redis/redis.conf ]]; then + cp /defaults/redis.conf /data/redis/redis.conf 2>/dev/null || touch /data/redis/redis.conf +fi + +# Set permissions +chown -R root:root \ + /data/redis \ + /data/log \ + /var/run/redis + +exec \ + redis-server /data/redis/redis.conf \ + --bind 127.0.0.1 \ + --port 6379 \ + --pidfile /var/run/redis/redis.pid \ + --always-show-logo no \ + --dir /data/redis \ + --logfile /data/log/redis.log diff --git a/immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/type b/immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/type new file mode 100644 index 000000000..5883cff0c --- /dev/null +++ b/immich/rootfs/etc/s6-overlay/s6-rc.d/svc-redis/type @@ -0,0 +1 @@ +longrun diff --git a/immich/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/svc-redis b/immich/rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/svc-redis new file mode 100644 index 000000000..e69de29bb diff --git a/immich_cuda/CHANGELOG.md b/immich_cuda/CHANGELOG.md index 290a3387c..548a6581b 100644 --- a/immich_cuda/CHANGELOG.md +++ b/immich_cuda/CHANGELOG.md @@ -1,4 +1,7 @@ +## 2.6.2-2 (2026-03-28) +- Fix Redis startup: install redis-server directly instead of via Docker mods to prevent ECONNRESET errors (issue #2615) + ## 2.6.2 (2026-03-28) - Update to latest version from imagegenius/docker-immich (changelog : https://github.com/imagegenius/docker-immich/releases) diff --git a/immich_cuda/Dockerfile b/immich_cuda/Dockerfile index cd92bf862..17e0b518c 100644 --- a/immich_cuda/Dockerfile +++ b/immich_cuda/Dockerfile @@ -34,13 +34,8 @@ COPY ha_lsio.sh /ha_lsio.sh ARG CONFIGLOCATION="/config" RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGLOCATION"; fi && rm /ha_lsio.sh -# Install REDIS -ENV DOCKER_MODS="imagegenius/mods:universal-redis" - -# && chmod 777 -R /docker-mods \ -# && /./docker-mods/* || ls / \ -# && if [ !-f /defaults/redis.conf ]; then echo "Not installed" && exit 1; fi -#ENV DOCKER_MODS="" +# Install REDIS directly instead of via Docker mods for reliability +# (Docker mods can fail to install Redis at runtime, causing ECONNRESET errors) ################## # 3 Install apps # @@ -63,7 +58,7 @@ COPY ha_automodules.sh /ha_automodules.sh RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh # Manual apps -ENV PACKAGES="sudo sed yamllint pip jq" +ENV PACKAGES="sudo sed yamllint pip jq redis-server" # Automatic apps & bashio COPY ha_autoapps.sh /ha_autoapps.sh diff --git a/immich_cuda/config.yaml b/immich_cuda/config.yaml index ada8bf150..1fd06f722 100644 --- a/immich_cuda/config.yaml +++ b/immich_cuda/config.yaml @@ -69,7 +69,6 @@ devices: - /dev/nvme2 environment: CI_PORT: "8080" - DOCKER_MODS: imagegenius/mods:universal-redis MACHINE_LEARNING_CACHE_FOLDER: /data/machine-learning MACHINE_LEARNING_WORKERS: "1" MACHINE_LEARNING_WORKER_TIMEOUT: "120" @@ -141,6 +140,6 @@ slug: immich_cuda udev: true url: https://github.com/alexbelgium/hassio-addons usb: true -version: "2.6.2" +version: "2.6.2-2" video: true webui: http://[HOST]:[PORT:8080]