Photos from Apple Device with corrupt header #7480

Closed
opened 2026-02-05 13:04:39 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @LittleNewton on GitHub (Oct 9, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

[Nest] 7  - 10/09/2025, 7:11:49 PM   ERROR [Microservices:{"source":"upload","id":"3e83d411-a469-413c-a8b8-a7e14b178d29"}] Unable to run job handler (AssetGenerateThumbnails): Error: Input file has corrupt header:
Error: Input file has corrupt header:
    at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.3/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.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:498:32
    at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:776:24)
[Nest] 7  - 10/09/2025, 7:11:50 PM   ERROR [Microservices:{"source":"upload","id":"33cc5f7a-f53e-4c46-a1fd-9aafcaaa43a1"}] Unable to run job handler (AssetGenerateThumbnails): Error: Input file has corrupt header:
Error: Input file has corrupt header:
    at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.3/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.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:498:32
    at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:776:24)
[Nest] 7  - 10/09/2025, 7:17:04 PM   ERROR [Microservices:{"id":"fda6e82c-c459-4094-b8af-1e531f413a51"}] Unable to run job handler (AssetGenerateThumbnails): Error: Input file has corrupt header:
Error: Input file has corrupt header:
    at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.3/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.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:498:32
    at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:776:24)

The OS that Immich Server is running on

Debian 13

Version of Immich Server

v2.0.1

Version of Immich Mobile App

v2.0.1

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

macOS Tahoe

Your docker-compose.yml content

