[BUG] Need to verify the integrity of uploads via checksumming to prevent corrupted uploads #1479

Closed
opened 2026-02-05 02:01:27 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @ItalyPaleAle on GitHub (Oct 18, 2023).

The bug

Some of the photos imported to my Immich server (using the iOS app, but running it from my Mac) appear to be corrupted.

This can be observed, for example, because the thumbnails fail to be generated. Logs from the microservices container show things such as:
image

A possible solution to this issue could involve checksumming files before they are uploaded. The upload client (at least the apps) would compute the SHA-256 sum of the file and upload it alongside the data. The server can then verify the checksum of the uploaded file to ensure the data was uploaded correctly.

Bonus: the checksum can be stored in the database too, to validate the integrity of the file at any point in time if needed.

The OS that Immich Server is running on

Docker (on Debian 12)

Version of Immich Server

v1.82.0

Version of Immich Mobile App

v1.82.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

Using K8s - but issue seems to be unrelated

Your .env content

Using K8s - but issue seems to be unrelated

Reproduction steps

1. Upload a file from the mobile app
2. In some situations, the file may arrive corrupted (for example due to network failures)
3. Thumbnails fail to be generated

Additional information

No response

Originally created by @ItalyPaleAle on GitHub (Oct 18, 2023). ### The bug Some of the photos imported to my Immich server (using the iOS app, but running it from my Mac) appear to be corrupted. This can be observed, for example, because the thumbnails fail to be generated. Logs from the microservices container show things such as: <img width="1330" alt="image" src="https://github.com/immich-app/immich/assets/43508/85d04c7c-eaff-4d57-908a-39e8d34c18cc"> A possible solution to this issue could involve checksumming files before they are uploaded. The upload client (at least the apps) would compute the SHA-256 sum of the file and upload it alongside the data. The server can then verify the checksum of the uploaded file to ensure the data was uploaded correctly. > Bonus: the checksum can be stored in the database too, to validate the integrity of the file at any point in time if needed. ### The OS that Immich Server is running on Docker (on Debian 12) ### Version of Immich Server v1.82.0 ### Version of Immich Mobile App v1.82.0 ### Platform with the issue - [X] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML Using K8s - but issue seems to be unrelated ``` ### Your .env content ```Shell Using K8s - but issue seems to be unrelated ``` ### Reproduction steps ```bash 1. Upload a file from the mobile app 2. In some situations, the file may arrive corrupted (for example due to network failures) 3. Thumbnails fail to be generated ``` ### Additional information _No response_
Author
Owner

@jrasm91 commented on GitHub (Oct 18, 2023):

I don't think the file is actually corrupt. Can you manually upload one of these files using the web? Does it run into the same error?

@jrasm91 commented on GitHub (Oct 18, 2023): I don't think the file is actually corrupt. Can you manually upload one of these files using the web? Does it run into the same error?
Author
Owner

@ItalyPaleAle commented on GitHub (Oct 18, 2023):

I don't think the file is actually corrupt. Can you manually upload one of these files using the web? Does it run into the same error?

Sure, I will try in a few hours when the initial sync is done.

@ItalyPaleAle commented on GitHub (Oct 18, 2023): > I don't think the file is actually corrupt. Can you manually upload one of these files using the web? Does it run into the same error? Sure, I will try in a few hours when the initial sync is done.
Author
Owner

@ItalyPaleAle commented on GitHub (Oct 18, 2023):

@jrasm91 looks like the photos got re-uploaded automatically and they are looking good this time.

What I think happened is that the upload got interrupted half-way. I have deleted a few more photos which were JPEGs and whose thumbnail showed a gray bar at the bottom, which clearly indicated. a partial file (unlike HEIF, JPEG photos will render even if partial).

@ItalyPaleAle commented on GitHub (Oct 18, 2023): @jrasm91 looks like the photos got re-uploaded automatically and they are looking good this time. What I think happened is that the upload got interrupted half-way. I have deleted a few more photos which were JPEGs and whose thumbnail showed a gray bar at the bottom, which clearly indicated. a partial file (unlike HEIF, JPEG photos will render even if partial).
Author
Owner

@jrasm91 commented on GitHub (May 13, 2024):

Seems to not be an issue anymore.

@jrasm91 commented on GitHub (May 13, 2024): Seems to not be an issue anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1479