Issues with smart search and facial recognition #3558

Closed
opened 2026-02-05 08:59:21 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @gdechene on GitHub (Jun 17, 2024).

The bug

Hello,

I have an issue with smart search and facial recognition.
The first time I launched them, all was ok. I uploaded others pictures and when I relaunch this two jobs, I have errors in the logs.

The OS that Immich Server is running on

Debian 12.5 on docker

Version of Immich Server

V1.106.4

Version of Immich Mobile App

V1.106.3 build.143

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.9"
services:
  immich-redis:
    image: redis
    container_name: Immich-REDIS
    hostname: immich-redis
    healthcheck:
      test:
        - CMD-SHELL
        - redis-cli ping || exit 1
    environment:
      - TZ=Europe/Paris
    volumes:
      - /home/ny_name/docker/immich/redis:/data
    restart: always
  immich-db:
    image: tensorchord/pgvecto-rs:pg16-v0.2.0
    container_name: Immich-DB
    hostname: immich-db
    healthcheck:
      test:
        - CMD
        - pg_isready
        - -q
        - -d
        - immich
        - -U
        - immichuser
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - /home/ny_name/docker/immich/db:/var/lib/postgresql/data
    environment:
      - TZ=Europe/Paris
      - POSTGRES_DB=immich
      - POSTGRES_USER=immichuser
      - POSTGRES_PASSWORD=immichpw
    restart: always
  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    container_name: Immich-SERVER
    hostname: immich-server
    environment:
      - NODE_ENV=$NODE_ENV
      - TZ=Europe/Paris
      - DB_HOSTNAME=$DB_HOSTNAME
      - DB_USERNAME=$DB_USERNAME
      - DB_PASSWORD=$DB_PASSWORD
      - DB_DATABASE_NAME=$DB_DATABASE_NAME
      - REDIS_HOSTNAME=$REDIS_HOSTNAME
      - LOG_LEVEL=$LOG_LEVEL
      - JWT_SECRET=$JWT_SECRET
      - DISABLE_REVERSE_GEOCODING=$DISABLE_REVERSE_GEOCODING
      - REVERSE_GEOCODING_PRECISION=$REVERSE_GEOCODING_PRECISION
      - IMMICH_WEB_URL=$IMMICH_WEB_URL
      - IMMICH_SERVER_URL=$IMMICH_SERVER_URL
      - IMMICH_MACHINE_LEARNING_URL=$IMMICH_MACHINE_LEARNING_URL
    ports:
      - 8212:3001
    volumes:
      - /mnt/toshiba/photos/:/usr/src/app/upload
    restart: always
    depends_on:
      immich-redis:
        condition: service_healthy
      immich-db:
        condition: service_started
  immich-machine-learning:
    image: ghcr.io/immich-app/immich-machine-learning:v1.105.1
    container_name: Immich-LEARNING
    hostname: immich-machine-learning
    volumes:
      - /mnt/toshiba/photos/:/usr/src/app/upload
      - /home/ny_name/docker/immich/cache:/cache
    restart: always
    depends_on:
      immich-db:
        condition: service_started
    environment:
      - NODE_ENV=$NODE_ENV
      - TZ=Europe/Paris
      - DB_HOSTNAME=$DB_HOSTNAME
      - DB_USERNAME=$DB_USERNAME
      - DB_PASSWORD=$DB_PASSWORD
      - DB_DATABASE_NAME=$DB_DATABASE_NAME
      - REDIS_HOSTNAME=$REDIS_HOSTNAME
      - LOG_LEVEL=$LOG_LEVEL
      - JWT_SECRET=$JWT_SECRET
      - DISABLE_REVERSE_GEOCODING=$DISABLE_REVERSE_GEOCODING
      - REVERSE_GEOCODING_PRECISION=$REVERSE_GEOCODING_PRECISION
      - IMMICH_WEB_URL=$IMMICH_WEB_URL
      - IMMICH_SERVER_URL=$IMMICH_SERVER_URL
      - IMMICH_MACHINE_LEARNING_URL=$IMMICH_MACHINE_LEARNING_URL
networks: {}

Your .env content

NODE_ENV=production
DB_HOSTNAME=immich-db
DB_USERNAME=immichuser
DB_PASSWORD=immichpw
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich-redis
LOG_LEVEL=log
JWT_SECRET=jwt_token...
DISABLE_REVERSE_GEOCODING=false
REVERSE_GEOCODING_PRECISION=3
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

Reproduction steps

1. Upload photos
2. Launch jobs
3. Upload others photos
4. Relaunch smart search and facial recognition

Relevant log output

[Nest] 7  - 06/17/2024, 4:55:08 PM   ERROR [Microservices:JobService] Unable to run job handler (smartSearch/smart-search): Error: Machine learning request '{"clip":{"visual":{"modelName":"ViT-B-32__openai"}}}' failed with status 422: Unprocessable Entity
[Nest] 7  - 06/17/2024, 4:55:08 PM   ERROR [Microservices:JobService] Error: Machine learning request '{"clip":{"visual":{"modelName":"ViT-B-32__openai"}}}' failed with status 422: Unprocessable Entity
    at MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine-learning.repository.js:22:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MachineLearningRepository.encodeImage (/usr/src/app/dist/repositories/machine-learning.repository.js:42:26)
    at async SmartInfoService.handleEncodeClip (/usr/src/app/dist/services/smart-info.service.js:86:27)
    at async /usr/src/app/dist/services/job.service.js:148:36
    at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
    at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
[Nest] 7  - 06/17/2024, 4:55:08 PM   ERROR [Microservices:JobService] Object:
{
  "id": "9ff8d839-d9e6-4c77-b6fa-6fa79d95e397"
}

    all values are hidden

[Nest] 7  - 06/17/2024, 4:46:26 PM   ERROR [Microservices:JobService] Unable to run job handler (faceDetection/face-detection): Error: Machine learning request '{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}' failed with status 422: Unprocessable Entity
[Nest] 7  - 06/17/2024, 4:46:26 PM   ERROR [Microservices:JobService] Error: Machine learning request '{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}' failed with status 422: Unprocessable Entity
    at MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine-learning.repository.js:22:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MachineLearningRepository.detectFaces (/usr/src/app/dist/repositories/machine-learning.repository.js:33:26)
    at async PersonService.handleDetectFaces (/usr/src/app/dist/services/person.service.js:274:52)
    at async /usr/src/app/dist/services/job.service.js:148:36
    at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
    at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
[Nest] 7  - 06/17/2024, 4:46:26 PM   ERROR [Microservices:JobService] Object:
{
  "id": "24197c11-50c4-46cd-a0e0-285a72880f39"
}

    all values are hidden

Additional information

No response

Originally created by @gdechene on GitHub (Jun 17, 2024). ### The bug Hello, I have an issue with smart search and facial recognition. The first time I launched them, all was ok. I uploaded others pictures and when I relaunch this two jobs, I have errors in the logs. ### The OS that Immich Server is running on Debian 12.5 on docker ### Version of Immich Server V1.106.4 ### Version of Immich Mobile App V1.106.3 build.143 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.9" services: immich-redis: image: redis container_name: Immich-REDIS hostname: immich-redis healthcheck: test: - CMD-SHELL - redis-cli ping || exit 1 environment: - TZ=Europe/Paris volumes: - /home/ny_name/docker/immich/redis:/data restart: always immich-db: image: tensorchord/pgvecto-rs:pg16-v0.2.0 container_name: Immich-DB hostname: immich-db healthcheck: test: - CMD - pg_isready - -q - -d - immich - -U - immichuser interval: 10s timeout: 5s retries: 5 volumes: - /home/ny_name/docker/immich/db:/var/lib/postgresql/data environment: - TZ=Europe/Paris - POSTGRES_DB=immich - POSTGRES_USER=immichuser - POSTGRES_PASSWORD=immichpw restart: always immich-server: image: ghcr.io/immich-app/immich-server:release container_name: Immich-SERVER hostname: immich-server environment: - NODE_ENV=$NODE_ENV - TZ=Europe/Paris - DB_HOSTNAME=$DB_HOSTNAME - DB_USERNAME=$DB_USERNAME - DB_PASSWORD=$DB_PASSWORD - DB_DATABASE_NAME=$DB_DATABASE_NAME - REDIS_HOSTNAME=$REDIS_HOSTNAME - LOG_LEVEL=$LOG_LEVEL - JWT_SECRET=$JWT_SECRET - DISABLE_REVERSE_GEOCODING=$DISABLE_REVERSE_GEOCODING - REVERSE_GEOCODING_PRECISION=$REVERSE_GEOCODING_PRECISION - IMMICH_WEB_URL=$IMMICH_WEB_URL - IMMICH_SERVER_URL=$IMMICH_SERVER_URL - IMMICH_MACHINE_LEARNING_URL=$IMMICH_MACHINE_LEARNING_URL ports: - 8212:3001 volumes: - /mnt/toshiba/photos/:/usr/src/app/upload restart: always depends_on: immich-redis: condition: service_healthy immich-db: condition: service_started immich-machine-learning: image: ghcr.io/immich-app/immich-machine-learning:v1.105.1 container_name: Immich-LEARNING hostname: immich-machine-learning volumes: - /mnt/toshiba/photos/:/usr/src/app/upload - /home/ny_name/docker/immich/cache:/cache restart: always depends_on: immich-db: condition: service_started environment: - NODE_ENV=$NODE_ENV - TZ=Europe/Paris - DB_HOSTNAME=$DB_HOSTNAME - DB_USERNAME=$DB_USERNAME - DB_PASSWORD=$DB_PASSWORD - DB_DATABASE_NAME=$DB_DATABASE_NAME - REDIS_HOSTNAME=$REDIS_HOSTNAME - LOG_LEVEL=$LOG_LEVEL - JWT_SECRET=$JWT_SECRET - DISABLE_REVERSE_GEOCODING=$DISABLE_REVERSE_GEOCODING - REVERSE_GEOCODING_PRECISION=$REVERSE_GEOCODING_PRECISION - IMMICH_WEB_URL=$IMMICH_WEB_URL - IMMICH_SERVER_URL=$IMMICH_SERVER_URL - IMMICH_MACHINE_LEARNING_URL=$IMMICH_MACHINE_LEARNING_URL networks: {} ``` ### Your .env content ```Shell NODE_ENV=production DB_HOSTNAME=immich-db DB_USERNAME=immichuser DB_PASSWORD=immichpw DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich-redis LOG_LEVEL=log JWT_SECRET=jwt_token... DISABLE_REVERSE_GEOCODING=false REVERSE_GEOCODING_PRECISION=3 IMMICH_WEB_URL=http://immich-web:3000 IMMICH_SERVER_URL=http://immich-server:3001 IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 ``` ### Reproduction steps ```bash 1. Upload photos 2. Launch jobs 3. Upload others photos 4. Relaunch smart search and facial recognition ``` ### Relevant log output ```shell [Nest] 7 - 06/17/2024, 4:55:08 PM ERROR [Microservices:JobService] Unable to run job handler (smartSearch/smart-search): Error: Machine learning request '{"clip":{"visual":{"modelName":"ViT-B-32__openai"}}}' failed with status 422: Unprocessable Entity [Nest] 7 - 06/17/2024, 4:55:08 PM ERROR [Microservices:JobService] Error: Machine learning request '{"clip":{"visual":{"modelName":"ViT-B-32__openai"}}}' failed with status 422: Unprocessable Entity at MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine-learning.repository.js:22:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MachineLearningRepository.encodeImage (/usr/src/app/dist/repositories/machine-learning.repository.js:42:26) at async SmartInfoService.handleEncodeClip (/usr/src/app/dist/services/smart-info.service.js:86:27) at async /usr/src/app/dist/services/job.service.js:148:36 at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28) at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24) [Nest] 7 - 06/17/2024, 4:55:08 PM ERROR [Microservices:JobService] Object: { "id": "9ff8d839-d9e6-4c77-b6fa-6fa79d95e397" } all values are hidden [Nest] 7 - 06/17/2024, 4:46:26 PM ERROR [Microservices:JobService] Unable to run job handler (faceDetection/face-detection): Error: Machine learning request '{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}' failed with status 422: Unprocessable Entity [Nest] 7 - 06/17/2024, 4:46:26 PM ERROR [Microservices:JobService] Error: Machine learning request '{"facial-recognition":{"detection":{"modelName":"buffalo_l","options":{"minScore":0.7}},"recognition":{"modelName":"buffalo_l"}}}' failed with status 422: Unprocessable Entity at MachineLearningRepository.predict (/usr/src/app/dist/repositories/machine-learning.repository.js:22:19) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MachineLearningRepository.detectFaces (/usr/src/app/dist/repositories/machine-learning.repository.js:33:26) at async PersonService.handleDetectFaces (/usr/src/app/dist/services/person.service.js:274:52) at async /usr/src/app/dist/services/job.service.js:148:36 at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28) at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24) [Nest] 7 - 06/17/2024, 4:46:26 PM ERROR [Microservices:JobService] Object: { "id": "24197c11-50c4-46cd-a0e0-285a72880f39" } all values are hidden ``` ### Additional information _No response_
Author
Owner

@schuhbacca commented on GitHub (Jun 17, 2024):

Can you try updating the ML container to the newest? You have a version mismatch between your server and the ML.

@schuhbacca commented on GitHub (Jun 17, 2024): Can you try updating the ML container to the newest? You have a version mismatch between your server and the ML.
Author
Owner

@gdechene commented on GitHub (Jun 17, 2024):

Sorry, you are right! I put the ML docker image tag manually.
immich-machine-learning: image: ghcr.io/immich-app/immich-machine-learning:v1.105.1
I updated and it seems better!!
Thank you!

@gdechene commented on GitHub (Jun 17, 2024): Sorry, you are right! I put the ML docker image tag manually. `immich-machine-learning: image: ghcr.io/immich-app/immich-machine-learning:v1.105.1` I updated and it seems better!! Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#3558