Skip to content

Immich server hangs indefinitely when processing corrupt JPEG files #24044

@McBenac

Description

@McBenac

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

  • Yes

The bug

Environment:

  • Immich version: v2.2.3
  • Installation: Docker Compose
  • OS: Ubuntu Server 24.04
  • Storage: External library on NFS mount

Description:

Immich server becomes completely unresponsive when attempting to process corrupt JPEG files. The web interface hangs with "Server Offline - Unknown" status, and the application requires a full stack restart (including Redis cache clear) to recover.

Steps to Reproduce:

  1. Have corrupt JPEG files in external library path (files can be opened partially but have corrupted image data)
  2. Immich discovers and attempts to process these files during library scan
  3. Web interface becomes unresponsive
  4. Server shows "healthy" status but websocket connections fail immediately
  5. Browser console shows: Uncaught (in promise) The message port closed before a response was received

Expected Behavior:

Immich should skip corrupt/unreadable files gracefully, log the error and continue processing other files.

Actual Behavior:

  • Web interface becomes completely unresponsive
  • No error logged in docker logs immich_server
  • Websocket connections establish (101) but disconnect immediately
  • API endpoints respond (200 OK) but frontend cannot load
  • Regular docker compose restart does NOT fix the issue
  • Only docker compose down + docker compose up -d (full Redis cache clear) resolves it

Recovery Steps Taken:

  1. Identified corrupt files from error context
  2. Removed files from disk storage
  3. Removed asset entries from database: DELETE FROM asset WHERE id IN (...)
  4. Full stack shutdown and restart to clear Redis cache
  5. System recovered and functions normally

Additional Information:

  • The corrupt JPEG files were also corrupt in backup storage, indicating corruption occurred before upload
  • I can provide the corrupt JPEG files to developers upon request (prefer not to attach publicly)

Impact:

High - Complete service outage requiring manual database intervention and full restart

The OS that Immich Server is running on

Ubuntu Server 24.04

Version of Immich Server

v2.2.3

Version of Immich Mobile App

N/A

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

No response

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

...

Relevant log output

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions