immich icon indicating copy to clipboard operation
immich copied to clipboard

import HEIF photo failure on 1.109.x immich server

Open LoadingZhang opened this issue 1 year ago • 19 comments
trafficstars

i got error after update from 108 -> 109 in website, rollback 108 then get back to normal.

[Nest] 7  - 07/20/2024, 10:08:29 PM   ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-preview): Error: Input file has corrupt header: magickload: Magick: UnableToLoadModule '/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.la': file not found @ error/module.c/OpenModule/1293 (null)
[Nest] 7  - 07/20/2024, 10:08:29 PM   ERROR [Microservices:JobService] Error: Input file has corrupt header: magickload: Magick: UnableToLoadModule '/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.la': file not found @ error/module.c/OpenModule/1293 (null)
    at Sharp.toFile (/usr/src/app/node_modules/sharp/lib/output.js:89:19)
    at MediaRepository.generateThumbnail (/usr/src/app/dist/repositories/media.repository.js:69:14)
    at MediaService.generateThumbnail (/usr/src/app/dist/services/media.service.js:164:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MediaService.handleGeneratePreview (/usr/src/app/dist/services/media.service.js:135:29)
    at async /usr/src/app/dist/services/job.service.js:148:36
    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  - 07/20/2024, 10:08:29 PM   ERROR [Microservices:JobService] Object:
{
  "id": "6797f51d-30bc-4d82-b950-463f62729377",
  "source": "upload"
}

file: IMG_20240720_230151.zip

The OS that Immich Server is running on

Debian WSL2

Version of Immich Server

v1.109.x

Version of Immich Mobile App

null

Platform with the issue

  • [X] Server
  • [ ] Web
  • [ ] Mobile

Your docker-compose.yml content

immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: vaapi-wsl # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    devices: ["/dev/dri"]
    env_file: [".env"]
    ports: ["2283:3001"]
    depends_on:
      - redis
      - database
    restart: on-failure

Your .env content

Upload again if you need to

Reproduction steps

upload HEIF file from web or app

Relevant log output

No response

Additional information

No response

LoadingZhang avatar Jul 20 '24 16:07 LoadingZhang

I think I'm experiencing the same problem, but going back to 108 doesn't resolve the problem for me. For each upload, I see an error like this:


[Nest] 8  - 07/24/2024, 6:23:53 AM   ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-preview): Error: Input file has corrupt header: magickload: Magick: UnableToLoadModule '/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.la': file not found @ error/module.c/OpenModule/1293 (null)
[Nest] 8  - 07/24/2024, 6:23:53 AM   ERROR [Microservices:JobService] Error: Input file has corrupt header: magickload: Magick: UnableToLoadModule '/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.la': file not found @ error/module.c/OpenModule/1293 (null)
    at Sharp.toFile (/usr/src/app/node_modules/sharp/lib/output.js:89:19)
    at MediaRepository.generateThumbnail (/usr/src/app/dist/repositories/media.repository.js:69:14)
    at MediaService.generateThumbnail (/usr/src/app/dist/services/media.service.js:164:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MediaService.handleGeneratePreview (/usr/src/app/dist/services/media.service.js:135:29)
    at async /usr/src/app/dist/services/job.service.js:148:36
    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] 8  - 07/24/2024, 6:23:53 AM   ERROR [Microservices:JobService] Object:
{
  "id": "e097f3c9-a6a4-48c1-9fb6-a273599be169"
}

ebrearley avatar Jul 24 '24 06:07 ebrearley

I met the same problem with the same config and version.

zprde avatar Jul 25 '24 09:07 zprde

If you guys temporarily disable hardware acceleration, does it work normally?

alextran1502 avatar Jul 25 '24 12:07 alextran1502

If you guys temporarily disable hardware acceleration, does it work normally?

Yes, it works for me by remobving the hardware acceleration.

zprde avatar Jul 26 '24 01:07 zprde

I met the same problem with the same config and version.

I'm also hit with this issue :-( Removed all my HW acceleration config in the immich-server docker-compose and that worked.

w00tlarr avatar Jul 27 '24 05:07 w00tlarr

The vaapi-wsl config sets LD_LIBRARY_PATH=/usr/lib/wsl/lib, so this is probably messing with other libraries.

mertalev avatar Jul 28 '24 18:07 mertalev

If you guys temporarily disable hardware acceleration, does it work normally?

