Skip to content

Synchronization failure after upgrading the Server and iOS app from 2.0.1 to 2.1.0 #23035

Description

@hdeppert

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

  • Yes

The bug

After upgrading Immich from 2.0.1 to 2.1.0 via docker pull && docker compose up -d , the iOS app (also updated to 2.1.0) does not synchronize the photos anymore and shows two errors.

  1. Error in runInIsolateGentle for remote-sync
  2. Error: updateAssetsV1 - user

More details down below.

The OS that Immich Server is running on

QNAP Linux distro (TS-873) via docker compose

Version of Immich Server

2.1.0

Version of Immich Mobile App

2.1.0

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

iPhone 13 Pro

Your docker-compose.yml content

# mainly standard one

version: '3'
services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/data
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:8-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:41eacbe83eca995561fe43814fd4891e16e39632806253848efaf04d3c8a8b84
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
      # DB_STORAGE_TYPE: 'HDD'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always

volumes:
  model-cache:

Your .env content

Standard env, just custom PW

Reproduction steps

  1. Update Immich from 2.0.1 to 2.1.0 on the server via docker compose and upate the iOS app
  2. Start app and see the sync failure
  3. Check the errors in the logs

Relevant log output

1. Error #1
  - MESSAGE `Error in runIsolateGentle  for remote-sync`
  - FROM `IsolateLogger`
  - DETAILS

