Skip to content

[BUG] Cannot create read stream for asset #4246

Closed

Description

@cfelicio

The bug

Now that Immich supports external libraries, I went ahead and imported my entire catalog of 200k+ photos to try it out. The vast majority of the catalog imports fine, but it seems like there are issues with some older photos (perhaps due to exif / metadata incompatibility issues?). Here is an example of what I see on the immich_server log:

[Nest] 6 - 09/26/2023, 5:09:56 PM ERROR [AssetService] Cannot create read stream for asset 61b3d2bb-44ea-46ca-b8bb-a0b195c75f16
getAssetThumbnail
[Nest] 6 - 09/26/2023, 5:09:56 PM ERROR [AssetService] Cannot create read stream for asset b9482046-9bed-4cd2-8cf5-59b5b55b7d14
getAssetThumbnail
[Nest] 6 - 09/26/2023, 5:09:56 PM ERROR [AssetService] Cannot create read stream for asset a1637ff4-ca17-4997-9110-a95f32a969af
getAssetThumbnail
[Nest] 6 - 09/26/2023, 5:09:56 PM ERROR [AssetService] Cannot create read stream for asset 6e53f2b9-44aa-48f2-9813-d38078619459
getAssetThumbnail
[Nest] 6 - 09/26/2023, 5:09:57 PM ERROR [ExceptionsHandler] ENOENT: no such file or directory, stat 'upload/thumbs/d3728f6e-dc3b-4616-893a-c972ea1c25ba/4949f888-03e1-49a4-8783-5776e111ca9d.jpeg'
Error: ENOENT: no such file or directory, stat 'upload/thumbs/d3728f6e-dc3b-4616-893a-c972ea1c25ba/4949f888-03e1-49a4-8783-5776e111ca9d.jpeg'
[Nest] 6 - 09/26/2023, 5:09:57 PM ERROR [ExceptionsHandler] ENOENT: no such file or directory, stat 'upload/thumbs/d3728f6e-dc3b-4616-893a-c972ea1c25ba/090f6485-d2fc-4081-b400-401ad7931ccd.jpeg'
Error: ENOENT: no such file or directory, stat 'upload/thumbs/d3728f6e-dc3b-4616-893a-c972ea1c25ba/090f6485-d2fc-4081-b400-401ad7931ccd.jpeg'
[Nest] 6 - 09/26/2023, 5:09:57 PM ERROR [ExceptionsHandler] ENOENT: no such file or directory, stat 'upload/thumbs/d3728f6e-dc3b-4616-893a-c972ea1c25ba/3a1d99ed-7c63-4c98-be01-dd8e24a9edec.jpeg'
Error: ENOENT: no such file or directory, stat 'upload/thumbs/d3728f6e-dc3b-4616-893a-c972ea1c25ba/3a1d99ed-7c63-4c98-be01-dd8e24a9edec.jpeg'

Example from immich_microservice log

[Nest] 7 - 09/26/2023, 2:13:42 PM ERROR [JobService] Unable to run job handler (metadataExtraction/metadata-extraction): QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
[Nest] 7 - 09/26/2023, 2:13:42 PM ERROR [JobService] QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async AssetRepository.upsertExif (/usr/src/app/dist/infra/repositories/asset.repository.js:37:9)
at async MetadataExtractionProcessor.handleMetadataExtraction (/usr/src/app/dist/microservices/processors/metadata-extraction.processor.js:154:9)
at async /usr/src/app/dist/domain/job/job.service.js:107:37
at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:346:28)
at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:531:24)
[Nest] 7 - 09/26/2023, 2:13:42 PM ERROR [JobService] Object:
{
"id": "74b11273-2267-4095-bdaf-781ed5fb038c"
}
[Nest] 7 - 09/26/2023, 2:13:42 PM ERROR [JobService] Unable to run job handler (metadataExtraction/metadata-extraction): QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
[Nest] 7 - 09/26/2023, 2:13:42 PM ERROR [JobService] QueryFailedError: invalid input syntax for type timestamp with time zone: "0NaN-NaN-NaNTNaN:NaN:NaN.NaN+NaN:NaN"
at PostgresQueryRunner.query (/usr/src/app/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InsertQueryBuilder.execute (/usr/src/app/node_modules/typeorm/query-builder/InsertQueryBuilder.js:106:33)
at async AssetRepository.upsertExif (/usr/src/app/dist/infra/repositories/asset.repository.js:37:9)
at async MetadataExtractionProcessor.handleMetadataExtraction (/usr/src/app/dist/microservices/processors/metadata-extraction.processor.js:154:9)
at async /usr/src/app/dist/domain/job/job.service.js:107:37
at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:346:28)
at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:531:24)
[Nest] 7 - 09/26/2023, 2:13:42 PM ERROR [JobService] Object:
{
"id": "cbd54568-1e20-4a83-9e56-4761f3ba8bff"
}

Example of what I see on the web interface:
image

The OS that Immich Server is running on

Ubuntu 22.04.3 LTS

Version of Immich Server

v1.79.1

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${scanDirectory}:/mnt/media/libdata:ro
    #  - /var/lib/docker/volumes/pictures/_data/Test:/mnt/media/Test:ro
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
      - typesense
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${scanDirectory}:/mnt/media/libdata:ro
    #  - /var/lib/docker/volumes/pictures/_data/Test:/mnt/media/Test:ro
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
      - typesense
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - stack.env
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - stack.env
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - tsdata:/data
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    restart: always
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

volumes:
  pgdata:
  model-cache:
  tsdata:
  pictures:
    external: true

Your .env content

UPLOAD_LOCATION=/data/immich/upload
IMMICH_VERSION=release
TYPESENSE_API_KEY=***
DB_PASSWORD=***
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
scanDirectory=pictures

Reproduction steps

1. Enable External Libraries for my user
2. Scan the external library to import all images
3. Verify 99% of images imported correctly
4. Some images do not show thumbnails or exif data, plus some errors show up on the logs

Additional information

No response

Activity

  1. cfelicio commented on Sep 26, 2023

    @cfelicio
    Author

    Ah, forgot to add, if you click on one of the affected images, before scrolling, you get a black screen with this info showing:

    image

  2. jrasm91 commented on Sep 26, 2023

    @jrasm91
    Member

    Try running the regenerate missing thumbnails job

  3. cfelicio commented on Sep 26, 2023

    @cfelicio
    Author

    Try running the regenerate missing thumbnails job

    Cool, looks like this helped fix the thumbnail issue! I tried the same approach for the metadata, but issue persists. Any ideas?

    Thanks!

  4. jrasm91 commented on Sep 27, 2023

    @jrasm91
    Member

    There's an existing bug with metadata that should hopefully be fixed soon. Metadata bailed due to the error and the thumbnail job didn't run because of that.

  5. cfelicio commented on Sep 27, 2023

    @cfelicio
    Author

    There's an existing bug with metadata that should hopefully be fixed soon. Metadata bailed due to the error and the thumbnail job didn't run because of that.

    This one? #4166

  6. jrasm91 commented on Sep 27, 2023

    @jrasm91
    Member

    Yes

  7. cfelicio commented on Sep 27, 2023

    @cfelicio
    Author

    cool I'll close this one and keep an eye on the other one then. Cheers!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions