Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on external library scan when adding photos with only numeric descriptions #11635

Closed
3 tasks done
jo-gross opened this issue Aug 7, 2024 · 0 comments · Fixed by #11636
Closed
3 tasks done

Error on external library scan when adding photos with only numeric descriptions #11635

jo-gross opened this issue Aug 7, 2024 · 0 comments · Fixed by #11636

Comments

@jo-gross
Copy link
Contributor

jo-gross commented Aug 7, 2024

The bug

I sorted and rated many of my photos and wanted to import them as an album, so I can easily view them in my library. However, one of my cameras wrote only numeric values in the description and image description fields. This caused a server error: TypeError: (tags.ImageDescription || tags.Description || "").trim is not a function. As a result, the images were not properly displayed (no thumbnails were generated) and all metadata was missing.

I have already solved this issue in a local dev environment to ensure this is the correct explanation and this is the causing error. A very small PR will follow ;)

The OS that Immich Server is running on

Unraid (Docker) 6.12.11

Version of Immich Server

v1.111.0

Version of Immich Mobile App

v1.111.0 build.152

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${EXTERNAL_MEDIA}:/mnt/media:ro
      - ${EXTERNAL_MEDIA_ALBUMS}:/mnt/immich-albums:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - 2284:3001
    depends_on:
      - redis
      - database
    restart: always

    cpus: 2

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities:
                - gpu
                - compute
                - video
    volumes:
      - ${CONFIG_LOCATION}/model-cache:/cache
    env_file:
      - stack.env
    restart: always
    cpus: 2

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}

    volumes:
      - ${CONFIG_LOCATION}/pgdata:/var/lib/postgresql/data
    restart: always

Your .env content

DB_PASSWORD=postgres
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/mnt/user/photos/immich
CONFIG_LOCATION=/mnt/user/appdata/immich
NVIDIA_DRIVER_CAPABILITIES=all
NVIDIA_VISIBLE_DEVICES=all
EXTERNAL_MEDIA=/mnt/user/photos/media
EXTERNAL_MEDIA_ALBUMS=/mnt/user/photos/albums

Reproduction steps

1. Take an image and add a description to the EXIF Field "ImageDescription" and "Description" (eg. `exiftool -overwrite_original -ImageDescription=1234 -Description=1234 your_picture.jpg`
2. Create an external library, copy the image into that and rescan the library
3. The error should occure, have a look at the logs

Relevant log output

2024-08-07T13:47:56.637817639Z [Nest] 7  - 08/07/2024, 1:47:56 PM   ERROR [Microservices:JobService] Unable to run job handler (metadataExtraction/metadata-extraction): TypeError: (tags.ImageDescription || tags.Description || "").trim is not a function

2024-08-07T13:47:56.637993485Z [Nest] 7  - 08/07/2024, 1:47:56 PM   ERROR [Microservices:JobService] TypeError: (tags.ImageDescription || tags.Description || "").trim is not a function

2024-08-07T13:47:56.638006078Z     at MetadataService.exifData (/usr/src/app/dist/services/metadata.service.js:412:76)

2024-08-07T13:47:56.638008757Z     at async MetadataService.handleMetadataExtraction (/usr/src/app/dist/services/metadata.service.js:184:36)

2024-08-07T13:47:56.638010711Z     at async /usr/src/app/dist/services/job.service.js:148:36

2024-08-07T13:47:56.638012590Z     at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)

2024-08-07T13:47:56.638014484Z     at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)

2024-08-07T13:47:56.638016404Z [Nest] 7  - 08/07/2024, 1:47:56 PM   ERROR [Microservices:JobService] Object:

2024-08-07T13:47:56.638029162Z {

2024-08-07T13:47:56.638031538Z   "id": "a920c3d9-05f0-4ab3-a864-61053ec0fd37",

2024-08-07T13:47:56.638033625Z   "source": "upload"

2024-08-07T13:47:56.638035575Z }

2024-08-07T13:47:56.638037301Z

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants