[Bug] iOS app hangs on uploading assessts #8184

Closed
opened 2026-02-05 13:34:56 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @leolbyy on GitHub (Jan 3, 2026).

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

  • Yes

The bug

I have around 10k assessts and immich first upload smoothly, but then it stops uploading forever. (See screenshots.)

Image

I tried manually locate the assessts that are not uploading, and clicked the upload button for each assessts. Some can upload (shows 1 queued for upload and then successfully uploaded), and some don't have any reaction.

From server side log, there are many "query failed" message

Query failed : {
  durationMs: 3.210592999123037,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\x1012ffd1394209b4250d9d689a0ef1ace36594a9) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7390f317-78ad-4a14-aa52-d470408398ca',
    null,
    <Buffer 10 12 ff d1 39 42 09 b4 25 0d 9d 68 9a 0e f1 ac e3 65 94 a9>,
    '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/f9/00/f900c364-b273-4234-8af6-bf12cc1e670e.HEIC',
    'F960F178-3CD9-4302-AD8A-0D4EE4A4D50A/L0/001',
    '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1',
    2024-01-03T22:08:47.000Z,
    2024-01-17T10:09:38.000Z,
    2024-01-03T22:08:47.000Z,
    'IMAGE',
    false,
    '0',
    'timeline',
    'IMG_1319.HEIC'
  ]
}
Query failed : {
  durationMs: 4.920692999847233,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\x1012ffd1394209b4250d9d689a0ef1ace36594a9) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7390f317-78ad-4a14-aa52-d470408398ca',
    null,
    <Buffer 10 12 ff d1 39 42 09 b4 25 0d 9d 68 9a 0e f1 ac e3 65 94 a9>,
    '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/e2/49/e249f7b2-5d18-4b9c-8fc4-26ea6d7ba98c.HEIC',
    'F960F178-3CD9-4302-AD8A-0D4EE4A4D50A/L0/001',
    '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1',
    2024-01-03T22:08:47.000Z,
    2024-01-17T10:09:38.000Z,
    2024-01-03T22:08:47.000Z,
    'IMAGE',
    false,
    '0',
    'timeline',
    'IMG_1319.HEIC'
  ]
}
[Nest] 6  - 01/04/2026, 12:59:22 AM     LOG [Microservices:MediaService] Transcoding video 0def377d-3ae5-49dd-ab5f-0e8711ddfa4f with QSV-accelerated encoding and decoding
[Nest] 6  - 01/04/2026, 12:59:23 AM     LOG [Microservices:MediaService] Successfully encoded 0def377d-3ae5-49dd-ab5f-0e8711ddfa4f
Query failed : {
  durationMs: 6.335740000009537,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\xca5fcae87aebca3d7c8a5a6491b15a0a3259f0e5) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7390f317-78ad-4a14-aa52-d470408398ca',
    null,
    <Buffer ca 5f ca e8 7a eb ca 3d 7c 8a 5a 64 91 b1 5a 0a 32 59 f0 e5>,
    '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/09/90/09900b7b-969a-4484-bfcf-eb45047c89d2.MOV',
    '80CD216A-BBCB-48F4-B856-15FAFCBFC8E1/L0/001',
    '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1',
    2024-01-04T11:38:16.000Z,
    2024-01-10T02:02:54.000Z,
    2024-01-04T11:38:16.000Z,
    'VIDEO',
    false,
    '0',
    'timeline',
    'IMG_1337.MOV'
  ]
}
Query failed : {
  durationMs: 2.456411000341177,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\xca5fcae87aebca3d7c8a5a6491b15a0a3259f0e5) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7390f317-78ad-4a14-aa52-d470408398ca',
    null,
    <Buffer ca 5f ca e8 7a eb ca 3d 7c 8a 5a 64 91 b1 5a 0a 32 59 f0 e5>,
    '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/78/ee/78eedb45-d16d-4b89-a46c-4b4de3eece9b.MOV',
    '80CD216A-BBCB-48F4-B856-15FAFCBFC8E1/L0/001',
    '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1',
    2024-01-04T11:38:16.000Z,
    2024-01-10T02:02:54.000Z,
    2024-01-04T11:38:16.000Z,
    'VIDEO',
    false,
    '0',
    'timeline',
    'IMG_1337.MOV'
  ]
}
[Nest] 6  - 01/04/2026, 12:59:25 AM     LOG [Microservices:MediaService] Transcoding video e3001bac-3f0a-4698-9f3e-ccf41ab912c8 with QSV-accelerated encoding and decoding
[Nest] 6  - 01/04/2026, 12:59:25 AM     LOG [Microservices:MediaService] Successfully encoded e3001bac-3f0a-4698-9f3e-ccf41ab912c8
[Nest] 6  - 01/04/2026, 12:59:26 AM     LOG [Microservices:PersonService] Detected 4 new faces in asset 0def377d-3ae5-49dd-ab5f-0e8711ddfa4f
Query failed : {
  durationMs: 3.512150000780821,
  error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26)
      at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6)
      at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9)
      at Socket.emit (node:events:518:28)
      at addChunk (node:internal/streams/readable:561:12)
      at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
      at Readable.push (node:internal/streams/readable:392:5)
      at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {
    severity_local: 'ERROR',
    severity: 'ERROR',
    code: '23505',
    detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\xca5fcae87aebca3d7c8a5a6491b15a0a3259f0e5) already exists.',
    schema_name: 'public',
    table_name: 'asset',
    constraint_name: 'UQ_assets_owner_checksum',
    file: 'nbtinsert.c',
    line: '663',
    routine: '_bt_check_unique'
  },
  sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *',
  params: [
    '7390f317-78ad-4a14-aa52-d470408398ca',
    null,
    <Buffer ca 5f ca e8 7a eb ca 3d 7c 8a 5a 64 91 b1 5a 0a 32 59 f0 e5>,
    '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/82/b1/82b17de8-bec5-4368-ad41-df354c3beb9c.MOV',
    '80CD216A-BBCB-48F4-B856-15FAFCBFC8E1/L0/001',
    '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1',
    2024-01-04T11:38:16.000Z,
    2024-01-10T02:02:54.000Z,
    2024-01-04T11:38:16.000Z,
    'VIDEO',
    false,
    '0',
    'timeline',
    'IMG_1337.MOV'
  ]
}

