[BUG] Android app tries to backup already uploaded photos in a loop. #264

Closed
opened 2026-02-04 19:12:09 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @glebkrep on GitHub (Sep 7, 2022).

Describe the bug
Android app tries too backup already uploaded photos in a loop.

Every time I open backup fragment in Android app it starts to 'backup' photos that it already tried to backup. These photos actually upload to server but it rejects them as duplicates (which is true, since they are already uploaded).

immich_postgres

2022-09-07 18:53:25.754 UTC [3745] ERROR:  duplicate key value violates unique constraint "UQ_userid_checksum"
2022-09-07 18:53:25.754 UTC [3745] DETAIL:  Key ("userId", checksum)=(REDACTED, \REDACTED) already exists.
2022-09-07 18:53:25.754 UTC [3745] STATEMENT:  INSERT INTO "assets"("id", "deviceAssetId", "userId", "deviceId", "type", "originalPath", "resizePath", "webpPath", "encodedVideoPath", "createdAt", "modifiedAt", "isFavorite", "mimeType", "checksum", "duration") VALUES (DEFAULT, $1, $2, $3, $4, $5, DEFAULT, DEFAULT, DEFAULT, $6, $7, $8, $9, $10, $11) RETURNING "id", "webpPath", "encodedVideoPath", "isFavorite"

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

To Reproduce
Steps to reproduce the behavior:

  1. Log in with Android Application
  2. Upload photos that exist on Android device with Immich-CLI
  3. Enable Backup on Android
  4. Wait for Android to upload all the photos that are already uploaded
  5. Close Android app
  6. Open Android app again and see that backup starts again

Expected behavior
Images hashes are checked on Android before uploading and/or Android application marks images that were already uploaded.

Screenshots

System

  • Phone OS [iOS, Android]: Android 12.
  • Server Version: v1.27.0
  • Mobile App Version: 1.27.0 37

Additional context

docker-compose.txt

Originally created by @glebkrep on GitHub (Sep 7, 2022). **Describe the bug** Android app tries too backup already uploaded photos in a loop. Every time I open backup fragment in Android app it starts to 'backup' photos that it already tried to backup. These photos actually upload to server but it rejects them as duplicates (which is true, since they are already uploaded). _immich_postgres_ ``` 2022-09-07 18:53:25.754 UTC [3745] ERROR: duplicate key value violates unique constraint "UQ_userid_checksum" 2022-09-07 18:53:25.754 UTC [3745] DETAIL: Key ("userId", checksum)=(REDACTED, \REDACTED) already exists. 2022-09-07 18:53:25.754 UTC [3745] STATEMENT: INSERT INTO "assets"("id", "deviceAssetId", "userId", "deviceId", "type", "originalPath", "resizePath", "webpPath", "encodedVideoPath", "createdAt", "modifiedAt", "isFavorite", "mimeType", "checksum", "duration") VALUES (DEFAULT, $1, $2, $3, $4, $5, DEFAULT, DEFAULT, DEFAULT, $6, $7, $8, $9, $10, $11) RETURNING "id", "webpPath", "encodedVideoPath", "isFavorite" ``` **Task List** *Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.* - [x] I have read thoroughly the README setup and installation instructions. - [x] I have included my `docker-compose` file. - [ ] I have included my redacted `.env` file. - [x] I have included information on my machine, and environment. **To Reproduce** Steps to reproduce the behavior: 1. Log in with Android Application 2. Upload photos that exist on Android device with [Immich-CLI](https://github.com/immich-app/CLI) 3. Enable Backup on Android 4. Wait for Android to upload all the photos that are already uploaded 5. Close Android app 6. Open Android app again and see that backup starts again **Expected behavior** Images hashes are checked on Android before uploading and/or Android application marks images that were already uploaded. **Screenshots** - **System** - Phone OS [iOS, Android]: Android 12. - Server Version: v1.27.0 - Mobile App Version: 1.27.0 37 **Additional context** - [docker-compose.txt](https://github.com/immich-app/immich/files/9508982/docker-compose.txt)
Author
Owner

@panoti commented on GitHub (Sep 7, 2022):

Hi @glebkrep, thank you for your report. I think your error come from our old duplicate identifier method on the mobile app. We have plan to fix it soon. Don't worry about immich_postgres logs because we've caught this error in our services.

@panoti commented on GitHub (Sep 7, 2022): Hi @glebkrep, thank you for your report. I think your error come from our old duplicate identifier method on the mobile app. We have plan to fix it soon. Don't worry about `immich_postgres` logs because we've caught this error in our services.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#264