name: immich
services:
  immich:
    container_name: immich
    hostname: immich
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: nvenc
    volumes:
      - ${APPDATA_PATH}/${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${NAS_DROPBOX_PATH}/${SOURCE_LOCATION}:/source:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: unless-stopped
    healthcheck:
      disable: false
    networks:
      - reverse_proxy
      - backend

  immich-machine-learning:
    container_name: immich_ml
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
    extends:
      file: hwaccel.ml.yml
      service: cuda
    volumes:
      - ${APPDATA_PATH}/${MODEL_CACHE}:/cache
    env_file:
      - .env
    restart: unless-stopped
    healthcheck:
      disable: false
    networks:
      - backend

  redis:
    container_name: immich_cache
    # image: redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
    image: redis:6.2-alpine
    healthcheck:
      test: redis-cli ping || exit 1
    restart: unless-stopped
    networks:
      - backend

  database:
    container_name: immich_db
    hostname: immich_db
    # image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: "--data-checksums"
    volumes:
      - ${APPDATA_PATH}/${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: >-
        pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1;
        Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --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
      start_interval: 30s
      start_period: 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
    restart: unless-stopped
    networks:
      - backend

volumes:
  model-cache:

networks:
  reverse_proxy:
    name: reverse_proxy
    external: true
  backend:
    name: backend_immich
    driver: bridge

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=Immich/upload
# The location where your database files are stored
DB_DATA_LOCATION=Immich/database
# model-cache
MODEL_CACHE=Immich/model_cache
# Local image library
SOURCE_LOCATION=Pictures

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=Asia/Shanghai

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=secret

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

...

Relevant log output


Additional information

No response

Originally created by @LittleNewton on GitHub (Oct 9, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug ``` [Nest] 7 - 10/09/2025, 7:11:49 PM ERROR [Microservices:{"source":"upload","id":"3e83d411-a469-413c-a8b8-a7e14b178d29"}] Unable to run job handler (AssetGenerateThumbnails): Error: Input file has corrupt header: Error: Input file has corrupt header: at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.3/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.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:498:32 at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:776:24) [Nest] 7 - 10/09/2025, 7:11:50 PM ERROR [Microservices:{"source":"upload","id":"33cc5f7a-f53e-4c46-a1fd-9aafcaaa43a1"}] Unable to run job handler (AssetGenerateThumbnails): Error: Input file has corrupt header: Error: Input file has corrupt header: at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.3/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.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:498:32 at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:776:24) [Nest] 7 - 10/09/2025, 7:17:04 PM ERROR [Microservices:{"id":"fda6e82c-c459-4094-b8af-1e531f413a51"}] Unable to run job handler (AssetGenerateThumbnails): Error: Input file has corrupt header: Error: Input file has corrupt header: at Sharp.toBuffer (/usr/src/app/server/node_modules/.pnpm/sharp@0.34.3/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.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:498:32 at async Worker.retryIfFailed (/usr/src/app/server/node_modules/.pnpm/bullmq@5.58.5/node_modules/bullmq/dist/cjs/classes/worker.js:776:24) ``` ### The OS that Immich Server is running on Debian 13 ### Version of Immich Server v2.0.1 ### Version of Immich Mobile App v2.0.1 ### Platform with the issue - [x] Server - [x] Web - [ ] Mobile ### Device make and model macOS Tahoe ### Your docker-compose.yml content ```YAML name: immich services: immich: container_name: immich hostname: immich image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: file: hwaccel.transcoding.yml service: nvenc volumes: - ${APPDATA_PATH}/${UPLOAD_LOCATION}:/usr/src/app/upload - ${NAS_DROPBOX_PATH}/${SOURCE_LOCATION}:/source:ro - /etc/localtime:/etc/localtime:ro env_file: - .env depends_on: - redis - database restart: unless-stopped healthcheck: disable: false networks: - reverse_proxy - backend immich-machine-learning: container_name: immich_ml image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda extends: file: hwaccel.ml.yml service: cuda volumes: - ${APPDATA_PATH}/${MODEL_CACHE}:/cache env_file: - .env restart: unless-stopped healthcheck: disable: false networks: - backend redis: container_name: immich_cache # image: redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5 image: redis:6.2-alpine healthcheck: test: redis-cli ping || exit 1 restart: unless-stopped networks: - backend database: container_name: immich_db hostname: immich_db # image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 image: tensorchord/pgvecto-rs:pg14-v0.2.0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: "--data-checksums" volumes: - ${APPDATA_PATH}/${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: test: >- pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --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 start_interval: 30s start_period: 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 restart: unless-stopped networks: - backend volumes: model-cache: networks: reverse_proxy: name: reverse_proxy external: true backend: name: backend_immich driver: bridge ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=Immich/upload # The location where your database files are stored DB_DATA_LOCATION=Immich/database # model-cache MODEL_CACHE=Immich/model_cache # Local image library SOURCE_LOCATION=Pictures # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List TZ=Asia/Shanghai # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=secret # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. 2. 3. ... ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@LittleNewton commented on GitHub (Oct 9, 2025):

Image
@LittleNewton commented on GitHub (Oct 9, 2025): <img width="1553" height="1044" alt="Image" src="https://github.com/user-attachments/assets/4f043933-6181-4867-a464-6c60da5b6e1b" />
Author
Owner

@LittleNewton commented on GitHub (Oct 9, 2025):

An error example:

2025-09-21 185915.heic.zip

# check identity
root@250707:/photoprism/originals/Main/iPhone 14 Pro$ identify '2025-09-21 185915.heic'
identify: Invalid input: No 'ftyp' box: File does not start with 'ftyp' box. (2.102) `2025-09-21 185915.heic' @ error/heic.c/IsHEIFSuccess/141.

# file type
root@250707:/photoprism/originals/Main/iPhone 14 Pro$ file '2025-09-21 185915.heic'
2025-09-21 185915.heic: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile

# xxd
root@250707:/photoprism/originals/Main/iPhone 14 Pro$ xxd -l 32 '2025-09-21 185915.heic'
00000000: 0000 0028 6674 7970 6865 6963 0000 0000  ...(ftypheic....
00000010: 6d69 6631 4d69 4845 4d69 5072 6d69 6166  mif1MiHEMiPrmiaf
root@250707:/photoprism/originals/Main/iPhone 14 Pro$
@LittleNewton commented on GitHub (Oct 9, 2025): An error example: [2025-09-21 185915.heic.zip](https://github.com/user-attachments/files/22796456/2025-09-21.185915.heic.zip) ``` shell # check identity root@250707:/photoprism/originals/Main/iPhone 14 Pro$ identify '2025-09-21 185915.heic' identify: Invalid input: No 'ftyp' box: File does not start with 'ftyp' box. (2.102) `2025-09-21 185915.heic' @ error/heic.c/IsHEIFSuccess/141. # file type root@250707:/photoprism/originals/Main/iPhone 14 Pro$ file '2025-09-21 185915.heic' 2025-09-21 185915.heic: ISO Media, HEIF Image HEVC Main or Main Still Picture Profile # xxd root@250707:/photoprism/originals/Main/iPhone 14 Pro$ xxd -l 32 '2025-09-21 185915.heic' 00000000: 0000 0028 6674 7970 6865 6963 0000 0000 ...(ftypheic.... 00000010: 6d69 6631 4d69 4845 4d69 5072 6d69 6166 mif1MiHEMiPrmiaf root@250707:/photoprism/originals/Main/iPhone 14 Pro$ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7480