I have shared albums selected, but shared albums only contains ~1.3K assessts, way less than the hanging 4k+ assesst.

Mobile Log:

Immich_log_2026-01-04T01:03:38.112609.log

The OS that Immich Server is running on

Debian 12

Version of Immich Server

2.4.1

Version of Immich Mobile App

2.4.1 build.239

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

iPhone 15 Pro - iOS 18.7.1

Your docker-compose.yml content

#
# WARNING: To install Immich, follow our guide: https://docs.immich.app/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.transcoding.yml
      service: quicksync # 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}-openvino
    extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration
      file: hwaccel.ml.yml
      service: openvino # 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:9@sha256:fb8d272e529ea567b9bf1302245796f21a2672b8368ca3fcb938ac334e613c8f
    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:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
    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

# You can find documentation for all the supported env variables at https://docs.immich.app/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/xxx/Library

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
TZ=Asia/Singapore

# The Immich version to use. You can pin this to a specific version like "v2.1.0"
IMMICH_VERSION=v2

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=xxx

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

Just waiting for backup

Relevant log output

Mobile Log above

Additional information

No response

Originally created by @leolbyy on GitHub (Jan 3, 2026). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug I have around 10k assessts and immich first upload smoothly, but then it stops uploading forever. (See screenshots.) ![Image](https://github.com/user-attachments/assets/b88aa597-2ba2-4f90-9fad-57b26f9eedfe) I tried manually locate the assessts that are not uploading, and clicked the upload button for each assessts. Some can upload (shows 1 queued for upload and then successfully uploaded), and some don't have any reaction. From server side log, there are many "query failed" message ``` Query failed : { durationMs: 3.210592999123037, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\x1012ffd1394209b4250d9d689a0ef1ace36594a9) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '7390f317-78ad-4a14-aa52-d470408398ca', null, <Buffer 10 12 ff d1 39 42 09 b4 25 0d 9d 68 9a 0e f1 ac e3 65 94 a9>, '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/f9/00/f900c364-b273-4234-8af6-bf12cc1e670e.HEIC', 'F960F178-3CD9-4302-AD8A-0D4EE4A4D50A/L0/001', '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1', 2024-01-03T22:08:47.000Z, 2024-01-17T10:09:38.000Z, 2024-01-03T22:08:47.000Z, 'IMAGE', false, '0', 'timeline', 'IMG_1319.HEIC' ] } Query failed : { durationMs: 4.920692999847233, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\x1012ffd1394209b4250d9d689a0ef1ace36594a9) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '7390f317-78ad-4a14-aa52-d470408398ca', null, <Buffer 10 12 ff d1 39 42 09 b4 25 0d 9d 68 9a 0e f1 ac e3 65 94 a9>, '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/e2/49/e249f7b2-5d18-4b9c-8fc4-26ea6d7ba98c.HEIC', 'F960F178-3CD9-4302-AD8A-0D4EE4A4D50A/L0/001', '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1', 2024-01-03T22:08:47.000Z, 2024-01-17T10:09:38.000Z, 2024-01-03T22:08:47.000Z, 'IMAGE', false, '0', 'timeline', 'IMG_1319.HEIC' ] } [Nest] 6 - 01/04/2026, 12:59:22 AM LOG [Microservices:MediaService] Transcoding video 0def377d-3ae5-49dd-ab5f-0e8711ddfa4f with QSV-accelerated encoding and decoding [Nest] 6 - 01/04/2026, 12:59:23 AM LOG [Microservices:MediaService] Successfully encoded 0def377d-3ae5-49dd-ab5f-0e8711ddfa4f Query failed : { durationMs: 6.335740000009537, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\xca5fcae87aebca3d7c8a5a6491b15a0a3259f0e5) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '7390f317-78ad-4a14-aa52-d470408398ca', null, <Buffer ca 5f ca e8 7a eb ca 3d 7c 8a 5a 64 91 b1 5a 0a 32 59 f0 e5>, '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/09/90/09900b7b-969a-4484-bfcf-eb45047c89d2.MOV', '80CD216A-BBCB-48F4-B856-15FAFCBFC8E1/L0/001', '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1', 2024-01-04T11:38:16.000Z, 2024-01-10T02:02:54.000Z, 2024-01-04T11:38:16.000Z, 'VIDEO', false, '0', 'timeline', 'IMG_1337.MOV' ] } Query failed : { durationMs: 2.456411000341177, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\xca5fcae87aebca3d7c8a5a6491b15a0a3259f0e5) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '7390f317-78ad-4a14-aa52-d470408398ca', null, <Buffer ca 5f ca e8 7a eb ca 3d 7c 8a 5a 64 91 b1 5a 0a 32 59 f0 e5>, '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/78/ee/78eedb45-d16d-4b89-a46c-4b4de3eece9b.MOV', '80CD216A-BBCB-48F4-B856-15FAFCBFC8E1/L0/001', '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1', 2024-01-04T11:38:16.000Z, 2024-01-10T02:02:54.000Z, 2024-01-04T11:38:16.000Z, 'VIDEO', false, '0', 'timeline', 'IMG_1337.MOV' ] } [Nest] 6 - 01/04/2026, 12:59:25 AM LOG [Microservices:MediaService] Transcoding video e3001bac-3f0a-4698-9f3e-ccf41ab912c8 with QSV-accelerated encoding and decoding [Nest] 6 - 01/04/2026, 12:59:25 AM LOG [Microservices:MediaService] Successfully encoded e3001bac-3f0a-4698-9f3e-ccf41ab912c8 [Nest] 6 - 01/04/2026, 12:59:26 AM LOG [Microservices:PersonService] Detected 4 new faces in asset 0def377d-3ae5-49dd-ab5f-0e8711ddfa4f Query failed : { durationMs: 3.512150000780821, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:794:26) at handle (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:480:6) at Socket.data (/usr/src/app/server/node_modules/.pnpm/postgres@3.4.7/node_modules/postgres/cjs/src/connection.js:315:9) at Socket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5) at TCP.onStreamRead (node:internal/stream_base_commons:189:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(7390f317-78ad-4a14-aa52-d470408398ca, \\xca5fcae87aebca3d7c8a5a6491b15a0a3259f0e5) already exists.', schema_name: 'public', table_name: 'asset', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "asset" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "duration", "visibility", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) returning *', params: [ '7390f317-78ad-4a14-aa52-d470408398ca', null, <Buffer ca 5f ca e8 7a eb ca 3d 7c 8a 5a 64 91 b1 5a 0a 32 59 f0 e5>, '/data/upload/7390f317-78ad-4a14-aa52-d470408398ca/82/b1/82b17de8-bec5-4368-ad41-df354c3beb9c.MOV', '80CD216A-BBCB-48F4-B856-15FAFCBFC8E1/L0/001', '6a5458f8482704b0601e2efb787b3409689485424a32e242e2c806428cb809e1', 2024-01-04T11:38:16.000Z, 2024-01-10T02:02:54.000Z, 2024-01-04T11:38:16.000Z, 'VIDEO', false, '0', 'timeline', 'IMG_1337.MOV' ] } ``` I have shared albums selected, but shared albums only contains ~1.3K assessts, way less than the hanging 4k+ assesst. Mobile Log: [Immich_log_2026-01-04T01:03:38.112609.log](https://github.com/user-attachments/files/24416865/Immich_log_2026-01-04T01.03.38.112609.log) ### The OS that Immich Server is running on Debian 12 ### Version of Immich Server 2.4.1 ### Version of Immich Mobile App 2.4.1 build.239 ### Platform with the issue - [x] Server - [ ] Web - [x] Mobile ### Device make and model iPhone 15 Pro - iOS 18.7.1 ### Your docker-compose.yml content ```YAML # # WARNING: To install Immich, follow our guide: https://docs.immich.app/install/docker-compose # # Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: file: hwaccel.transcoding.yml service: quicksync # 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}-openvino extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration file: hwaccel.ml.yml service: openvino # 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:9@sha256:fb8d272e529ea567b9bf1302245796f21a2672b8368ca3fcb938ac334e613c8f 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:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23 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 ```Shell # You can find documentation for all the supported env variables at https://docs.immich.app/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/xxx/Library # The location where your database files are stored. Network shares are not supported for the database DB_DATA_LOCATION=./postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List TZ=Asia/Singapore # The Immich version to use. You can pin this to a specific version like "v2.1.0" IMMICH_VERSION=v2 # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=xxx # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps Just waiting for backup ### Relevant log output ```shell Mobile Log above ``` ### Additional information _No response_
Author
Owner

@bo0tzz commented on GitHub (Jan 3, 2026):

How are you connected to your server?

error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum"

These are irrelevant; it just means there was an attempt to upload a file that already exists.

From the mobile log:

Error getting file for asset 5A480CA2-07F4-45CA-9EB4-B8F19E0C249B/L0/001 | PlatformException(PHPhotosErrorDomain (-1), The operation couldn’t be completed. (PHPhotosErrorDomain error -1.), No failure reason provided, null)

Seems like there might be something wrong with the files on your phone?

@bo0tzz commented on GitHub (Jan 3, 2026): How are you connected to your server? > error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" These are irrelevant; it just means there was an attempt to upload a file that already exists. From the mobile log: > Error getting file for asset 5A480CA2-07F4-45CA-9EB4-B8F19E0C249B/L0/001 | PlatformException(PHPhotosErrorDomain (-1), The operation couldn’t be completed. (PHPhotosErrorDomain error -1.), No failure reason provided, null) Seems like there might be something wrong with the files on your phone?
Author
Owner

@leolbyy commented on GitHub (Jan 3, 2026):

How are you connected to your server?

I'm connected via local lan http://mynas:2283

From the mobile log:
Seems like there might be something wrong with the files on your phone?

I'm not sure how to debug the "file issue". I can view all photos and videos both on immich app and native photo app

@leolbyy commented on GitHub (Jan 3, 2026): > How are you connected to your server? I'm connected via local lan `http://mynas:2283` > From the mobile log: > Seems like there might be something wrong with the files on your phone? I'm not sure how to debug the "file issue". I can view all photos and videos both on immich app and native photo app
Author
Owner

@Patten310 commented on GitHub (Jan 3, 2026):

I have the same problem.
With android

@Patten310 commented on GitHub (Jan 3, 2026): I have the same problem. With android
Author
Owner

@alextran1502 commented on GitHub (Jan 3, 2026):

Is your entire library on iCloud?

@alextran1502 commented on GitHub (Jan 3, 2026): Is your entire library on iCloud?
Author
Owner

@leolbyy commented on GitHub (Jan 4, 2026):

Is your entire library on iCloud?

Yes. But i have keep originals on iPhone enabled, so all photos and videos are available offline.
I can see all the remaining assesses are queueing for backup. And in details there are assesses waiting for upload.

Image

I located these photos / videos and they are all stored locally on my phone.

@leolbyy commented on GitHub (Jan 4, 2026): > Is your entire library on iCloud? Yes. But i have keep originals on iPhone enabled, so all photos and videos are available offline. I can see all the remaining assesses are queueing for backup. And in details there are assesses waiting for upload. ![Image](https://github.com/user-attachments/assets/923145cb-f1f0-4101-9e7a-66bc91c41899) I located these photos / videos and they are all stored locally on my phone.
Author
Owner

@hugocowan commented on GitHub (Jan 4, 2026):

I had a similar problem but with a different error, for me it turned out to be that I had selected shared albums (to be clear, the native iOS feature) from other people for backup.

Removing those shared iOS albums from the backup list and clearing the file cache/restarting the backup solved the upload stall for me.

@hugocowan commented on GitHub (Jan 4, 2026): I had a similar problem but with a different error, for me it turned out to be that I had selected shared albums (to be clear, the native iOS feature) from other people for backup. Removing those shared iOS albums from the backup list and clearing the file cache/restarting the backup solved the upload stall for me.
Author
Owner

@niektenhoopen commented on GitHub (Jan 4, 2026):

Does it work when you disable the new timeline? I had the same issue and saw this recommendation in #22850

@niektenhoopen commented on GitHub (Jan 4, 2026): Does it work when you disable the new timeline? I had the same issue and saw this recommendation in #22850
Author
Owner

@leolbyy commented on GitHub (Jan 5, 2026):

Does it work when you disable the new timeline? I had the same issue and saw this recommendation in #22850

I have seen this suggestion multiple time in different issues but still don't know what this stands for...

But I have managed to upload my whole library (including shared albums) to immich server. It's very strange that every time i quit the app from os level, and re-open it, it will upload a few dozen to a few hundred assets. By doing so again and again, the whole library is uploaded.

Very strange...

@leolbyy commented on GitHub (Jan 5, 2026): > Does it work when you disable the new timeline? I had the same issue and saw this recommendation in [#22850](https://github.com/immich-app/immich/issues/22850) I have seen this suggestion multiple time in different issues but still don't know what this stands for... But I have managed to upload my whole library (including shared albums) to immich server. It's very strange that every time i quit the app from os level, and re-open it, it will upload a few dozen to a few hundred assets. By doing so again and again, the whole library is uploaded. Very strange...
Author
Owner

@niektenhoopen commented on GitHub (Jan 5, 2026):

@leolbyy The new timeline? Click on user (top right), Settings, Advanced, scroll to bottom: New timeline

@niektenhoopen commented on GitHub (Jan 5, 2026): @leolbyy The new timeline? Click on user (top right), Settings, Advanced, scroll to bottom: New timeline
Author
Owner

@zoranf commented on GitHub (Jan 8, 2026):

I have similar issue but on android, managed to backup 25 images form 20000 on the phone, now it just does nothing 🫨

@zoranf commented on GitHub (Jan 8, 2026): I have similar issue but on android, managed to backup 25 images form 20000 on the phone, now it just does nothing 🫨
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#8184