immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
51.08k stars 2.7k forks source link

No people appear on people page #10807

Closed alexspurling closed 4 months ago

alexspurling commented 4 months ago

The bug

When I visit /people, I see no people. Face recognition is happening according to the job status page.

ImmichFaceRecogJobStatus

The OS that Immich Server is running on

Asustor ADM 4.3.1.R6C1

Version of Immich Server

v1.106.4

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
      - /volume2/Photos:/mnt/media/Photos:ro
    env_file:
      - stack.env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - stack.env
    restart: always

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

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

volumes:
  model-cache:

Your .env content

DB_DATA_LOCATION=/volume1/.@plugins/AppCentral/docker-ce/docker_lib/volumes/immich_pgdata/_data
DB_HOSTNAME=immich_postgres
UPLOAD_LOCATION=/volume2/immich
DB_DATABASE_NAME=immich
IMMICH_VERSION=release
TYPESENSE_ENABLED=false
DB_PASSWORD=postgres
REDIS_HOSTNAME=immich_redis
DB_USERNAME=postgres
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/src/app/bin
NODE_VERSION=20.14.0
YARN_VERSION=1.22.22
NODE_ENV=production
NVIDIA_DRIVER_CAPABILITIES=all
NVIDIA_VISIBLE_DEVICES=all

Reproduction steps

1. Go to {host}/people
2. You see the notice "No people"

Relevant log output

immich_server logs:

[Nest] 7  - 07/03/2024, 11:43:03 AM     LOG [Microservices:PersonService] Creating new person for face ab9e7959-4189-4aea-8614-5e4874ec29d7

[Nest] 7  - 07/03/2024, 11:43:04 AM     LOG [Microservices:PersonService] Creating new person for face 57cb0fb2-cecf-4a00-aad0-e2b0e3843683

[Nest] 7  - 07/03/2024, 11:43:04 AM     LOG [Microservices:PersonService] Creating new person for face 12fec3a0-95d9-462e-ae0d-5ca742909412

[Nest] 7  - 07/03/2024, 11:43:09 AM     LOG [Microservices:PersonService] Creating new person for face 378f4a78-f6bf-4ec8-9af8-162de1494719

[Nest] 7  - 07/03/2024, 11:43:09 AM     LOG [Microservices:PersonService] Creating new person for face 3263e7c0-dad0-4218-90a6-540efd50bbbf

[Nest] 7  - 07/03/2024, 11:43:18 AM     LOG [Microservices:PersonService] Creating new person for face 9d48aff1-eca3-401c-a041-868622257259

[Nest] 7  - 07/03/2024, 11:43:18 AM     LOG [Microservices:PersonService] Creating new person for face a63ee05b-3b52-41cb-af69-2cf0e051c660

[Nest] 7  - 07/03/2024, 11:43:19 AM     LOG [Microservices:PersonService] Creating new person for face 16a19d87-29ee-4fee-a240-f59c29e64b97

[Nest] 7  - 07/03/2024, 11:43:25 AM     LOG [Microservices:PersonService] Creating new person for face 73819e5d-ebd5-49a7-954e-cdfa9073f505

[Nest] 7  - 07/03/2024, 11:43:34 AM     LOG [Microservices:PersonService] Creating new person for face 373e60db-42f1-4cc7-ad9a-4ca4ecd9b8e5

[Nest] 7  - 07/03/2024, 11:43:34 AM     LOG [Microservices:PersonService] Creating new person for face 052d4955-70ee-4edc-b267-4f0aa12cb74a

[Nest] 7  - 07/03/2024, 11:43:52 AM     LOG [Microservices:PersonService] Creating new person for face 781a2196-e253-44c4-b259-18a1fce2010f

[Nest] 7  - 07/03/2024, 11:43:53 AM     LOG [Microservices:PersonService] Creating new person for face 22e0ff84-5fb5-4105-919d-32340efdfb45

[Nest] 7  - 07/03/2024, 11:43:55 AM     LOG [Microservices:PersonService] Creating new person for face 13f6c0c0-bd07-4433-8dd3-826301f64999

[Nest] 7  - 07/03/2024, 11:43:58 AM     LOG [Microservices:PersonService] Creating new person for face 72efd0e3-a551-4bae-9976-7fa4365c5910

[Nest] 7  - 07/03/2024, 11:43:59 AM     LOG [Microservices:PersonService] Creating new person for face 7e80710d-7b18-41f3-8f75-81ffcddcdfa7

immich_machine_learning logs:

[07/03/24 11:33:07] INFO     Starting gunicorn 22.0.0                           

[07/03/24 11:33:07] INFO     Listening at: http://[::]:3003 (8)                 

