immich-app / immich

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

Some immich jobs not working because of many "handler is not a function" errors (sidecar/undefined, smartSearch/undefined) #9946

Closed MrJamesT closed 3 months ago

MrJamesT commented 3 months ago

The bug

Hi, I recently installed immich through the recommended docker-compose install on my unraid server. I tried uploading around 1000 photos as a test to see if everything works and noticed some strange behavior.

First issue is that when I upload files through the webui, no jobs run automatically, I need to go into administration and run thumbnail generation and others manually, otherwise all of the previews show up empty.

Secondly, while facial detection & recognition work perfectly, smart search doesn't work at all. I went through the logs and found many repeating errors like the two below, I see that they reference sidecar and smartsearch functionality and it seems something is missing when it's filling in /undefined.

The OS that Immich Server is running on

unraid 6.12.8

Version of Immich Server

v1.105.1

Version of Immich Mobile App

v1.105.0

Platform with the issue

Your docker-compose.yml content

services:
    immich-server:
        image: ghcr.io/immich-app/immich-server:release
        container_name: immich_server
        restart: unless-stopped
        security_opt:
            - no-new-privileges:true
        networks:
            - frontend
            - backend
        command: ['start.sh', 'immich']
        volumes:
            - /mnt/user/images/immich:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        depends_on:
            - redis
            - database
        env_file:
            - .env
        labels:
            - 'traefik.enable=true'
            - 'traefik.http.routers.immich.rule=Host(`photos.site.com`)'
            - 'traefik.http.routers.immich.entrypoints=http,https'
            - 'traefik.http.routers.immich.tls=true'
            - 'traefik.http.routers.immich.tls.certresolver=cloudflare'
            - 'traefik.docker.network=frontend'

    immich-microservices:
        image: ghcr.io/immich-app/immich-server:release
        container_name: immich_microservices
        restart: unless-stopped
        security_opt:
            - no-new-privileges:true
        networks:
            - backend
        command: ['start.sh', 'microservices']
        volumes:
            - /mnt/user/images/immich:/usr/src/app/upload
            - /etc/localtime:/etc/localtime:ro
        devices:
            - /dev/dri:/dev/dri
        depends_on:
            - redis
            - database
        env_file:
            - .env

    immich-machine-learning:
        image: ghcr.io/immich-app/immich-machine-learning:release
        container_name: immich_machine_learning
        restart: unless-stopped
        security_opt:
            - no-new-privileges:true
        networks:
            - backend
        # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
        # Example tag: ${IMMICH_VERSION:-release}-cuda
        # 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:
            - .env

    redis:
        image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
        container_name: immich_redis
        restart: unless-stopped
        security_opt:
            - no-new-privileges:true
        networks:
            - backend

    database:
        image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
        container_name: immich_postgres
        restart: unless-stopped
        security_opt:
            - no-new-privileges:true
        networks:
            - backend
        environment:
            - POSTGRES_USER=${DB_USERNAME}
            - POSTGRES_PASSWORD=${DB_PASSWORD}
            - POSTGRES_DB=${DB_DATABASE_NAME}
            - POSTGRES_INITDB_ARGS=--data-checksums
            - TZ=UTC
        volumes:
            - /mnt/user/appdata/immich-postgres:/var/lib/postgresql/data
        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'
            ]

volumes:
    model-cache:

networks:
    frontend:
        external: true
    backend:
        external: true

Your .env content

DB_PASSWORD=***
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

1. Install immich through docker-compose
2. Upload any images through the web UI
3. 1st bug: no jobs are run automatically - need to run manually through administration
4. 2nd bug: even manual trigger doesn't work on some jobs (they either get stuck in waiting or are silently "completed" with no results) - most notably smart search (doesn't work at all)

Relevant log output

