Immiche machine learning UNHEALTY when HOST is not 0.0.0.0 #6447

Closed
opened 2026-02-05 12:17:50 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @ronzino83 on GitHub (Jul 9, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

Immich Machine Learning container ,with two NIC

  1. ETH0 bridge for internet access 172.18.0.0/16
  2. ETH1 macvlan 172.16.0.0/29 reserved for communication with the Immich Server

Immich Machine Learning ip for macvlan is 172.16.0.3
ip r default via 172.18.0.1 dev eth0 172.16.0.0/29 dev eth1 proto kernel scope link src 172.16.0.3 172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.2

by default, Machine Learning server listens to 0.0.0.0 ( [::] ) on port 3003.

I would like to listen for incoming connection only on 172.16.0.3:3003

Setting the following environmental variable will bring the container in unhealty state, without log details

IMMICH_HOST=172.16.0.3

The OS that Immich Server is running on

Ubuntu 25.04

Version of Immich Server

v1.135.3

Version of Immich Mobile App

not relevant

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich_remote_ml

services:
  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
    environment:
      - MACHINE_LEARNING_WORKER_TIMEOUT=300
      - CPU_CORES=4
      - MACHINE_LEARNING_MODEL_INTRA_OP_THREADS=2
      - MACHINE_LEARNING_REQUEST_THREADS=4
      - IMMICH_HOST=172.16.0.3
    device_cgroup_rules:
      - 'c 189:* rmw'
    devices:
      - /dev/dri:/dev/dri
    volumes:
      - /dev/bus/usb:/dev/bus/usb
      - model-cache:/cache
    restart: always
    networks:
      ImmichBridge:
      ImmichNET:
        ipv4_address: 172.16.0.3
      # ports:
      #  - 3003:3003
networks:
  ImmichBridge:
    driver: bridge
  ImmichNET:
    driver: macvlan
    driver_opts:
      parent: eth1
    ipam:
      config:
        - subnet: 172.16.0.0/29
          gateway: 172.16.0.1

volumes:
  model-cache:

Your .env content

PATH=/opt/venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=8cfc87df6ce4
CPU_CORES=4
MACHINE_LEARNING_MODEL_INTRA_OP_THREADS=2
MACHINE_LEARNING_REQUEST_THREADS=4
IMMICH_HOST=172.16.0.3
MACHINE_LEARNING_WORKER_TIMEOUT=300
LANG=C.UTF-8
GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D
PYTHON_VERSION=3.11.13
PYTHON_SHA256=8fb5f9fbc7609fa822cb31549884575db7fd9657cbffb89510b5d7975963a83a
TRANSFORMERS_CACHE=/cache
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1
PYTHONPATH=/usr/src
DEVICE=openvino
VIRTUAL_ENV=/opt/venv
MACHINE_LEARNING_CACHE_FOLDER=/cache
IMMICH_BUILD=15787118459
IMMICH_BUILD_URL=https://github.com/immich-app/immich/actions/runs/15787118459
IMMICH_BUILD_IMAGE=v1.135.3
IMMICH_BUILD_IMAGE_URL=https://github.com/immich-app/immich/pkgs/container/immich-machine-learning
IMMICH_REPOSITORY=immich-app/immich
IMMICH_REPOSITORY_URL=https://github.com/immich-app/immich
IMMICH_SOURCE_REF=v1.135.3
IMMICH_SOURCE_COMMIT=6563fa608a5a4414f40264b847e60928916fb986
IMMICH_SOURCE_URL=https://github.com/immich-app/immich/commit/6563fa608a5a4414f40264b847e60928916fb986
HOME=/root

Reproduction steps

  1. Deploy a container with the given docker compose
  2. wait few seconds and i will beacome unhealty without log

...

Relevant log output

docker inspect --format "{{json .State.Health }}" immich_machine_learning | jq .
{
  "Status": "unhealthy",
  "FailingStreak": 110,
  "Log": [
    {
      "Start": "2025-07-09T15:45:30.698789185Z",
      "End": "2025-07-09T15:45:31.11968527Z",
      "ExitCode": 1,
      "Output": ""
    },
    {
      "Start": "2025-07-09T15:46:01.120191144Z",
      "End": "2025-07-09T15:46:01.585135843Z",
      "ExitCode": 1,
      "Output": ""
    },
    {
      "Start": "2025-07-09T15:46:31.586426615Z",
      "End": "2025-07-09T15:46:32.058841605Z",
      "ExitCode": 1,
      "Output": ""
    },
    {
      "Start": "2025-07-09T15:47:02.060283583Z",
      "End": "2025-07-09T15:47:02.536587095Z",
      "ExitCode": 1,
      "Output": ""
    },
    {
      "Start": "2025-07-09T15:47:32.537582004Z",
      "End": "2025-07-09T15:47:33.028920473Z",
      "ExitCode": 1,
      "Output": ""
    }
  ]
}

Additional information

No response

Originally created by @ronzino83 on GitHub (Jul 9, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug Immich Machine Learning container ,with two NIC 1. ETH0 bridge for internet access 172.18.0.0/16 2. ETH1 macvlan 172.16.0.0/29 reserved for communication with the Immich Server Immich Machine Learning ip for macvlan is 172.16.0.3 `ip r default via 172.18.0.1 dev eth0 172.16.0.0/29 dev eth1 proto kernel scope link src 172.16.0.3 172.18.0.0/16 dev eth0 proto kernel scope link src 172.18.0.2 ` by default, Machine Learning server listens to 0.0.0.0 ( [::] ) on port 3003. I would like to listen for incoming connection only on 172.16.0.3:3003 Setting the following environmental variable will bring the container in unhealty state, without log details IMMICH_HOST=172.16.0.3 ### The OS that Immich Server is running on Ubuntu 25.04 ### Version of Immich Server v1.135.3 ### Version of Immich Mobile App not relevant ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML name: immich_remote_ml services: immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino environment: - MACHINE_LEARNING_WORKER_TIMEOUT=300 - CPU_CORES=4 - MACHINE_LEARNING_MODEL_INTRA_OP_THREADS=2 - MACHINE_LEARNING_REQUEST_THREADS=4 - IMMICH_HOST=172.16.0.3 device_cgroup_rules: - 'c 189:* rmw' devices: - /dev/dri:/dev/dri volumes: - /dev/bus/usb:/dev/bus/usb - model-cache:/cache restart: always networks: ImmichBridge: ImmichNET: ipv4_address: 172.16.0.3 # ports: # - 3003:3003 networks: ImmichBridge: driver: bridge ImmichNET: driver: macvlan driver_opts: parent: eth1 ipam: config: - subnet: 172.16.0.0/29 gateway: 172.16.0.1 volumes: model-cache: ``` ### Your .env content ```Shell PATH=/opt/venv/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=8cfc87df6ce4 CPU_CORES=4 MACHINE_LEARNING_MODEL_INTRA_OP_THREADS=2 MACHINE_LEARNING_REQUEST_THREADS=4 IMMICH_HOST=172.16.0.3 MACHINE_LEARNING_WORKER_TIMEOUT=300 LANG=C.UTF-8 GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D PYTHON_VERSION=3.11.13 PYTHON_SHA256=8fb5f9fbc7609fa822cb31549884575db7fd9657cbffb89510b5d7975963a83a TRANSFORMERS_CACHE=/cache PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONPATH=/usr/src DEVICE=openvino VIRTUAL_ENV=/opt/venv MACHINE_LEARNING_CACHE_FOLDER=/cache IMMICH_BUILD=15787118459 IMMICH_BUILD_URL=https://github.com/immich-app/immich/actions/runs/15787118459 IMMICH_BUILD_IMAGE=v1.135.3 IMMICH_BUILD_IMAGE_URL=https://github.com/immich-app/immich/pkgs/container/immich-machine-learning IMMICH_REPOSITORY=immich-app/immich IMMICH_REPOSITORY_URL=https://github.com/immich-app/immich IMMICH_SOURCE_REF=v1.135.3 IMMICH_SOURCE_COMMIT=6563fa608a5a4414f40264b847e60928916fb986 IMMICH_SOURCE_URL=https://github.com/immich-app/immich/commit/6563fa608a5a4414f40264b847e60928916fb986 HOME=/root ``` ### Reproduction steps 1. Deploy a container with the given docker compose 2. wait few seconds and i will beacome unhealty without log 3. ... ### Relevant log output ```shell docker inspect --format "{{json .State.Health }}" immich_machine_learning | jq . { "Status": "unhealthy", "FailingStreak": 110, "Log": [ { "Start": "2025-07-09T15:45:30.698789185Z", "End": "2025-07-09T15:45:31.11968527Z", "ExitCode": 1, "Output": "" }, { "Start": "2025-07-09T15:46:01.120191144Z", "End": "2025-07-09T15:46:01.585135843Z", "ExitCode": 1, "Output": "" }, { "Start": "2025-07-09T15:46:31.586426615Z", "End": "2025-07-09T15:46:32.058841605Z", "ExitCode": 1, "Output": "" }, { "Start": "2025-07-09T15:47:02.060283583Z", "End": "2025-07-09T15:47:02.536587095Z", "ExitCode": 1, "Output": "" }, { "Start": "2025-07-09T15:47:32.537582004Z", "End": "2025-07-09T15:47:33.028920473Z", "ExitCode": 1, "Output": "" } ] } ``` ### Additional information _No response_
Author
Owner

@AdamT20054 commented on GitHub (Jul 10, 2025):

I've left a comment on the PR for the devs to eval.

@AdamT20054 commented on GitHub (Jul 10, 2025): I've left a comment on the PR for the devs to eval.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6447