SqliteException(2067): while executing statement, UNIQUE constraint failed: remote_asset_entity.owner_id, remote_asset_entity.checksum, constraint failed (code 2067)
  Causing statement: INSERT INTO "remote_asset_entity" ("name", "type", "created_at", "updated_at", "duration_in_seconds", "id", "checksum", "is_favorite", "owner_id", "local_date_time", "thumb_hash", "deleted_at", "live_photo_video_id", "visibility", "stack_id", "library_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT("id") DO UPDATE SET "name" = ?, "type" = ?, "created_at" = ?, "updated_at" = ?, "duration_in_seconds" = ?, "checksum" = ?, "is_favorite" = ?, "owner_id" = ?, "local_date_time" = ?, "thumb_hash" = ?, "deleted_at" = ?, "live_photo_video_id" = ?, "visibility" = ?, "stack_id" = ?, "library_id" = ?, parameters: IMG_1278.HEIC, 1, 2023-10-14T19:49:09.435Z, 2024-12-26T10:35:48.000Z, 0, f36c41c6-506c-45bd-8d7a-4c7fa42fc3c1, RYtJZzi7BdcmzlwZhp/+PdSDxBM=, 0, 6f050171-161e-4c3f-b5b0-6ca80b6f4ffa, 2023-10-14T21:49:09.435Z, null, 2025-10-15T04:09:47.783Z, null, 0, null, null, IMG_1278.HEIC, 1, 2023-10-14T19:49:09.435Z, 2024-12-26T10:35:48.000Z, 0, RYtJZzi7BdcmzlwZhp/+PdSDxBM=, 0, 6f050171-161e-4c3f-b5b0-6ca80b6f4ffa, 2023-10-14T21:49:09.435Z, null, 2025-10-15T04:09:47.783Z, null, 0, null, null

  - STACK TRACE

package:sqlite3/src/implementation/exception.dart 87                               throwException
package:sqlite3/src/implementation/statement.dart 109                              StatementImplementation._execute
package:sqlite3/src/implementation/statement.dart 289                              StatementImplementation.executeWith
package:sqlite3/src/statement.dart 81                                              CommonPreparedStatement.execute
package:drift/src/sqlite3/database.dart 131                                        Sqlite3Delegate.runBatchSync
package:drift/native.dart 373                                                      _NativeDelegate.runBatched.<fn>
dart:async/future.dart 315                                                         new Future.sync
package:drift/native.dart 373                                                      _NativeDelegate.runBatched
package:drift/src/runtime/executor/helpers/engines.dart 128                        _BaseExecutor.runBatched.<fn>
package:drift/src/runtime/executor/helpers/engines.dart 62                         _BaseExecutor._synchronized
package:drift/src/runtime/executor/helpers/engines.dart 122                        _BaseExecutor.runBatched
package:drift/src/remote/server_impl.dart 170                                      ServerImplementation._runBatched
package:drift/src/remote/communication.dart 165                                    DriftCommunication.setRequestHandler.<fn>
===== asynchronous gap ===========================
package:drift/src/remote/communication.dart 113                                    DriftCommunication.request
package:drift/src/remote/client_impl.dart 84                                       _BaseExecutor.runBatched
package:drift/src/runtime/api/batch.dart 215                                       Batch._runWith
package:drift/src/runtime/api/batch.dart 199                                       Batch._commit
package:immich_mobile/infrastructure/repositories/sync_stream.repository.dart 179  SyncStreamRepository.updateAssetsV1
package:immich_mobile/domain/services/sync_stream.service.dart 67                  SyncStreamService._processBatch
package:immich_mobile/domain/services/sync_stream.service.dart 58                  SyncStreamService._handleEvents
package:immich_mobile/infrastructure/repositories/sync_api.repository.dart 105     SyncApiRepository.streamChanges
package:immich_mobile/domain/services/sync_stream.service.dart 30                  SyncStreamService.sync
package:immich_mobile/utils/isolate.dart 57                                        runInIsolateGentle.<fn>.<fn>
package:immich_mobile/utils/isolate.dart 36                                        runInIsolateGentle.<fn>
package:worker_manager/src/worker/worker_io.dart 106                               WorkerImpl._anotherIsolate.<fn>

2. Error #2
  - MESSAGE `Error: updateAssetsV1 - user`
  - FROM `DriftSyncStreamRepository`
  - DETAILS

SqliteException(2067): while executing statement, UNIQUE constraint failed: remote_asset_entity.owner_id, remote_asset_entity.checksum, constraint failed (code 2067)
  Causing statement: INSERT INTO "remote_asset_entity" ("name", "type", "created_at", "updated_at", "duration_in_seconds", "id", "checksum", "is_favorite", "owner_id", "local_date_time", "thumb_hash", "deleted_at", "live_photo_video_id", "visibility", "stack_id", "library_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT("id") DO UPDATE SET "name" = ?, "type" = ?, "created_at" = ?, "updated_at" = ?, "duration_in_seconds" = ?, "checksum" = ?, "is_favorite" = ?, "owner_id" = ?, "local_date_time" = ?, "thumb_hash" = ?, "deleted_at" = ?, "live_photo_video_id" = ?, "visibility" = ?, "stack_id" = ?, "library_id" = ?, parameters: IMG_1278.HEIC, 1, 2023-10-14T19:49:09.435Z, 2024-12-26T10:35:48.000Z, 0, f36c41c6-506c-45bd-8d7a-4c7fa42fc3c1, RYtJZzi7BdcmzlwZhp/+PdSDxBM=, 0, 6f050171-161e-4c3f-b5b0-6ca80b6f4ffa, 2023-10-14T21:49:09.435Z, null, 2025-10-15T04:09:47.783Z, null, 0, null, null, IMG_1278.HEIC, 1, 2023-10-14T19:49:09.435Z, 2024-12-26T10:35:48.000Z, 0, RYtJZzi7BdcmzlwZhp/+PdSDxBM=, 0, 6f050171-161e-4c3f-b5b0-6ca80b6f4ffa, 2023-10-14T21:49:09.435Z, null, 2025-10-15T04:09:47.783Z, null, 0, null, null

  - STACK TRACE

package:sqlite3/src/implementation/exception.dart 87                               throwException
package:sqlite3/src/implementation/statement.dart 109                              StatementImplementation._execute
package:sqlite3/src/implementation/statement.dart 289                              StatementImplementation.executeWith
package:sqlite3/src/statement.dart 81                                              CommonPreparedStatement.execute
package:drift/src/sqlite3/database.dart 131                                        Sqlite3Delegate.runBatchSync
package:drift/native.dart 373                                                      _NativeDelegate.runBatched.<fn>
dart:async/future.dart 315                                                         new Future.sync
package:drift/native.dart 373                                                      _NativeDelegate.runBatched
package:drift/src/runtime/executor/helpers/engines.dart 128                        _BaseExecutor.runBatched.<fn>
package:drift/src/runtime/executor/helpers/engines.dart 62                         _BaseExecutor._synchronized
package:drift/src/runtime/executor/helpers/engines.dart 122                        _BaseExecutor.runBatched
package:drift/src/remote/server_impl.dart 170                                      ServerImplementation._runBatched
package:drift/src/remote/communication.dart 165                                    DriftCommunication.setRequestHandler.<fn>
===== asynchronous gap ===========================
package:drift/src/remote/communication.dart 113                                    DriftCommunication.request
package:drift/src/remote/client_impl.dart 84                                       _BaseExecutor.runBatched
package:drift/src/runtime/api/batch.dart 215                                       Batch._runWith
package:drift/src/runtime/api/batch.dart 199                                       Batch._commit
package:immich_mobile/infrastructure/repositories/sync_stream.repository.dart 179  SyncStreamRepository.updateAssetsV1
package:immich_mobile/domain/services/sync_stream.service.dart 67                  SyncStreamService._processBatch
package:immich_mobile/domain/services/sync_stream.service.dart 58                  SyncStreamService._handleEvents
package:immich_mobile/infrastructure/repositories/sync_api.repository.dart 105     SyncApiRepository.streamChanges
package:immich_mobile/domain/services/sync_stream.service.dart 30                  SyncStreamService.sync
package:immich_mobile/utils/isolate.dart 57                                        runInIsolateGentle.<fn>.<fn>
package:immich_mobile/utils/isolate.dart 36                                        runInIsolateGentle.<fn>
package:worker_manager/src/worker/worker_io.dart 106                               WorkerImpl._anotherIsolate.<fn>

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions