Incorrect redis server naming in example docker-compose triggers Redis NOAUTH error #3490

Closed
opened 2026-02-20 02:11:12 -05:00 by deekerman · 5 comments
Owner

Originally created by @a10kiloham on GitHub (Jul 26, 2024).

The bug

In the docker-compose the redis image is named 'immich_redis' which is sensible. However in the default sample .env, this is not included, so those using that will get NOAUTH errors because without REDIS_HOSTNAME configured, it defaults to 'redis' which is undefined unless one is already running a local redis image accessible under that name.

The OS that Immich Server is running on

Docker

Version of Immich Server

latest

Version of Immich Mobile App

latest

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

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

Your .env content

# Fix
REDIS_HOSTNAME=immich_redis

Reproduction steps

Curl the existing docker-compose.yml and .env files

Relevant log output

No response

Additional information

Submitting PR to fix this

Originally created by @a10kiloham on GitHub (Jul 26, 2024). ### The bug In the docker-compose the redis image is named 'immich_redis' which is sensible. However in the default sample .env, this is not included, so those using that will get NOAUTH errors because without REDIS_HOSTNAME configured, it defaults to 'redis' which is undefined unless one is already running a local redis image accessible under that name. ### The OS that Immich Server is running on Docker ### Version of Immich Server latest ### Version of Immich Mobile App latest ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:328fe6a5822256d065debb36617a8169dbfbd77b797c525288e465f56c1d392b healthcheck: test: redis-cli ping || exit 1 networks: - immich restart: always ``` ### Your .env content ```Shell # Fix REDIS_HOSTNAME=immich_redis ``` ### Reproduction steps ```bash Curl the existing docker-compose.yml and .env files ``` ### Relevant log output _No response_ ### Additional information Submitting PR to fix this
deekerman 2026-02-20 02:11:12 -05:00
  • closed this issue
  • added the
    tech-debt
    label
Author
Owner

@a10kiloham commented on GitHub (Jul 26, 2024):

Proposed solution here - https://github.com/immich-app/immich/pull/11378

@a10kiloham commented on GitHub (Jul 26, 2024): Proposed solution here - https://github.com/immich-app/immich/pull/11378
Author
Owner

@mmomjian commented on GitHub (Jul 26, 2024):

So, most instances of docker will resolve either the container name, hostname, or service name (which is redis) to the container.

With that said, I've felt that we should fix this issue before we go to stable. I would propose something different than your PR, though. I've seen a lot of people have this issue come up.

I honestly think we should specify the service name, container name, and hostname for every service to all be identical. Something like immich-server, immich-redis, immich-postgres. (you can't use _ in hostnames). At the same time we could add those as the hostnames to the default env file, and it shouldn't break old installs. Whether this will actually happen is a big question.

Example:

services:
  immich-server:
    container_name: immich-server
    hostname: immich-server
    image: ...
@mmomjian commented on GitHub (Jul 26, 2024): So, most instances of docker will resolve either the container name, hostname, or *service name* (which is `redis`) to the container. With that said, I've felt that we should fix this issue before we go to stable. I would propose something different than your PR, though. I've seen a lot of people have this issue come up. I honestly think we should specify the service name, container name, and hostname for every service to all be identical. Something like `immich-server`, `immich-redis`, `immich-postgres`. (you can't use `_` in hostnames). At the same time we could add those as the hostnames to the default env file, and it shouldn't break old installs. Whether this will actually happen is a big question. Example: ``` services: immich-server: container_name: immich-server hostname: immich-server image: ... ```
Author
Owner

@a10kiloham commented on GitHub (Jul 26, 2024):

Yeah these are all inelegant options. I have a legacy container named redis and this is what tripped me up. The correct way is indeed immich-redis style naming I agree. Your proposal makes the most sense but will lead to some breaking changes I suppose.

@a10kiloham commented on GitHub (Jul 26, 2024): Yeah these are all inelegant options. I have a legacy container named redis and this is what tripped me up. The correct way is indeed immich-redis style naming I agree. Your proposal makes the most sense but will lead to some breaking changes I suppose.
Author
Owner

@alextran1502 commented on GitHub (Jul 26, 2024):

We can solve this right before going stable to avoid making unnecessary breaking changes to others setup now

@alextran1502 commented on GitHub (Jul 26, 2024): We can solve this right before going stable to avoid making unnecessary breaking changes to others setup now
Author
Owner

@jrasm91 commented on GitHub (Jun 23, 2025):

Yeah, so this isn't an actual bug with immich, and I will be closing the issue. We are aware of some usability improvements that can be made with the docker compose file and we will work to make those improvements as we get closer to a stable release.

The server does default to redis, which is the service name of the container in the default setup, so everything works as expected.

@jrasm91 commented on GitHub (Jun 23, 2025): Yeah, so this isn't an actual bug with immich, and I will be closing the issue. We are aware of some usability improvements that can be made with the docker compose file and we will work to make those improvements as we get closer to a stable release. The server does default to `redis`, which is the _service_ name of the container in the default setup, so everything works as expected.
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#3490
No description provided.