immich icon indicating copy to clipboard operation
immich copied to clipboard

Immich server hangs indefinitely when processing corrupt JPEG files

Open McBenac opened this issue 1 month ago • 7 comments

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

McBenac avatar Nov 20 '25 18:11 McBenac

This issue has automatically been closed as it is likely a duplicate. We get a lot of duplicate threads each day, which is why we ask you in the template to confirm that you searched for duplicates before opening one. If you're sure this is not a duplicate, please leave a comment and we will reopen the thread if necessary.

github-actions[bot] avatar Nov 20 '25 18:11 github-actions[bot]

I suggest that this issue be reopened. This is a distinct bug that differs significantly from other corrupt file issues.

Why this is a unique bug:

Unlike similar issues where corrupt files produce ERROR logs during thumbnail generation (#8510, #10507, #7128), this bug causes:

  1. Silent system failure - Zero error messages in logs while system becomes completely unresponsive
  2. Complete service outage - Web interface shows "Server Offline - Unknown", websockets fail, system appears healthy but is unusable
  3. Requires full shutdown - docker compose restart does NOT resolve it; only docker compose down + up -d works

This is not a duplicate of existing issues - those bugs log errors and fail gracefully. This bug silently hangs the entire system requiring manual intervention.

I have the corrupt JPEG files saved and can provide them for reproduction. I have also enabled LOG_LEVEL=verbose for additional debugging if this occurs again.

Please reopen this issue.

McBenac avatar Nov 20 '25 19:11 McBenac

Hello, can you help share a zipped corrupted file so it can be used for testing?

alextran1502 avatar Nov 20 '25 19:11 alextran1502

Hmm hold on, you are on v2.2.3 so the freeze issue is coming from the popped up notification. Can you help updating to the latest version?

alextran1502 avatar Nov 20 '25 19:11 alextran1502

Your compose and env content is applicable to this issue, please attach them as requested.

mmomjian avatar Nov 20 '25 19:11 mmomjian

Hi! Here are the requested files:

Environment:

  • Immich version: v2.2.3 (upgraded to v2.3.1 after the bug occurred)
  • Deployment: Docker Compose
  • External library: ~500k photos on Synology NAS via NFS (read-only)

Files attached:

  1. docker-compose.yml (sanitized)
  2. Relevant .env settings (passwords removed)
  3. ZIP with the three corrupted files

Additional context:

  • Verbose logging is enabled (LOG_LEVEL=verbose)
  • The bug caused complete system unresponsiveness with NO error messages in logs
  • Only docker compose down + up (full Redis cache clear) resolved it
  • After removing the corrupt files from disk AND database, system works normally

corrupt images.zip

docker-compose-sanitized.yml env-relevant-settings.txt

McBenac avatar Dec 06 '25 00:12 McBenac

Now I'm wondering if somehow corrupt files in my asset library are causing me issues. I see Brave desktop browser crashes all the time when scrolling through my library. Especially when selecting 20-100 items to add to an album. I see no obvious errors either.

scrampker avatar Dec 09 '25 01:12 scrampker