[07/03/24 11:33:07] INFO     Using worker: app.config.CustomUvicornWorker       

[07/03/24 11:33:07] INFO     Booting worker with pid: 9                         

[07/03/24 11:33:18] INFO     Started server process [9]                         

[07/03/24 11:33:18] INFO     Waiting for application startup.                   

[07/03/24 11:33:18] INFO     Created in-memory cache with unloading after 300s  

                             of inactivity.                                     

[07/03/24 11:33:18] INFO     Initialized request thread pool with 4 threads.    

[07/03/24 11:33:18] INFO     Application startup complete.                      

[07/03/24 11:33:21] INFO     Setting 'buffalo_l' execution providers to         

                             ['CPUExecutionProvider'], in descending order of   

                             preference                                         

[07/03/24 11:33:21] INFO     Loading detection model 'buffalo_l' to memory      

[07/03/24 11:33:23] INFO     Setting 'buffalo_l' execution providers to         

                             ['CPUExecutionProvider'], in descending order of   

                             preference                                         

[07/03/24 11:33:23] INFO     Loading recognition model 'buffalo_l' to memory

Additional information

Despite the face recognition job running for several hours, I never saw the message "Creating new person for face" in the server log until I restarted the immich_server while writing this issue. After this, I began seeing new entries in the person database table:

683ef1e6-9eb0-4fd5-bc18-f7cd0790a959 | 3 Jul 2024, 12:47:24 | 3 Jul 2024, 12:47:24 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/68/3e/683ef1e6-9eb0-4fd5-bc18-f7cd0790a959.jpeg | false |   | fe1c2895-f45f-4e62-a432-c2eae61eecee
74b06d90-eb41-4157-8885-6d73f90452ba | 3 Jul 2024, 12:47:24 | 3 Jul 2024, 12:47:24 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/74/b0/74b06d90-eb41-4157-8885-6d73f90452ba.jpeg | false |   | 4fde88a9-485d-4d63-ba8a-e1cadbcc7e85
e58b4b2c-772a-4332-b6f8-fd2f7a3d9472 | 3 Jul 2024, 12:47:23 | 3 Jul 2024, 12:47:23 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/e5/8b/e58b4b2c-772a-4332-b6f8-fd2f7a3d9472.jpeg | false |   | 8c017b16-7a28-44db-b21a-8d1d5d0c2b17
e5f8ba67-7608-44d7-8248-ec24514bdf4b | 3 Jul 2024, 12:47:09 | 3 Jul 2024, 12:47:09 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/e5/f8/e5f8ba67-7608-44d7-8248-ec24514bdf4b.jpeg | false |   | 4abc9f39-18e0-43ff-a21f-6c08c4c2867c
2f2b4675-08ec-441b-a2a7-cd9c670458f3 | 3 Jul 2024, 12:47:07 | 3 Jul 2024, 12:47:08 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/2f/2b/2f2b4675-08ec-441b-a2a7-cd9c670458f3.jpeg | false |   | a643321b-033d-4786-9698-3cca8417cd3c
a27ac52d-3136-4223-baf2-5742fce501da | 3 Jul 2024, 12:47:01 | 3 Jul 2024, 12:47:01 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/a2/7a/a27ac52d-3136-4223-baf2-5742fce501da.jpeg | false |   | fcaf7ab2-55e6-4633-af3c-9dcecb118ad3
e4ccb74a-6468-4c5e-8651-deee96caa94a | 3 Jul 2024, 12:46:59 | 3 Jul 2024, 12:46:59 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/e4/cc/e4ccb74a-6468-4c5e-8651-deee96caa94a.jpeg | false |   | 8aff902e-5132-4970-911f-7d7d7188f458
2260cc92-576d-4381-888b-dc7de246db9b | 3 Jul 2024, 12:46:58 | 3 Jul 2024, 12:46:58 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/22/60/2260cc92-576d-4381-888b-dc7de246db9b.jpeg | false |   | 136f14c7-b5dc-4868-99fc-c61ca12321c6
6ca505c5-29a1-45f9-bb11-82dd5cbdc077 | 3 Jul 2024, 12:46:56 | 3 Jul 2024, 12:46:56 | 487f3dbf-861f-45af-a909-ca844624d4c5 |   | upload/thumbs/487f3dbf-861f-45af-a909-ca844624d4c5/6c/a5/6ca505c5-29a1-45f9-bb11-82dd5cbdc077.jpeg | false |   | 3f4b7786-3058-4084-8098-07c5b13f1392

Despite this, I still see no people on the /people page.

alexspurling commented 4 months ago

I have no idea why but people are now appearing on my /people page. I believe simply restarting the immich_server container fixed the problem but there is probably a race condition happening somewhere.