{"log":"\u001b[31m[Nest] 7  - \u001b[39m06/02/2024, 1:57:30 PM \u001b[31m  ERROR\u001b[39m \u001b[34m[ImmichMicroservices] \u001b[39m\u001b[38;5;3m[JobService] \u001b[39m\u001b[31mUnable to run job handler (sidecar/undefined): TypeError: handler is not a function\u001b[39m\n","stream":"stderr","time":"2024-06-02T1>
{"log":"\u001b[31m[Nest] 7  - \u001b[39m06/02/2024, 1:57:30 PM \u001b[31m  ERROR\u001b[39m \u001b[34m[ImmichMicroservices] \u001b[39m\u001b[38;5;3m[JobService] \u001b[39m\u001b[31mTypeError: handler is not a function\n","stream":"stderr","time":"2024-06-02T13:57:30.776970574Z"}
{"log":"    at /usr/src/app/dist/services/job.service.js:145:42\n","stream":"stderr","time":"2024-06-02T13:57:30.776973376Z"}
{"log":"    at Worker.workerHandler [as processFn] (/usr/src/app/dist/repositories/job.repository.js:84:46)\n","stream":"stderr","time":"2024-06-02T13:57:30.776975712Z"}
{"log":"    at Worker.callProcessJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:113:21)\n","stream":"stderr","time":"2024-06-02T13:57:30.776977985Z"}
{"log":"    at Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:39)\n","stream":"stderr","time":"2024-06-02T13:57:30.77698029Z"}
{"log":"    at /usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:202:70\n","stream":"stderr","time":"2024-06-02T13:57:30.776982609Z"}
{"log":"    at Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:30)\n","stream":"stderr","time":"2024-06-02T13:57:30.776986062Z"}
{"log":"    at Worker.run (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:202:45)\n","stream":"stderr","time":"2024-06-02T13:57:30.776988357Z"}
{"log":"    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\u001b[39m\n","stream":"stderr","time":"2024-06-02T13:57:30.77699062Z"}

...

{"log":"\u001b[31m[Nest] 7  - \u001b[39m06/02/2024, 2:12:02 PM \u001b[31m  ERROR\u001b[39m \u001b[34m[ImmichMicroservices] \u001b[39m\u001b[38;5;3m[JobService] \u001b[39m\u001b[31mUnable to run job handler (smartSearch/undefined): TypeError: handler is not a function\u001b[39m\n","stream":"stderr","time":"2024-06->
{"log":"\u001b[31m[Nest] 7  - \u001b[39m06/02/2024, 2:12:02 PM \u001b[31m  ERROR\u001b[39m \u001b[34m[ImmichMicroservices] \u001b[39m\u001b[38;5;3m[JobService] \u001b[39m\u001b[31mTypeError: handler is not a function\n","stream":"stderr","time":"2024-06-02T14:12:02.754963462Z"}
{"log":"    at /usr/src/app/dist/services/job.service.js:145:42\n","stream":"stderr","time":"2024-06-02T14:12:02.754971811Z"}
{"log":"    at Worker.workerHandler [as processFn] (/usr/src/app/dist/repositories/job.repository.js:84:46)\n","stream":"stderr","time":"2024-06-02T14:12:02.754974403Z"}
{"log":"    at Worker.callProcessJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:113:21)\n","stream":"stderr","time":"2024-06-02T14:12:02.754976679Z"}
{"log":"    at Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:39)\n","stream":"stderr","time":"2024-06-02T14:12:02.754978956Z"}
{"log":"    at /usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:202:70\n","stream":"stderr","time":"2024-06-02T14:12:02.754981194Z"}
{"log":"    at Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:30)\n","stream":"stderr","time":"2024-06-02T14:12:02.754983421Z"}
{"log":"    at Worker.run (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:202:45)\n","stream":"stderr","time":"2024-06-02T14:12:02.75498566Z"}
{"log":"    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\u001b[39m\n","stream":"stderr","time":"2024-06-02T14:12:02.754987878Z"}

Additional information

No response

krishne35 commented 3 months ago

Even I have the same exact problem I was pulling my hair out thinking something off on my end as I was trying different Clip models