Error generating thumbnails in v1.126.1 #5367

Closed
opened 2026-02-05 11:23:17 +03:00 by OVERLORD · 22 comments
Owner

Originally created by @iwinstar on GitHub (Feb 12, 2025).

The bug

Similar to #13465.

I'm using the latest server version v1.126.1. But some pictures still can't generate thumbnails. I've provided some images as attachments for upstream to debug.

The OS that Immich Server is running on

Docker ( Synology x86_64 4.4.180+)

Version of Immich Server

v1.126.1

Version of Immich Mobile App

v1.126.1

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

redis:
    container_name: Redis
    image: redis:latest
    network_mode: host
    user: "${UID}:${GID}"
    volumes:
      - /volume2/docker/Redis:/data
    healthcheck:
      test: redis-cli ping || exit 1
    restart: unless-stopped
    command: redis-server --save 60 1 --loglevel warning

  postgres:
    container_name: Postgres
    network_mode: host
    user: "${UID}:${GID}"
    image: tensorchord/pgvecto-rs:pg16-v0.3.0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - /volume2/docker/Postgres:/var/lib/postgresql/data
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --port=${DB_PORT} || exit 1;
        Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --port=${DB_PORT} --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
    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
      -p ${DB_PORT}
    restart: unless-stopped

  immich:
    container_name: Immich
    network_mode: host
    image: ghcr.io/immich-app/immich-server:release
    volumes:
      - /volume2/docker/Immich/library:/usr/src/app/upload
      - /volume1/Photo:/data/Photo:ro
      - /etc/localtime:/etc/localtime:ro
      - /dev/bus/usb:/dev/bus/usb
    env_file:
      - .env
    depends_on:
      - redis
      - postgres
    restart: unless-stopped
    healthcheck:
      disable: false
    device_cgroup_rules:
      - 'c 189:* rmw'
    devices:
      - /dev/dri:/dev/dri

  immich-machine-learning:
    container_name: ImmichMachineLearning
    network_mode: host
    # user: "${UID}:${GID}"
    image: ghcr.io/immich-app/immich-machine-learning:release-openvino
    volumes:
      - /volume2/docker/Immich/model-cache:/cache
      - /dev/bus/usb:/dev/bus/usb
    env_file:
      - .env
    restart: unless-stopped
    healthcheck:
      disable: false
    device_cgroup_rules:
      - 'c 189:* rmw'
    devices:
      - /dev/dri:/dev/dri

Your .env content

UID=1026
GID=100
TZ=Asia/Shanghai

DB_PORT=5433
DB_HOSTNAME=localhost
DB_USERNAME=***
DB_PASSWORD=***
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=localhost

MACHINE_LEARNING_ANN=False
MACHINE_LEARNING_PRELOAD__CLIP=XLM-Roberta-Large-Vit-B-16Plus
MACHINE_LEARNING_PRELOAD__FACIAL_RECOGNITION=buffalo_l

Reproduction steps

...

Relevant log output

[Nest] 7  - 02/12/2025, 6:11:05 AM   ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string
[Nest] 7  - 02/12/2025, 6:11:05 AM   ERROR [Microservices:JobService] Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string
    at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17)
    at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68)
    at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25)
    at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28)
    at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13)
    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  - 02/12/2025, 6:11:05 AM   ERROR [Microservices:JobService] Object(1) {
  id: 'b3c63b36-fb78-4ce1-be30-e18da04a97fd'
}

Additional information

images.zip

Originally created by @iwinstar on GitHub (Feb 12, 2025). ### The bug Similar to #13465. I'm using the latest server version v1.126.1. But some pictures still can't generate thumbnails. I've provided some images as attachments for upstream to debug. ### The OS that Immich Server is running on Docker ( Synology x86_64 4.4.180+) ### Version of Immich Server v1.126.1 ### Version of Immich Mobile App v1.126.1 ### Platform with the issue - [x] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML redis: container_name: Redis image: redis:latest network_mode: host user: "${UID}:${GID}" volumes: - /volume2/docker/Redis:/data healthcheck: test: redis-cli ping || exit 1 restart: unless-stopped command: redis-server --save 60 1 --loglevel warning postgres: container_name: Postgres network_mode: host user: "${UID}:${GID}" image: tensorchord/pgvecto-rs:pg16-v0.3.0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - /volume2/docker/Postgres:/var/lib/postgresql/data healthcheck: test: >- pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --port=${DB_PORT} || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --port=${DB_PORT} --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 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 -p ${DB_PORT} restart: unless-stopped immich: container_name: Immich network_mode: host image: ghcr.io/immich-app/immich-server:release volumes: - /volume2/docker/Immich/library:/usr/src/app/upload - /volume1/Photo:/data/Photo:ro - /etc/localtime:/etc/localtime:ro - /dev/bus/usb:/dev/bus/usb env_file: - .env depends_on: - redis - postgres restart: unless-stopped healthcheck: disable: false device_cgroup_rules: - 'c 189:* rmw' devices: - /dev/dri:/dev/dri immich-machine-learning: container_name: ImmichMachineLearning network_mode: host # user: "${UID}:${GID}" image: ghcr.io/immich-app/immich-machine-learning:release-openvino volumes: - /volume2/docker/Immich/model-cache:/cache - /dev/bus/usb:/dev/bus/usb env_file: - .env restart: unless-stopped healthcheck: disable: false device_cgroup_rules: - 'c 189:* rmw' devices: - /dev/dri:/dev/dri ``` ### Your .env content ```Shell UID=1026 GID=100 TZ=Asia/Shanghai DB_PORT=5433 DB_HOSTNAME=localhost DB_USERNAME=*** DB_PASSWORD=*** DB_DATABASE_NAME=immich REDIS_HOSTNAME=localhost MACHINE_LEARNING_ANN=False MACHINE_LEARNING_PRELOAD__CLIP=XLM-Roberta-Large-Vit-B-16Plus MACHINE_LEARNING_PRELOAD__FACIAL_RECOGNITION=buffalo_l ``` ### Reproduction steps 1. 2. 3. ... ### Relevant log output ```shell [Nest] 7 - 02/12/2025, 6:11:05 AM ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string [Nest] 7 - 02/12/2025, 6:11:05 AM ERROR [Microservices:JobService] Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17) at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68) at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25) at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28) at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13) 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 - 02/12/2025, 6:11:05 AM ERROR [Microservices:JobService] Object(1) { id: 'b3c63b36-fb78-4ce1-be30-e18da04a97fd' } ``` ### Additional information [images.zip](https://github.com/user-attachments/files/18759433/images.zip)
Author
Owner

@hclivess commented on GitHub (Feb 12, 2025):

If your system is Windows, try this after adjusting path to your folders

takeown /F "D:\photos" /R /D Y
icacls "D:\photos" /reset /T
@hclivess commented on GitHub (Feb 12, 2025): If your system is Windows, try this after adjusting path to your folders ``` takeown /F "D:\photos" /R /D Y icacls "D:\photos" /reset /T ```
Author
Owner

@iwinstar commented on GitHub (Feb 12, 2025):

If your system is Windows, try this after adjusting path to your folders

takeown /F "D:\photos" /R /D Y
icacls "D:\photos" /reset /T

It's Linux, kernel version 4.4.180+, only a few images can't generate thumbnails.

I've tried to change log level to debug, but still "Message codes are not supported"

@iwinstar commented on GitHub (Feb 12, 2025): > If your system is Windows, try this after adjusting path to your folders > > ``` > takeown /F "D:\photos" /R /D Y > icacls "D:\photos" /reset /T > ``` It's Linux, kernel version 4.4.180+, only a few images can't generate thumbnails. I've tried to change log level to debug, but still "Message codes are not supported"
Author
Owner

@licryle commented on GitHub (Feb 14, 2025):

Same error here.

168 pictures can't generate thumbnails.
It was a wider problem before, selecting the pictures from the Web browser, then clicking "refresh thumbnails" worked, but not from the job UI.

[Nest] 7  - 02/14/2025, 11:25:59 AM   ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string
[Nest] 7  - 02/14/2025, 11:25:59 AM   ERROR [Microservices:JobService] Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string
    at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17)
    at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68)
    at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25)
    at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28)
    at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13)
    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  - 02/14/2025, 11:25:59 AM   ERROR [Microservices:JobService] Object(1) {
  id: 'fe042faa-3760-4245-904c-e9ac6786df8d'
}

@licryle commented on GitHub (Feb 14, 2025): Same error here. 168 pictures can't generate thumbnails. It was a wider problem before, selecting the pictures from the Web browser, then clicking "refresh thumbnails" worked, but not from the job UI. ``` [Nest] 7 - 02/14/2025, 11:25:59 AM ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string [Nest] 7 - 02/14/2025, 11:25:59 AM ERROR [Microservices:JobService] Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17) at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68) at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25) at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28) at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13) 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 - 02/14/2025, 11:25:59 AM ERROR [Microservices:JobService] Object(1) { id: 'fe042faa-3760-4245-904c-e9ac6786df8d' } ```
Author
Owner

@iwinstar commented on GitHub (Feb 14, 2025):

Same error here.

168 pictures can't generate thumbnails. It was a wider problem before, selecting the pictures from the Web browser, then clicking "refresh thumbnails" worked, but not from the job UI.

[Nest] 7  - 02/14/2025, 11:25:59 AM   ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string
[Nest] 7  - 02/14/2025, 11:25:59 AM   ERROR [Microservices:JobService] Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string
    at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17)
    at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68)
    at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25)
    at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28)
    at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13)
    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  - 02/14/2025, 11:25:59 AM   ERROR [Microservices:JobService] Object(1) {
  id: 'fe042faa-3760-4245-904c-e9ac6786df8d'
}

I've tried, clicking "refresh thumbnails" from the Web browser didn't work either, same error in the log

@iwinstar commented on GitHub (Feb 14, 2025): > Same error here. > > 168 pictures can't generate thumbnails. It was a wider problem before, selecting the pictures from the Web browser, then clicking "refresh thumbnails" worked, but not from the job UI. > > ``` > [Nest] 7 - 02/14/2025, 11:25:59 AM ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-thumbnails): Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string > [Nest] 7 - 02/14/2025, 11:25:59 AM ERROR [Microservices:JobService] Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string > at Sharp.toBuffer (/usr/src/app/node_modules/sharp/lib/output.js:163:17) > at MediaRepository.decodeImage (/usr/src/app/dist/repositories/media.repository.js:54:68) > at MediaService.generateImageThumbnails (/usr/src/app/dist/services/media.service.js:164:63) > at process.processTicksAndRejections (node:internal/process/task_queues:105:5) > at async MediaService.handleGenerateThumbnails (/usr/src/app/dist/services/media.service.js:114:25) > at async JobService.onJobStart (/usr/src/app/dist/services/job.service.js:148:28) > at async EventRepository.onEvent (/usr/src/app/dist/repositories/event.repository.js:130:13) > 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 - 02/14/2025, 11:25:59 AM ERROR [Microservices:JobService] Object(1) { > id: 'fe042faa-3760-4245-904c-e9ac6786df8d' > } > ``` I've tried, clicking "refresh thumbnails" from the Web browser didn't work either, same error in the log
Author
Owner

@licryle commented on GitHub (Feb 14, 2025):

Ok, I've tried to track that down more thoroughly, and maybe my former message of success was wrong.
Problem: the path of the image is not always available, I noticed at least 3 errors:

Error: Input file contains unsupported image format

Error: Input file has corrupt header: magickload: Magick: ImproperImageHeader `/photos/yadiyadayadiyada.jpg`

Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string

Error: Unknown error

For the second one, I can confirm the image is bogus, for 1/3/4, is there a way to surface the path to get extra logs out?

@licryle commented on GitHub (Feb 14, 2025): Ok, I've tried to track that down more thoroughly, and maybe my former message of success was wrong. Problem: the path of the image is not always available, I noticed at least 3 errors: ``` Error: Input file contains unsupported image format Error: Input file has corrupt header: magickload: Magick: ImproperImageHeader `/photos/yadiyadayadiyada.jpg` Error: VipsJpeg: Message codes are not supported, error message is in msg_parm.s string Error: Unknown error ``` For the second one, I can confirm the image is bogus, for 1/3/4, is there a way to surface the path to get extra logs out?
Author
Owner

@iwinstar commented on GitHub (Feb 14, 2025):

All right, I find a way to know what's wrong with the images.

Install libvips package, check https://www.libvips.org/install.html

$ brew install vips
$ vips -v
vips-8.16.0
$ vips copy image-01.jpg 01.jpg
...
$ vips copy image-17.jpg 17.jpg

All my images which can't generate thumbnails have the same WARNING message VipsJpeg: premature end of JPEG image.

Maybe like https://github.com/libvips/libvips/issues/4206, @mertalev knows how to fix this problem in immich?

@iwinstar commented on GitHub (Feb 14, 2025): All right, I find a way to know what's wrong with the images. Install libvips package, check https://www.libvips.org/install.html ```bash $ brew install vips $ vips -v vips-8.16.0 $ vips copy image-01.jpg 01.jpg ... $ vips copy image-17.jpg 17.jpg ``` All my images which can't generate thumbnails have the same WARNING message `VipsJpeg: premature end of JPEG image`. Maybe like https://github.com/libvips/libvips/issues/4206, @mertalev knows how to fix this problem in immich?
Author
Owner

@mertalev commented on GitHub (Feb 14, 2025):

The error means the images are truncated (i.e. part of the image is missing). You could potentially use some other software to convert these corrupt images to e.g. PNG to produce valid images while avoiding further compression, then import those images.

@mertalev commented on GitHub (Feb 14, 2025): The error means the images are truncated (i.e. part of the image is missing). You could potentially use some other software to convert these corrupt images to e.g. PNG to produce valid images while avoiding further compression, then import those images.
Author
Owner

@iwinstar commented on GitHub (Feb 14, 2025):

The error means the images are truncated (i.e. part of the image is missing). You could potentially use some other software to convert these corrupt images to e.g. PNG to produce valid images while avoiding further compression, then import those images.

I use vips copy command processed these images and replaced them in my library, then immich generated thumbnails with no problem.

I hope immich could find why the message is "VipsJpeg: Message codes are not supported, error message is in msg_parm.s string" instead of "VipsJpeg: premature end of JPEG image" and ignore it. It's just a warning message after all.

@iwinstar commented on GitHub (Feb 14, 2025): > The error means the images are truncated (i.e. part of the image is missing). You could potentially use some other software to convert these corrupt images to e.g. PNG to produce valid images while avoiding further compression, then import those images. I use `vips copy` command processed these images and replaced them in my library, then immich generated thumbnails with no problem. I hope immich could find why the message is "VipsJpeg: Message codes are not supported, error message is in msg_parm.s string" instead of "VipsJpeg: premature end of JPEG image" and ignore it. It's just a warning message after all.
Author
Owner

@mertalev commented on GitHub (Feb 14, 2025):

VipsJpeg: Message codes are not supported, error message is in msg_parm.s string

The error message has been improved in libvips dev, but it hasn't made it into a libvips release yet. As for ignoring it, we do set libvips to ignore warnings, but I think the Jpegli decoder considers this an error. It tends to be stricter than other libjpeg implementations (possibly because it's more advanced and needs to make more assumptions about the input's validity).

@mertalev commented on GitHub (Feb 14, 2025): > VipsJpeg: Message codes are not supported, error message is in msg_parm.s string The error message has been improved in libvips dev, but it hasn't made it into a libvips release yet. As for ignoring it, we do set libvips to ignore warnings, but I think the Jpegli decoder considers this an error. It tends to be stricter than other libjpeg implementations (possibly because it's more advanced and needs to make more assumptions about the input's validity).
Author
Owner

@licryle commented on GitHub (Feb 19, 2025):

Is there a way to get immich to display which files are failing? I have 250 / 200k images and I'd like to chase them down, thank you

@licryle commented on GitHub (Feb 19, 2025): Is there a way to get immich to display which files are failing? I have 250 / 200k images and I'd like to chase them down, thank you
Author
Owner

@iwinstar commented on GitHub (Feb 19, 2025):

I find them by execute a database query. You can follow this document https://immich.app/docs/guides/database-queries connect to Postgres and execute this query

SELECT "id", "deviceAssetId", "originalPath" FROM "assets" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL;

You can check whether the query result rows equal 250

@iwinstar commented on GitHub (Feb 19, 2025): I find them by execute a database query. You can follow this document https://immich.app/docs/guides/database-queries connect to Postgres and execute this query ```SQL SELECT "id", "deviceAssetId", "originalPath" FROM "assets" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL; ``` You can check whether the query result rows equal 250
Author
Owner

@licryle commented on GitHub (Feb 19, 2025):

perfect, thank you very much!

Cyrille

On Wed, Feb 19, 2025 at 11:49 PM iwinstar @.***> wrote:

I find them by execute a database query. You can follow this document
https://immich.app/docs/guides/database-queries connect to Postgres and
execute this query

SELECT "id", "deviceAssetId", "originalPath" FROM "assets" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL;

You can check whether the query result rows equal 250


Reply to this email directly, view it on GitHub
https://github.com/immich-app/immich/issues/16044#issuecomment-2669047873,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABHKL2G2XSRJL63ONZ7NQJL2QSRY5AVCNFSM6AAAAABW6FINU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGA2DOOBXGM
.
You are receiving this because you commented.Message ID:
@.***>
[image: iwinstar]iwinstar left a comment (immich-app/immich#16044)
https://github.com/immich-app/immich/issues/16044#issuecomment-2669047873

I find them by execute a database query. You can follow this document
https://immich.app/docs/guides/database-queries connect to Postgres and
execute this query

SELECT "id", "deviceAssetId", "originalPath" FROM "assets" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL;

You can check whether the query result rows equal 250


Reply to this email directly, view it on GitHub
https://github.com/immich-app/immich/issues/16044#issuecomment-2669047873,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABHKL2G2XSRJL63ONZ7NQJL2QSRY5AVCNFSM6AAAAABW6FINU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGA2DOOBXGM
.
You are receiving this because you commented.Message ID:
@.***>

@licryle commented on GitHub (Feb 19, 2025): perfect, thank you very much! ---- Cyrille On Wed, Feb 19, 2025 at 11:49 PM iwinstar ***@***.***> wrote: > I find them by execute a database query. You can follow this document > https://immich.app/docs/guides/database-queries connect to Postgres and > execute this query > > SELECT "id", "deviceAssetId", "originalPath" FROM "assets" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL; > > You can check whether the query result rows equal 250 > > — > Reply to this email directly, view it on GitHub > <https://github.com/immich-app/immich/issues/16044#issuecomment-2669047873>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ABHKL2G2XSRJL63ONZ7NQJL2QSRY5AVCNFSM6AAAAABW6FINU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGA2DOOBXGM> > . > You are receiving this because you commented.Message ID: > ***@***.***> > [image: iwinstar]*iwinstar* left a comment (immich-app/immich#16044) > <https://github.com/immich-app/immich/issues/16044#issuecomment-2669047873> > > I find them by execute a database query. You can follow this document > https://immich.app/docs/guides/database-queries connect to Postgres and > execute this query > > SELECT "id", "deviceAssetId", "originalPath" FROM "assets" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL; > > You can check whether the query result rows equal 250 > > — > Reply to this email directly, view it on GitHub > <https://github.com/immich-app/immich/issues/16044#issuecomment-2669047873>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ABHKL2G2XSRJL63ONZ7NQJL2QSRY5AVCNFSM6AAAAABW6FINU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRZGA2DOOBXGM> > . > You are receiving this because you commented.Message ID: > ***@***.***> >
Author
Owner

@danieldietzler commented on GitHub (Apr 3, 2025):

From what I can tell everyone here has found their corrupted assets...? Either way this is not an Immich issue since the actual files are broken, correct?

@danieldietzler commented on GitHub (Apr 3, 2025): From what I can tell everyone here has found their corrupted assets...? Either way this is not an Immich issue since the actual files are broken, correct?
Author
Owner

@irfanhakim-as commented on GitHub (Aug 23, 2025):

Mine only started doing this today, either before or after updating to v1.139.2 earlier today. Never noticed this happening before, and I wasn't massively uploading anything to the server today either - not more than ~15 media files were uploaded today, in total.

I noticed it because 2 of my photos uploaded today had no thumbnail on web, tho they seem to appear fine on mobile. When I checked jobs on the admin account, it showed 2 failed under the thumbnail generation job. When I run it for missing thumbnails though, my Immich container would crash.

Since then, I notice that each time the thumbnail generation job runs, the entire container would crash (nothing to do with resource usage). The 2 failed kept increasing somehow, to 3, then to 9, then to 12, and now 15 (at the time of writing). Based on the tips provided on here to debug this, I ran this command on the database to try and identify the 'faulty' images:

SELECT "id", "deviceAssetId", "originalPath" FROM "asset" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL;

From that query, there were 6 image files that were returned:

  • 1 GIF uploaded long ago
  • 3 HEIC photos uploaded long ago
  • 1 HEIC photo uploaded just today
  • 1 PNG screenshot uploaded just today

Those 4 images that were uploaded long ago, when checking what they are from my storage, they did appear to be.. wrong or faulty - like incomplete images or completely empty. The 2 photos uploaded just today honestly looked fine (on the Immich storage), even on the mobile app they looked fine.

I'm not sure what to do of this now since the server keeps crashing, and I assume it has nothing to do with Immich version 1.139.2 in particular?

Logs:

2025-08-23T16:27:39.212479326Z [Nest] 7  - 08/23/2025, 4:27:39 PM   ERROR [Microservices:MediaRepository] ffmpeg version 7.1.1-Jellyfin Copyright (c) 2000-2025 the FFmpeg developers
2025-08-23T16:27:39.212562065Z   built with gcc 12 (Debian 12.2.0-14)
2025-08-23T16:27:39.212574973Z   configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=arm64 --cross-prefix=/usr/bin/aarch64-linux-gnu- --toolchain=hardened --enable-cross-compile --enable-rkmpp --enable-rkrga --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
2025-08-23T16:27:39.212591528Z   libavutil      59. 39.100 / 59. 39.100
2025-08-23T16:27:39.212602157Z   libavcodec     61. 19.101 / 61. 19.101
2025-08-23T16:27:39.212612120Z   libavformat    61.  7.100 / 61.  7.100
2025-08-23T16:27:39.212622213Z   libavdevice    61.  3.100 / 61.  3.100
2025-08-23T16:27:39.212631916Z   libavfilter    10.  4.100 / 10.  4.100
2025-08-23T16:27:39.212641453Z   libswscale      8.  3.100 /  8.  3.100
2025-08-23T16:27:39.212651027Z   libswresample   5.  3.100 /  5.  3.100
2025-08-23T16:27:39.212660490Z   libpostproc    58.  3.100 / 58.  3.100
2025-08-23T16:27:39.212670416Z Input #0, gif, from '/data/library/irfan/2020/08/IMG_9946.gif':
2025-08-23T16:27:39.212680749Z   Duration: 00:00:00.10, start: 0.000000, bitrate: 2 kb/s
2025-08-23T16:27:39.212691656Z   Stream #0:0: Video: gif, 1 reference frame, bgra, 1x1, 10 fps, 100 tbr, 100 tbn
2025-08-23T16:27:39.212702063Z [out#0/image2 @ 0x7f9c10cb40] No explicit maps, mapping streams automatically...
2025-08-23T16:27:39.212712452Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Created video stream from input stream 0:0
2025-08-23T16:27:39.212723730Z [Parsed_thumbnail_1 @ 0x7f9c10c900] batch size: 12 frames
2025-08-23T16:27:39.212776618Z [Parsed_scale_5 @ 0x7f9c10cfc0] w:-2 h:1440 flags:'lanczos+accurate_rnd+full_chroma_int' interl:0
2025-08-23T16:27:39.212792988Z [Parsed_fps_0 @ 0x7f9c10cd80] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated.
2025-08-23T16:27:39.212800858Z Stream mapping:
2025-08-23T16:27:39.212807969Z   Stream #0:0 -> #0:0 (gif (native) -> mjpeg (native))
2025-08-23T16:27:39.212815173Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Starting thread...
2025-08-23T16:27:39.212821950Z [vf#0:0 @ 0x7f9c150400] Starting thread...
2025-08-23T16:27:39.212828561Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Starting thread...
2025-08-23T16:27:39.212835265Z [in#0/gif @ 0x7f9c190480] Starting thread...
2025-08-23T16:27:39.212841783Z Press [q] to stop, [?] for help
2025-08-23T16:27:39.212848154Z [in#0/gif @ 0x7f9c190480] EOF while reading input
2025-08-23T16:27:39.212854691Z [in#0/gif @ 0x7f9c190480] Terminating thread with return code 0 (success)
2025-08-23T16:27:39.212861616Z [gif @ 0x7f9c170f80] picture doesn't have either global or local palette.
2025-08-23T16:27:39.212868394Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Error submitting packet to decoder: Invalid data found when processing input
2025-08-23T16:27:39.212875468Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Decoder thread received EOF packet
2025-08-23T16:27:39.212882246Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Decoder returned EOF, finishing
2025-08-23T16:27:39.212888931Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Decode error rate 1 exceeds maximum 0.666667
2025-08-23T16:27:39.212895857Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Task finished with error code: -1145393733 (Error number -1145393733 occurred)
2025-08-23T16:27:39.212903005Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Terminating thread with return code -1145393733 (Error number -1145393733 occurred)
2025-08-23T16:27:39.212910338Z [Parsed_thumbnail_1 @ 0x7f960c03c0] batch size: 12 frames
2025-08-23T16:27:39.212917004Z [Parsed_scale_5 @ 0x7f960c06c0] w:-2 h:1440 flags:'lanczos+accurate_rnd+full_chroma_int' interl:0
2025-08-23T16:27:39.212923967Z [graph -1 input from stream 0:0 @ 0x7f960c0840] w:1 h:1 pixfmt:bgra tb:1/100 fr:100/1 sar:0/1 csp:unknown range:unknown
2025-08-23T16:27:39.212931041Z [Parsed_fps_0 @ 0x7f960c0240] Set first pts to (in:0 out:0) from start time 0.000000
2025-08-23T16:27:39.212937893Z [Parsed_fps_0 @ 0x7f960c0240] fps=12/1
2025-08-23T16:27:39.212944467Z [Parsed_scale_5 @ 0x7f960c06c0] w:1 h:1 fmt:bgra csp:gbr range:pc sar:0/1 -> w:1440 h:1440 fmt:yuv420p csp:unknown range:pc sar:0/1 flags:0x00042200
2025-08-23T16:27:39.212951689Z [Parsed_scale_5 @ 0x7f960c06c0] [framesync @ 0x7f960f01a8] Selected 1/12 time base
2025-08-23T16:27:39.212958430Z [Parsed_scale_5 @ 0x7f960c06c0] [framesync @ 0x7f960f01a8] Sync level 1
2025-08-23T16:27:39.212965115Z [Parsed_scale_5 @ 0x7f960c06c0] [framesync @ 0x7f960f01a8] Sync level 0
2025-08-23T16:27:39.212985726Z [vf#0:0 @ 0x7f9c150400] Filtergraph returned EOF, finishing
2025-08-23T16:27:39.212994948Z [vf#0:0 @ 0x7f9c150400] All consumers returned EOF
2025-08-23T16:27:39.213001503Z [vf#0:0 @ 0x7f9c210180] No filtered frames for output stream, trying to initialize anyway.
2025-08-23T16:27:39.213008207Z [mjpeg @ 0x7f9c170500] Non full-range YUV is non-standard, set strict_std_compliance to at most unofficial to use it.
2025-08-23T16:27:39.213015133Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
2025-08-23T16:27:39.213022114Z [Parsed_fps_0 @ 0x7f960c0240] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated.
2025-08-23T16:27:39.213028892Z [vf#0:0 @ 0x7f9c150400] Task finished with error code: -22 (Invalid argument)
2025-08-23T16:27:39.213035669Z [vf#0:0 @ 0x7f9c150400] Terminating thread with return code -22 (Invalid argument)
2025-08-23T16:27:39.213042540Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Encoder thread received EOF
2025-08-23T16:27:39.213049206Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Could not open encoder before EOF
2025-08-23T16:27:39.213055817Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Task finished with error code: -22 (Invalid argument)
2025-08-23T16:27:39.213062558Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Terminating thread with return code -22 (Invalid argument)
2025-08-23T16:27:39.213069280Z [out#0/image2 @ 0x7f9c10cb40] Nothing was written into output file, because at least one of its streams received no packets.
2025-08-23T16:27:39.213076335Z frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A    
2025-08-23T16:27:39.213083076Z [in#0/gif @ 0x7f9c190480] Input file #0 (/data/library/irfan/2020/08/IMG_9946.gif):
2025-08-23T16:27:39.213115520Z [in#0/gif @ 0x7f9c190480]   Input stream #0:0 (video): 1 packets read (37 bytes); 0 frames decoded; 1 decode errors; 
2025-08-23T16:27:39.213124557Z [in#0/gif @ 0x7f9c190480]   Total: 1 packets (37 bytes) demuxed
2025-08-23T16:27:39.213131279Z [AVIOContext @ 0x7f9c160180] Statistics: 37 bytes read, 0 seeks
2025-08-23T16:27:39.213137890Z Conversion failed!
2025-08-23T16:27:39.213144168Z 
2025-08-23T16:27:39.224343998Z [Nest] 7  - 08/23/2025, 4:27:39 PM   ERROR [Microservices:{"id":"f186775f-3bda-45a5-8271-d71c35ade9c3"}] Unable to run job handler (AssetGenerateThumbnails): Error: ffmpeg exited with code 69: Conversion failed!
2025-08-23T16:27:39.224419404Z 
2025-08-23T16:27:39.228281624Z Error: ffmpeg exited with code 69: Conversion failed!
2025-08-23T16:27:39.228351493Z 
2025-08-23T16:27:39.228360678Z     at ChildProcess.<anonymous> (/usr/src/app/server/node_modules/.pnpm/fluent-ffmpeg@2.1.3/node_modules/fluent-ffmpeg/lib/processor.js:180:22)
2025-08-23T16:27:39.228369085Z     at ChildProcess.emit (node:events:518:28)
2025-08-23T16:27:39.228375937Z     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
2025-08-23T16:27:40.242007244Z [Nest] 7  - 08/23/2025, 4:27:40 PM   ERROR [Microservices:{"id":"5fb8bc87-b0fd-4bd7-a894-7d801a4b7342"}] Unable to run job handler (AssetGenerateThumbnails): Error: VipsJpeg: premature end of JPEG image
2025-08-23T16:27:40.243693904Z Error: VipsJpeg: premature end of JPEG image
2025-08-23T16:27:40.243745569Z     at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.2/node_modules/sharp/lib/output.js:163:17)
2025-08-23T16:27:40.243755180Z     at MediaRepository.decodeImage (/usr/src/app/server/dist/repositories/media.repository.js:105:68)
2025-08-23T16:27:40.243763032Z     at MediaService.decodeImage (/usr/src/app/server/dist/services/media.service.js:177:59)
2025-08-23T16:27:40.243770717Z     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
2025-08-23T16:27:40.243778180Z     at async MediaService.generateImageThumbnails (/usr/src/app/server/dist/services/media.service.js:189:44)
2025-08-23T16:27:40.243785458Z     at async MediaService.handleGenerateThumbnails (/usr/src/app/server/dist/services/media.service.js:116:25)
2025-08-23T16:27:40.243792587Z     at async JobService.onJobStart (/usr/src/app/server/dist/services/job.service.js:198:28)
2025-08-23T16:27:40.243799513Z     at async EventRepository.onEvent (/usr/src/app/server/dist/repositories/event.repository.js:126:13)
2025-08-23T16:27:40.243806439Z     at async /usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:496:32
2025-08-23T16:27:40.243813457Z     at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:774:24)
2025-08-23T16:27:40.300088716Z [Nest] 7  - 08/23/2025, 4:27:40 PM   ERROR [Microservices:{"id":"799d6edf-e4f8-4f41-9f56-dbb0204d437e"}] Unable to run job handler (AssetGenerateThumbnails): Error: VipsJpeg: premature end of JPEG image
2025-08-23T16:27:40.301992817Z Error: VipsJpeg: premature end of JPEG image
2025-08-23T16:27:40.302039575Z     at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.2/node_modules/sharp/lib/output.js:163:17)
2025-08-23T16:27:40.302049445Z     at MediaRepository.decodeImage (/usr/src/app/server/dist/repositories/media.repository.js:105:68)
2025-08-23T16:27:40.302057167Z     at MediaService.decodeImage (/usr/src/app/server/dist/services/media.service.js:177:59)
2025-08-23T16:27:40.302064297Z     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
2025-08-23T16:27:40.302071186Z     at async MediaService.generateImageThumbnails (/usr/src/app/server/dist/services/media.service.js:189:44)
2025-08-23T16:27:40.302078241Z     at async MediaService.handleGenerateThumbnails (/usr/src/app/server/dist/services/media.service.js:116:25)
2025-08-23T16:27:40.302085074Z     at async JobService.onJobStart (/usr/src/app/server/dist/services/job.service.js:198:28)
2025-08-23T16:27:40.302091926Z     at async EventRepository.onEvent (/usr/src/app/server/dist/repositories/event.repository.js:126:13)
2025-08-23T16:27:40.302131740Z     at async /usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:496:32
2025-08-23T16:27:40.302140351Z     at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:774:24)
@irfanhakim-as commented on GitHub (Aug 23, 2025): Mine only started doing this today, either before or after updating to [v1.139.2](https://github.com/immich-app/immich/releases/tag/v1.139.2) earlier today. Never noticed this happening before, and I wasn't massively uploading anything to the server today either - not more than ~15 media files were uploaded today, in total. I noticed it because 2 of my photos uploaded today had no thumbnail on web, tho they seem to appear fine on mobile. When I checked jobs on the admin account, it showed `2 failed` under the thumbnail generation job. When I run it for missing thumbnails though, my Immich container would crash. Since then, I notice that each time the thumbnail generation job runs, the entire container would crash (nothing to do with resource usage). The `2 failed` kept increasing somehow, to 3, then to 9, then to 12, and now 15 (at the time of writing). Based on the tips provided on here to debug this, I ran this command on the database to try and identify the 'faulty' images: ```sh SELECT "id", "deviceAssetId", "originalPath" FROM "asset" WHERE "type" = 'IMAGE' AND "thumbhash" IS NULL; ``` From that query, there were 6 image files that were returned: - 1 GIF uploaded long ago - 3 HEIC photos uploaded long ago - 1 HEIC photo uploaded just today - 1 PNG screenshot uploaded just today Those 4 images that were uploaded long ago, when checking what they are from my storage, they did appear to be.. wrong or faulty - like incomplete images or completely empty. The 2 photos uploaded just today honestly looked fine (on the Immich storage), even on the mobile app they looked fine. I'm not sure what to do of this now since the server keeps crashing, and I assume it has nothing to do with Immich version `1.139.2` in particular? Logs: ``` 2025-08-23T16:27:39.212479326Z [Nest] 7 - 08/23/2025, 4:27:39 PM ERROR [Microservices:MediaRepository] ffmpeg version 7.1.1-Jellyfin Copyright (c) 2000-2025 the FFmpeg developers 2025-08-23T16:27:39.212562065Z built with gcc 12 (Debian 12.2.0-14) 2025-08-23T16:27:39.212574973Z configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=arm64 --cross-prefix=/usr/bin/aarch64-linux-gnu- --toolchain=hardened --enable-cross-compile --enable-rkmpp --enable-rkrga --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc 2025-08-23T16:27:39.212591528Z libavutil 59. 39.100 / 59. 39.100 2025-08-23T16:27:39.212602157Z libavcodec 61. 19.101 / 61. 19.101 2025-08-23T16:27:39.212612120Z libavformat 61. 7.100 / 61. 7.100 2025-08-23T16:27:39.212622213Z libavdevice 61. 3.100 / 61. 3.100 2025-08-23T16:27:39.212631916Z libavfilter 10. 4.100 / 10. 4.100 2025-08-23T16:27:39.212641453Z libswscale 8. 3.100 / 8. 3.100 2025-08-23T16:27:39.212651027Z libswresample 5. 3.100 / 5. 3.100 2025-08-23T16:27:39.212660490Z libpostproc 58. 3.100 / 58. 3.100 2025-08-23T16:27:39.212670416Z Input #0, gif, from '/data/library/irfan/2020/08/IMG_9946.gif': 2025-08-23T16:27:39.212680749Z Duration: 00:00:00.10, start: 0.000000, bitrate: 2 kb/s 2025-08-23T16:27:39.212691656Z Stream #0:0: Video: gif, 1 reference frame, bgra, 1x1, 10 fps, 100 tbr, 100 tbn 2025-08-23T16:27:39.212702063Z [out#0/image2 @ 0x7f9c10cb40] No explicit maps, mapping streams automatically... 2025-08-23T16:27:39.212712452Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Created video stream from input stream 0:0 2025-08-23T16:27:39.212723730Z [Parsed_thumbnail_1 @ 0x7f9c10c900] batch size: 12 frames 2025-08-23T16:27:39.212776618Z [Parsed_scale_5 @ 0x7f9c10cfc0] w:-2 h:1440 flags:'lanczos+accurate_rnd+full_chroma_int' interl:0 2025-08-23T16:27:39.212792988Z [Parsed_fps_0 @ 0x7f9c10cd80] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated. 2025-08-23T16:27:39.212800858Z Stream mapping: 2025-08-23T16:27:39.212807969Z Stream #0:0 -> #0:0 (gif (native) -> mjpeg (native)) 2025-08-23T16:27:39.212815173Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Starting thread... 2025-08-23T16:27:39.212821950Z [vf#0:0 @ 0x7f9c150400] Starting thread... 2025-08-23T16:27:39.212828561Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Starting thread... 2025-08-23T16:27:39.212835265Z [in#0/gif @ 0x7f9c190480] Starting thread... 2025-08-23T16:27:39.212841783Z Press [q] to stop, [?] for help 2025-08-23T16:27:39.212848154Z [in#0/gif @ 0x7f9c190480] EOF while reading input 2025-08-23T16:27:39.212854691Z [in#0/gif @ 0x7f9c190480] Terminating thread with return code 0 (success) 2025-08-23T16:27:39.212861616Z [gif @ 0x7f9c170f80] picture doesn't have either global or local palette. 2025-08-23T16:27:39.212868394Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Error submitting packet to decoder: Invalid data found when processing input 2025-08-23T16:27:39.212875468Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Decoder thread received EOF packet 2025-08-23T16:27:39.212882246Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Decoder returned EOF, finishing 2025-08-23T16:27:39.212888931Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Decode error rate 1 exceeds maximum 0.666667 2025-08-23T16:27:39.212895857Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Task finished with error code: -1145393733 (Error number -1145393733 occurred) 2025-08-23T16:27:39.212903005Z [vist#0:0/gif @ 0x7f9c120600] [dec:gif @ 0x7f9c160900] Terminating thread with return code -1145393733 (Error number -1145393733 occurred) 2025-08-23T16:27:39.212910338Z [Parsed_thumbnail_1 @ 0x7f960c03c0] batch size: 12 frames 2025-08-23T16:27:39.212917004Z [Parsed_scale_5 @ 0x7f960c06c0] w:-2 h:1440 flags:'lanczos+accurate_rnd+full_chroma_int' interl:0 2025-08-23T16:27:39.212923967Z [graph -1 input from stream 0:0 @ 0x7f960c0840] w:1 h:1 pixfmt:bgra tb:1/100 fr:100/1 sar:0/1 csp:unknown range:unknown 2025-08-23T16:27:39.212931041Z [Parsed_fps_0 @ 0x7f960c0240] Set first pts to (in:0 out:0) from start time 0.000000 2025-08-23T16:27:39.212937893Z [Parsed_fps_0 @ 0x7f960c0240] fps=12/1 2025-08-23T16:27:39.212944467Z [Parsed_scale_5 @ 0x7f960c06c0] w:1 h:1 fmt:bgra csp:gbr range:pc sar:0/1 -> w:1440 h:1440 fmt:yuv420p csp:unknown range:pc sar:0/1 flags:0x00042200 2025-08-23T16:27:39.212951689Z [Parsed_scale_5 @ 0x7f960c06c0] [framesync @ 0x7f960f01a8] Selected 1/12 time base 2025-08-23T16:27:39.212958430Z [Parsed_scale_5 @ 0x7f960c06c0] [framesync @ 0x7f960f01a8] Sync level 1 2025-08-23T16:27:39.212965115Z [Parsed_scale_5 @ 0x7f960c06c0] [framesync @ 0x7f960f01a8] Sync level 0 2025-08-23T16:27:39.212985726Z [vf#0:0 @ 0x7f9c150400] Filtergraph returned EOF, finishing 2025-08-23T16:27:39.212994948Z [vf#0:0 @ 0x7f9c150400] All consumers returned EOF 2025-08-23T16:27:39.213001503Z [vf#0:0 @ 0x7f9c210180] No filtered frames for output stream, trying to initialize anyway. 2025-08-23T16:27:39.213008207Z [mjpeg @ 0x7f9c170500] Non full-range YUV is non-standard, set strict_std_compliance to at most unofficial to use it. 2025-08-23T16:27:39.213015133Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. 2025-08-23T16:27:39.213022114Z [Parsed_fps_0 @ 0x7f960c0240] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated. 2025-08-23T16:27:39.213028892Z [vf#0:0 @ 0x7f9c150400] Task finished with error code: -22 (Invalid argument) 2025-08-23T16:27:39.213035669Z [vf#0:0 @ 0x7f9c150400] Terminating thread with return code -22 (Invalid argument) 2025-08-23T16:27:39.213042540Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Encoder thread received EOF 2025-08-23T16:27:39.213049206Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Could not open encoder before EOF 2025-08-23T16:27:39.213055817Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Task finished with error code: -22 (Invalid argument) 2025-08-23T16:27:39.213062558Z [vost#0:0/mjpeg @ 0x7f9c1f0180] Terminating thread with return code -22 (Invalid argument) 2025-08-23T16:27:39.213069280Z [out#0/image2 @ 0x7f9c10cb40] Nothing was written into output file, because at least one of its streams received no packets. 2025-08-23T16:27:39.213076335Z frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A 2025-08-23T16:27:39.213083076Z [in#0/gif @ 0x7f9c190480] Input file #0 (/data/library/irfan/2020/08/IMG_9946.gif): 2025-08-23T16:27:39.213115520Z [in#0/gif @ 0x7f9c190480] Input stream #0:0 (video): 1 packets read (37 bytes); 0 frames decoded; 1 decode errors; 2025-08-23T16:27:39.213124557Z [in#0/gif @ 0x7f9c190480] Total: 1 packets (37 bytes) demuxed 2025-08-23T16:27:39.213131279Z [AVIOContext @ 0x7f9c160180] Statistics: 37 bytes read, 0 seeks 2025-08-23T16:27:39.213137890Z Conversion failed! 2025-08-23T16:27:39.213144168Z 2025-08-23T16:27:39.224343998Z [Nest] 7 - 08/23/2025, 4:27:39 PM ERROR [Microservices:{"id":"f186775f-3bda-45a5-8271-d71c35ade9c3"}] Unable to run job handler (AssetGenerateThumbnails): Error: ffmpeg exited with code 69: Conversion failed! 2025-08-23T16:27:39.224419404Z 2025-08-23T16:27:39.228281624Z Error: ffmpeg exited with code 69: Conversion failed! 2025-08-23T16:27:39.228351493Z 2025-08-23T16:27:39.228360678Z at ChildProcess.<anonymous> (/usr/src/app/server/node_modules/.pnpm/fluent-ffmpeg@2.1.3/node_modules/fluent-ffmpeg/lib/processor.js:180:22) 2025-08-23T16:27:39.228369085Z at ChildProcess.emit (node:events:518:28) 2025-08-23T16:27:39.228375937Z at ChildProcess._handle.onexit (node:internal/child_process:293:12) 2025-08-23T16:27:40.242007244Z [Nest] 7 - 08/23/2025, 4:27:40 PM ERROR [Microservices:{"id":"5fb8bc87-b0fd-4bd7-a894-7d801a4b7342"}] Unable to run job handler (AssetGenerateThumbnails): Error: VipsJpeg: premature end of JPEG image 2025-08-23T16:27:40.243693904Z Error: VipsJpeg: premature end of JPEG image 2025-08-23T16:27:40.243745569Z at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.2/node_modules/sharp/lib/output.js:163:17) 2025-08-23T16:27:40.243755180Z at MediaRepository.decodeImage (/usr/src/app/server/dist/repositories/media.repository.js:105:68) 2025-08-23T16:27:40.243763032Z at MediaService.decodeImage (/usr/src/app/server/dist/services/media.service.js:177:59) 2025-08-23T16:27:40.243770717Z at process.processTicksAndRejections (node:internal/process/task_queues:105:5) 2025-08-23T16:27:40.243778180Z at async MediaService.generateImageThumbnails (/usr/src/app/server/dist/services/media.service.js:189:44) 2025-08-23T16:27:40.243785458Z at async MediaService.handleGenerateThumbnails (/usr/src/app/server/dist/services/media.service.js:116:25) 2025-08-23T16:27:40.243792587Z at async JobService.onJobStart (/usr/src/app/server/dist/services/job.service.js:198:28) 2025-08-23T16:27:40.243799513Z at async EventRepository.onEvent (/usr/src/app/server/dist/repositories/event.repository.js:126:13) 2025-08-23T16:27:40.243806439Z at async /usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:496:32 2025-08-23T16:27:40.243813457Z at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:774:24) 2025-08-23T16:27:40.300088716Z [Nest] 7 - 08/23/2025, 4:27:40 PM ERROR [Microservices:{"id":"799d6edf-e4f8-4f41-9f56-dbb0204d437e"}] Unable to run job handler (AssetGenerateThumbnails): Error: VipsJpeg: premature end of JPEG image 2025-08-23T16:27:40.301992817Z Error: VipsJpeg: premature end of JPEG image 2025-08-23T16:27:40.302039575Z at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.2/node_modules/sharp/lib/output.js:163:17) 2025-08-23T16:27:40.302049445Z at MediaRepository.decodeImage (/usr/src/app/server/dist/repositories/media.repository.js:105:68) 2025-08-23T16:27:40.302057167Z at MediaService.decodeImage (/usr/src/app/server/dist/services/media.service.js:177:59) 2025-08-23T16:27:40.302064297Z at process.processTicksAndRejections (node:internal/process/task_queues:105:5) 2025-08-23T16:27:40.302071186Z at async MediaService.generateImageThumbnails (/usr/src/app/server/dist/services/media.service.js:189:44) 2025-08-23T16:27:40.302078241Z at async MediaService.handleGenerateThumbnails (/usr/src/app/server/dist/services/media.service.js:116:25) 2025-08-23T16:27:40.302085074Z at async JobService.onJobStart (/usr/src/app/server/dist/services/job.service.js:198:28) 2025-08-23T16:27:40.302091926Z at async EventRepository.onEvent (/usr/src/app/server/dist/repositories/event.repository.js:126:13) 2025-08-23T16:27:40.302131740Z at async /usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:496:32 2025-08-23T16:27:40.302140351Z at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:774:24) ```
Author
Owner

@irfanhakim-as commented on GitHub (Aug 24, 2025):

Continuation from my last report, I've deleted all of the 'faulty' images from the server, and attempted to only reupload the 2 photos I just took today - as far as I'm aware, they're just.. not 'corrupt' in any way, one was a regular photo I took on my iPhone, and another is just a screenshot I took on the same iPhone. They both look/load fine on the phone locally, and elsewhere it's shared.

After reuploading (I could only assume the issue earlier was perhaps related to the upload to the server, not the image files themselves) and generating thumbnail, I'm still faced with the same issue where the thumbnail fails to generate, and worse of all, causes the server to crash and reload. Relevant logs:

[Nest] 7  - 08/24/2025, 2:18:08 AM   ERROR [Microservices:{"id":"799d6edf-e4f8-4f41-9f56-dbb0204d437e"}] Unable to run job handler (AssetGenerateThumbnails): Error: VipsJpeg: premature end of JPEG image
Error: VipsJpeg: premature end of JPEG image
    at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.2/node_modules/sharp/lib/output.js:163:17)
    at MediaRepository.decodeImage (/usr/src/app/server/dist/repositories/media.repository.js:105:68)
    at MediaService.decodeImage (/usr/src/app/server/dist/services/media.service.js:177:59)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async MediaService.generateImageThumbnails (/usr/src/app/server/dist/services/media.service.js:189:44)
    at async MediaService.handleGenerateThumbnails (/usr/src/app/server/dist/services/media.service.js:116:25)
    at async JobService.onJobStart (/usr/src/app/server/dist/services/job.service.js:198:28)
    at async EventRepository.onEvent (/usr/src/app/server/dist/repositories/event.repository.js:126:13)
    at async /usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:496:32
    at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:774:24)
[Nest] 18  - 08/24/2025, 2:19:15 AM     LOG [Api:EventRepository] Websocket Disconnect: xvgxbixmZdNczpMhAAAh
[Nest] 18  - 08/24/2025, 2:19:16 AM     LOG [Api:EventRepository] Websocket Connect:    MrVWIXXZRvZkCLZDAAAj
[Nest] 7  - 08/24/2025, 2:19:56 AM     LOG [Microservices:TrashService] Queued 1 asset(s) for deletion from the trash
[Nest] 18  - 08/24/2025, 2:20:16 AM     LOG [Api:EventRepository] Websocket Connect:    Vrr_wbqilSSfpU63AAAl
Query failed : {
  durationMs: 457.8653109995648,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(6509372c-3115-4c81-bcb0-4660d3dbf509, \\xc60c1a466ed8248ea827d0646b4124da504bd85c) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '6509372c-3115-4c81-bcb0-4660d3dbf509',

,
    <Buffer c6 0c 1a 46 6e d8 24 8e a8 27 d0 64 6b 41 24 da 50 4b d8 5c>,
    '/data/upload/6509372c-3115-4c81-bcb0-4660d3dbf509/bb/63/bb63aedf-0ac5-4016-8b99-488bf202ca85.PNG',
    'A6590BB1-E4B6-4D28-A539-DD213307AED8/L0/001',
    'c604a66a69ee74e56795c21265d042e264b1ef5b97c2080921368007d76136c5',
    2025-08-24T02:20:19.728Z,
    2025-08-23T12:25:35.837Z,
    2025-08-24T02:20:19.728Z,

    'IMAGE',
    false,
    '0',
    'timeline',
    'IMG_7600.PNG'
  ]
}
Query failed : {
  durationMs: 993.1428309995681,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(6509372c-3115-4c81-bcb0-4660d3dbf509, \\xe945e8b4bc70c5eda495853fc2cc1c5326c1dc78) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '6509372c-3115-4c81-bcb0-4660d3dbf509',

,
    <Buffer e9 45 e8 b4 bc 70 c5 ed a4 95 85 3f c2 cc 1c 53 26 c1 dc 78>,
    '/data/upload/6509372c-3115-4c81-bcb0-4660d3dbf509/16/2b/162ba463-dc0f-4728-a914-d232e155a82c.HEIC',
    '23A68984-E36B-44CD-B946-D037DA0EF30C/L0/001',
    'c604a66a69ee74e56795c21265d042e264b1ef5b97c2080921368007d76136c5',
    2025-08-24T02:20:19.712Z,
    2025-08-23T08:12:59.317Z,
    2025-08-24T02:20:19.712Z,

    'IMAGE',
    false,
    '0',
    'timeline',
    'IMG_7595.HEIC'
  ]
}
Initializing Immich v1.139.2
Detected CPU Cores: 4
Starting api worker
Starting microservices worker
@irfanhakim-as commented on GitHub (Aug 24, 2025): Continuation from my last report, I've deleted all of the 'faulty' images from the server, and attempted to only reupload the 2 photos I just took today - as far as I'm aware, they're just.. not 'corrupt' in any way, one was a regular photo I took on my iPhone, and another is just a screenshot I took on the same iPhone. They both look/load fine on the phone locally, and elsewhere it's shared. After reuploading (I could only assume the issue earlier was perhaps related to the upload to the server, not the image files themselves) and generating thumbnail, I'm still faced with the same issue where the thumbnail fails to generate, and worse of all, causes the server to crash and reload. Relevant logs: ``` [Nest] 7 - 08/24/2025, 2:18:08 AM ERROR [Microservices:{"id":"799d6edf-e4f8-4f41-9f56-dbb0204d437e"}] Unable to run job handler (AssetGenerateThumbnails): Error: VipsJpeg: premature end of JPEG image Error: VipsJpeg: premature end of JPEG image at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.2/node_modules/sharp/lib/output.js:163:17) at MediaRepository.decodeImage (/usr/src/app/server/dist/repositories/media.repository.js:105:68) at MediaService.decodeImage (/usr/src/app/server/dist/services/media.service.js:177:59) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async MediaService.generateImageThumbnails (/usr/src/app/server/dist/services/media.service.js:189:44) at async MediaService.handleGenerateThumbnails (/usr/src/app/server/dist/services/media.service.js:116:25) at async JobService.onJobStart (/usr/src/app/server/dist/services/job.service.js:198:28) at async EventRepository.onEvent (/usr/src/app/server/dist/repositories/event.repository.js:126:13) at async /usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:496:32 at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.57.0/node_modules/bullmq/dist/cjs/classes/worker.js:774:24) [Nest] 18 - 08/24/2025, 2:19:15 AM LOG [Api:EventRepository] Websocket Disconnect: xvgxbixmZdNczpMhAAAh [Nest] 18 - 08/24/2025, 2:19:16 AM LOG [Api:EventRepository] Websocket Connect: MrVWIXXZRvZkCLZDAAAj [Nest] 7 - 08/24/2025, 2:19:56 AM LOG [Microservices:TrashService] Queued 1 asset(s) for deletion from the trash [Nest] 18 - 08/24/2025, 2:20:16 AM LOG [Api:EventRepository] Websocket Connect: Vrr_wbqilSSfpU63AAAl Query failed : { durationMs: 457.8653109995648, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(6509372c-3115-4c81-bcb0-4660d3dbf509, \\xc60c1a466ed8248ea827d0646b4124da504bd85c) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '6509372c-3115-4c81-bcb0-4660d3dbf509', , <Buffer c6 0c 1a 46 6e d8 24 8e a8 27 d0 64 6b 41 24 da 50 4b d8 5c>, '/data/upload/6509372c-3115-4c81-bcb0-4660d3dbf509/bb/63/bb63aedf-0ac5-4016-8b99-488bf202ca85.PNG', 'A6590BB1-E4B6-4D28-A539-DD213307AED8/L0/001', 'c604a66a69ee74e56795c21265d042e264b1ef5b97c2080921368007d76136c5', 2025-08-24T02:20:19.728Z, 2025-08-23T12:25:35.837Z, 2025-08-24T02:20:19.728Z, 'IMAGE', false, '0', 'timeline', 'IMG_7600.PNG' ] } Query failed : { durationMs: 993.1428309995681, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(6509372c-3115-4c81-bcb0-4660d3dbf509, \\xe945e8b4bc70c5eda495853fc2cc1c5326c1dc78) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '6509372c-3115-4c81-bcb0-4660d3dbf509', , <Buffer e9 45 e8 b4 bc 70 c5 ed a4 95 85 3f c2 cc 1c 53 26 c1 dc 78>, '/data/upload/6509372c-3115-4c81-bcb0-4660d3dbf509/16/2b/162ba463-dc0f-4728-a914-d232e155a82c.HEIC', '23A68984-E36B-44CD-B946-D037DA0EF30C/L0/001', 'c604a66a69ee74e56795c21265d042e264b1ef5b97c2080921368007d76136c5', 2025-08-24T02:20:19.712Z, 2025-08-23T08:12:59.317Z, 2025-08-24T02:20:19.712Z, 'IMAGE', false, '0', 'timeline', 'IMG_7595.HEIC' ] } Initializing Immich v1.139.2 Detected CPU Cores: 4 Starting api worker Starting microservices worker ```
Author
Owner

@irfanhakim-as commented on GitHub (Aug 24, 2025):

Issue's likely related to v1.139.2 in my case, since photos uploaded since have been erroring/crashing the server - which just doesn't make sense, and downgrading back to v1.138.1 fixes the issue - thumbnails that failed to generate no longer fail, and the server no longer crashes. Related issue: #21189

@irfanhakim-as commented on GitHub (Aug 24, 2025): Issue's likely related to `v1.139.2` in my case, since photos uploaded since have been erroring/crashing the server - which just doesn't make sense, and downgrading back to `v1.138.1` fixes the issue - thumbnails that failed to generate no longer fail, and the server no longer crashes. Related issue: #21189
Author
Owner

@schuettecarsten commented on GitHub (Aug 24, 2025):

Well, in case of broken images, these should be skipped but not case immich to crash at all.
v1.139.2 crashes on start, v1.138.1 reports this error:

immich-server  | [graph -1 input from stream 0:0 @ 0x7f70080840] Invalid color space
immich-server  | [Parsed_fps_0 @ 0x7f700803c0] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated.
immich-server  | [vf#0:0 @ 0x7f781e0c20] Error reinitializing filters!
immich-server  | [vf#0:0 @ 0x7f781e0c20] Task finished with error code: -22 (Invalid argument)
immich-server  | [vf#0:0 @ 0x7f781e0c20] Terminating thread with return code -22 (Invalid argument)
immich-server  | [vost#0:0/mjpeg @ 0x7f78623480] Encoder thread received EOF
immich-server  | [vost#0:0/mjpeg @ 0x7f78623480] Could not open encoder before EOF
immich-server  | [vost#0:0/mjpeg @ 0x7f78623480] Task finished with error code: -22 (Invalid argument)
immich-server  | [vost#0:0/mjpeg @ 0x7f78623480] Terminating thread with return code -22 (Invalid argument)
immich-server  | [vist#0:0/h264 @ 0x7f78120d80] [dec:h264 @ 0x7f78150b80] Decoder returned EOF, finishing
immich-server  | [vist#0:0/h264 @ 0x7f78120d80] [dec:h264 @ 0x7f78150b80] Terminating thread with return code 0 (success)
immich-server  | [vist#0:0/h264 @ 0x7f78120d80] All consumers of this stream are done
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] All consumers are done
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] Terminating thread with return code 0 (success)
immich-server  | [out#0/image2 @ 0x7f7810ccc0] Nothing was written into output file, because at least one of its streams received no packets.
immich-server  | frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] Input file #0 (/data/library/till/2024/2024-03-07/20240307_162616.mp4):
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480]   Input stream #0:0 (video): 44 packets read (3473961 bytes); 2 frames decoded; 0 decode errors;
immich-server  | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480]   Total: 44 packets (3473961 bytes) demuxed
immich-server  | [AVIOContext @ 0x7f78150180] Statistics: 3548299 bytes read, 2 seeks
immich-server  | Conversion failed!
immich-server  |
immich-server  | [Nest] 7  - 08/24/2025, 4:32:56 PM   ERROR [Microservices:{"id":"66ff11c0-4eb2-4df3-8d70-ddac09d4048c"}] Unable to run job handler (AssetGenerateThumbnails): Error: ffmpeg exited with code 234: Conversion failed!
immich-server  |
immich-server  | Error: ffmpeg exited with code 234: Conversion failed!
immich-server  |
immich-server  |     at ChildProcess.<anonymous> (/usr/src/app/server/node_modules/fluent-ffmpeg/lib/processor.js:180:22)
immich-server  |     at ChildProcess.emit (node:events:518:28)
immich-server  |     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
@schuettecarsten commented on GitHub (Aug 24, 2025): Well, in case of broken images, these should be skipped but not case immich to crash at all. v1.139.2 crashes on start, v1.138.1 reports this error: ``` immich-server | [graph -1 input from stream 0:0 @ 0x7f70080840] Invalid color space immich-server | [Parsed_fps_0 @ 0x7f700803c0] 0 frames in, 0 frames out; 0 frames dropped, 0 frames duplicated. immich-server | [vf#0:0 @ 0x7f781e0c20] Error reinitializing filters! immich-server | [vf#0:0 @ 0x7f781e0c20] Task finished with error code: -22 (Invalid argument) immich-server | [vf#0:0 @ 0x7f781e0c20] Terminating thread with return code -22 (Invalid argument) immich-server | [vost#0:0/mjpeg @ 0x7f78623480] Encoder thread received EOF immich-server | [vost#0:0/mjpeg @ 0x7f78623480] Could not open encoder before EOF immich-server | [vost#0:0/mjpeg @ 0x7f78623480] Task finished with error code: -22 (Invalid argument) immich-server | [vost#0:0/mjpeg @ 0x7f78623480] Terminating thread with return code -22 (Invalid argument) immich-server | [vist#0:0/h264 @ 0x7f78120d80] [dec:h264 @ 0x7f78150b80] Decoder returned EOF, finishing immich-server | [vist#0:0/h264 @ 0x7f78120d80] [dec:h264 @ 0x7f78150b80] Terminating thread with return code 0 (success) immich-server | [vist#0:0/h264 @ 0x7f78120d80] All consumers of this stream are done immich-server | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] All consumers are done immich-server | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] Terminating thread with return code 0 (success) immich-server | [out#0/image2 @ 0x7f7810ccc0] Nothing was written into output file, because at least one of its streams received no packets. immich-server | frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A immich-server | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] Input file #0 (/data/library/till/2024/2024-03-07/20240307_162616.mp4): immich-server | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] Input stream #0:0 (video): 44 packets read (3473961 bytes); 2 frames decoded; 0 decode errors; immich-server | [in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f78190480] Total: 44 packets (3473961 bytes) demuxed immich-server | [AVIOContext @ 0x7f78150180] Statistics: 3548299 bytes read, 2 seeks immich-server | Conversion failed! immich-server | immich-server | [Nest] 7 - 08/24/2025, 4:32:56 PM ERROR [Microservices:{"id":"66ff11c0-4eb2-4df3-8d70-ddac09d4048c"}] Unable to run job handler (AssetGenerateThumbnails): Error: ffmpeg exited with code 234: Conversion failed! immich-server | immich-server | Error: ffmpeg exited with code 234: Conversion failed! immich-server | immich-server | at ChildProcess.<anonymous> (/usr/src/app/server/node_modules/fluent-ffmpeg/lib/processor.js:180:22) immich-server | at ChildProcess.emit (node:events:518:28) immich-server | at ChildProcess._handle.onexit (node:internal/child_process:293:12) ```
Author
Owner

@ikke-t commented on GitHub (Sep 2, 2025):

I join here to listen to conversation. I confirm the same started to happen to me for the latest mobile pics after updating from 136-137 to 141.1. This is arm (raspi4). Never happened before, and now all new pics are "broken". Same oneplus camera as always.

After pressing scan for the missing thumbnails the container dies. Nothing has time to get written into log.

@ikke-t commented on GitHub (Sep 2, 2025): I join here to listen to conversation. I confirm the same started to happen to me for the latest mobile pics after updating from 136-137 to 141.1. This is arm (raspi4). Never happened before, and now all new pics are "broken". Same oneplus camera as always. After pressing scan for the missing thumbnails the container dies. Nothing has time to get written into log.
Author
Owner

@skatsubo commented on GitHub (Sep 2, 2025):

Hey @ikke-t, have you checked the issue https://github.com/immich-app/immich/issues/21189 linked above? Looks like your case: raspi4.

@skatsubo commented on GitHub (Sep 2, 2025): Hey @ikke-t, have you checked the issue https://github.com/immich-app/immich/issues/21189 linked above? Looks like your case: raspi4.
Author
Owner

@skatsubo commented on GitHub (Sep 2, 2025):

@schuettecarsten

v1.138.1 reports this error:

immich-server  | [graph -1 input from stream 0:0 @ 0x7f70080840] Invalid color space
...
immich-server  | [vf#0:0 @ 0x7f781e0c20] Task finished with error code: -22 (Invalid argument)
...
immich-server  | [Nest] 7  - 08/24/2025, 4:32:56 PM   ERROR [Microservices:{"id":"66ff11c0-4eb2-4df3-8d70-ddac09d4048c"}] Unable to run job handler (AssetGenerateThumbnails): Error: ffmpeg exited with code 234: Conversion failed!

Failed video thumbnails due to "Invalid color space" in ffmpeg v7.1 -> https://github.com/immich-app/immich/issues/16154

@skatsubo commented on GitHub (Sep 2, 2025): @schuettecarsten > v1.138.1 reports this error: > > ``` > immich-server | [graph -1 input from stream 0:0 @ 0x7f70080840] Invalid color space > ... > immich-server | [vf#0:0 @ 0x7f781e0c20] Task finished with error code: -22 (Invalid argument) > ... > immich-server | [Nest] 7 - 08/24/2025, 4:32:56 PM ERROR [Microservices:{"id":"66ff11c0-4eb2-4df3-8d70-ddac09d4048c"}] Unable to run job handler (AssetGenerateThumbnails): Error: ffmpeg exited with code 234: Conversion failed! > ``` Failed video thumbnails due to "Invalid color space" in ffmpeg v7.1 -> https://github.com/immich-app/immich/issues/16154
Author
Owner

@ikke-t commented on GitHub (Sep 2, 2025):

Hey @ikke-t, have you checked the issue #21189 linked above? Looks like your case: raspi4.

thanks, it fixed the container crash.

@ikke-t commented on GitHub (Sep 2, 2025): > Hey [@ikke-t](https://github.com/ikke-t), have you checked the issue [#21189](https://github.com/immich-app/immich/issues/21189) linked above? Looks like your case: raspi4. thanks, it fixed the container crash.
Author
Owner

@jrasm91 commented on GitHub (Sep 9, 2025):

Looks like the original issue was caused by corrupt images. Some later issues are duplicates of existing issues like #16154 and #21189. If you have a set of reproducible steps that still leads to unexpected results, feel free to open a new issue and we can investigate.

@jrasm91 commented on GitHub (Sep 9, 2025): Looks like the original issue was caused by corrupt images. Some later issues are duplicates of existing issues like #16154 and #21189. If you have a set of reproducible steps that still leads to unexpected results, feel free to open a new issue and we can investigate.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5367