Hi.

I´m facing the same problem but I´m not using HW acceleration. Do you want more info from me or do you already have a solution :)

I´m running v1.110.0

dodg3r avatar Jul 29 '24 22:07 dodg3r

@dodg3r if you can include a sample file, that would be great

alextran1502 avatar Jul 30 '24 02:07 alextran1502

It seems that about 20 of my uploaded files are corrupt. I need to investigate where in the process they became corrupt.

dodg3r avatar Jul 30 '24 09:07 dodg3r

I met the same problem with the same config and version.

I'm also hit with this issue :-( Removed all my HW acceleration config in the immich-server docker-compose and that worked.

I fixed my issue. My docker compose has this: environment: - LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/dri - LIBVA_DRIVER_NAME=iHD

Works now after removing that.

w00tlarr avatar Jul 31 '24 02:07 w00tlarr

If you guys temporarily disable hardware acceleration, does it work normally?

remove vaapi in docker compose worked.

LoadingZhang avatar Aug 01 '24 15:08 LoadingZhang

1.111.0 with iOS 18 beta 4 and latest app.

No thumbnails no image in Web (HEIC only)

2024-08-05 14:58:27 [Nest] 7 - 08/05/2024, 12:58:27 PM ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-preview): Error: Input file has corrupt header: magickload: Magick: UnableToLoadModule '/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.la': file not found @ error/module.c/OpenModule/1293 (null) 2024-08-05 14:58:27 [Nest] 7 - 08/05/2024, 12:58:27 PM ERROR [Microservices:JobService] Error: Input file has corrupt header: magickload: Magick: UnableToLoadModule '/usr/local/lib/ImageMagick-7.1.1/modules-Q16HDRI/coders/heic.la': file not found @ error/module.c/OpenModule/1293 (null)

jakub-antos avatar Aug 05 '24 18:08 jakub-antos

@jakub-antos are you using any hardware acceleration? Look like they are not compatible with the newer version of HEIC

alextran1502 avatar Aug 05 '24 18:08 alextran1502

@alextran1502 No im not using HW acceleration, pure CPU AMD Ryzen Embedded R1505G, disabled HW Accel in Transcoding, no additional options in

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 - /etc/localtime:/etc/localtime:ro env_file: - .env depends_on: - redis - database restart: always

Latest Docker Desktop / Win 11

jakub-antos avatar Aug 05 '24 18:08 jakub-antos

@jakub-antos your docker compose file is out of date, there is no microservices anymore. I assume any photo you upload will not have thumbnail generated, not just HEIC

alextran1502 avatar Aug 05 '24 18:08 alextran1502

@alextran1502 Thank you so much! It works perfectly, and everything is back to normal!

jakub-antos avatar Aug 05 '24 19:08 jakub-antos

Why is this closed? It still doesn't work with hardware acceleration. Shouldn't the solution be to fix the path issue?

akropp avatar Aug 21 '24 22:08 akropp

You're right, the issue is still present. I think changing the LD_LIBRARY_PATH env in the vaapi-wsl config to /usr/lib/jellyfin-ffmpeg/lib:/usr/lib/wsl/lib should fix it.

mertalev avatar Aug 22 '24 01:08 mertalev

Yes, that did it!

--Adam

On Wed, Aug 21, 2024 at 9:47 PM Mert @.***> wrote:

You're right, the issue is still present. I think changing the LD_LIBRARY_PATH env in the vaapi-wsl config to /usr/lib/jellyfin-ffmpeg/lib:/usr/lib/wsl/lib should fix it.

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

akropp avatar Aug 22 '24 19:08 akropp

You're right, the issue is still present. I think changing the LD_LIBRARY_PATH env in the vaapi-wsl config to /usr/lib/jellyfin-ffmpeg/lib:/usr/lib/wsl/lib should fix it.

Should this be PRed to the file provided in the repo?

(I confirmed this issue on my system.)

NicholasFlamy avatar Aug 30 '24 22:08 NicholasFlamy

That would be good, yes. Better would be to add the env to the image directly here and remove that env from the vaapi-wsl config. It'll avoid this happening again if the expected LD_LIBRARY_PATH changes.

mertalev avatar Aug 30 '24 23:08 mertalev

If that's better then would you be able to PR that? I'm not certain I know what to do there.

NicholasFlamy avatar Aug 31 '24 00:08 NicholasFlamy