Backup from IOS is hanging on certain images/videos #5283

Closed
opened 2026-02-05 11:18:24 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @jaytrickett1 on GitHub (Jan 30, 2025).

The bug

Certain photos and videos are failing to backup, hanging on upload. Logs are below. I tried manually deleting the relevant rows from Postgres but that did not solve.

The OS that Immich Server is running on

Docker on Ubuntu 22.04

Version of Immich Server

v1.125.7

Version of Immich Mobile App

v1.125.7

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

immich:
    image: ghcr.io/imagegenius/immich:latest
    container_name: immich
    networks:
      traefik_proxy:
        ipv4_address: 192.168.5.38
      #default:
    environment:
      PUID: $PUID
      PGID: $PGID
      TZ: $TZ
      DB_HOSTNAME: postgres14
      DB_USERNAME: postgres
      DB_PASSWORD: postgres
      DB_DATABASE_NAME: immich
      #DOCKER_MODS: imagegenius/mods:universal-redis
      REDIS_HOSTNAME: redis
      DB_PORT: 5432 #optional
      REDIS_PORT: 6379 #optional
      #REDIS_PASSWORD= #optional
      MACHINE_LEARNING_WORKERS: 1 #optional
      MACHINE_LEARNING_WORKER_TIMEOUT: 120 #optional
    volumes:
      - $DOCKERDIR/appdata/immich:/config
      - $DOCKERDIR/media/immich:/photos
      - $PHOTOSDIR:/import
      - $DOCKERDIR/appdata/immich/machine-learning:/config/machine-learning #optional
      #- $DOCKERDIR/appdata/immich/import:/import:ro #optional
    #ports:
      #- 8080:8080
    labels:
      - "traefik.enable=true"
      ## HTTP Routers
      - "traefik.http.routers.immich-rtr.tls=true"
      - "traefik.http.routers.immich-rtr.entrypoints=https"
      - "traefik.http.routers.immich-rtr.rule=Host(`immich.$DOMAINNAME_CLOUD_SERVER`)"
      ## HTTP Services
      - "traefik.http.routers.immich-rtr.service=immich-svc"
      - "traefik.http.services.immich-svc.loadbalancer.server.port=8080"
    restart: unless-stopped
  # This container requires an external application to be run separately.
  # Redis:
  redis:
    image: redis
    networks:
      traefik_proxy:
    ports:
      - 6379:6379
    container_name: redis
  # PostgreSQL 14:
  postgres14:
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    networks:
      traefik_proxy:
    ports:
      - 5432:5432
    container_name: postgres14
    environment:
      PUID: $PUID
      PGID: $PGID
      TZ: $TZ
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: immich
    volumes:
      - $DOCKERDIR/databases/postgres14:/var/lib/postgresql/data

Your .env content

NA

Reproduction steps

  1. Open IOS app
  2. Click Start Backup

...

Relevant log output

Query failed : {

  durationMs: 8.11965800030157,

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

      at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:788:26)

      at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:474:6)

      at Socket.data (/app/immich/server/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:191:23)

      at TCP.callbackTrampoline (node:internal/async_hooks:130:17) {

    severity_local: 'ERROR',

    severity: 'ERROR',

    code: '23505',

    detail: 'Key ("ownerId", checksum)=(e2eeaac1-417e-464a-978d-f94ca9a677e1, \\x67a95ded48306813869a4eec796602473d6a08cf) already exists.',

    schema_name: 'public',

    table_name: 'assets',

    constraint_name: 'UQ_assets_owner_checksum',

    file: 'nbtinsert.c',

    line: '663',

    routine: '_bt_check_unique'

  },

  sql: 'insert into "assets" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "isArchived", "duration", "isVisible", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) returning *',

  params: [

    'e2eeaac1-417e-464a-978d-f94ca9a677e1',



,

    <Buffer 67 a9 5d ed 48 30 68 13 86 9a 4e ec 79 66 02 47 3d 6a 08 cf>,

    '/photos/upload/e2eeaac1-417e-464a-978d-f94ca9a677e1/55/07/55072965-23fa-494e-aa04-6ec2b653e27d.MOV',

    '5B36F956-4422-4487-8D9B-07C8D48A1E80/L0/001',

    '6a8cf465fc8b1fdc27de504f067aeb5e957dbc380302e04574f5533fc6929718',

    2025-01-28T17:51:05.000Z,

    2025-01-29T03:25:10.000Z,

    2025-01-28T17:51:05.000Z,


    'VIDEO',

    false,

    false,

    '0:00:00.000000',



,

    'IMG_4987.MOV'

  ]

}

Additional information

No response

Originally created by @jaytrickett1 on GitHub (Jan 30, 2025). ### The bug Certain photos and videos are failing to backup, hanging on upload. Logs are below. I tried manually deleting the relevant rows from Postgres but that did not solve. ### The OS that Immich Server is running on Docker on Ubuntu 22.04 ### Version of Immich Server v1.125.7 ### Version of Immich Mobile App v1.125.7 ### Platform with the issue - [ ] Server - [ ] Web - [x] Mobile ### Your docker-compose.yml content ```YAML immich: image: ghcr.io/imagegenius/immich:latest container_name: immich networks: traefik_proxy: ipv4_address: 192.168.5.38 #default: environment: PUID: $PUID PGID: $PGID TZ: $TZ DB_HOSTNAME: postgres14 DB_USERNAME: postgres DB_PASSWORD: postgres DB_DATABASE_NAME: immich #DOCKER_MODS: imagegenius/mods:universal-redis REDIS_HOSTNAME: redis DB_PORT: 5432 #optional REDIS_PORT: 6379 #optional #REDIS_PASSWORD= #optional MACHINE_LEARNING_WORKERS: 1 #optional MACHINE_LEARNING_WORKER_TIMEOUT: 120 #optional volumes: - $DOCKERDIR/appdata/immich:/config - $DOCKERDIR/media/immich:/photos - $PHOTOSDIR:/import - $DOCKERDIR/appdata/immich/machine-learning:/config/machine-learning #optional #- $DOCKERDIR/appdata/immich/import:/import:ro #optional #ports: #- 8080:8080 labels: - "traefik.enable=true" ## HTTP Routers - "traefik.http.routers.immich-rtr.tls=true" - "traefik.http.routers.immich-rtr.entrypoints=https" - "traefik.http.routers.immich-rtr.rule=Host(`immich.$DOMAINNAME_CLOUD_SERVER`)" ## HTTP Services - "traefik.http.routers.immich-rtr.service=immich-svc" - "traefik.http.services.immich-svc.loadbalancer.server.port=8080" restart: unless-stopped # This container requires an external application to be run separately. # Redis: redis: image: redis networks: traefik_proxy: ports: - 6379:6379 container_name: redis # PostgreSQL 14: postgres14: image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 networks: traefik_proxy: ports: - 5432:5432 container_name: postgres14 environment: PUID: $PUID PGID: $PGID TZ: $TZ POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: immich volumes: - $DOCKERDIR/databases/postgres14:/var/lib/postgresql/data ``` ### Your .env content ```Shell NA ``` ### Reproduction steps 1. Open IOS app 2. Click Start Backup 3. ... ### Relevant log output ```shell Query failed : { durationMs: 8.11965800030157, error: PostgresError: duplicate key value violates unique constraint "UQ_assets_owner_checksum" at ErrorResponse (/app/immich/server/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/app/immich/server/node_modules/postgres/cjs/src/connection.js:474:6) at Socket.data (/app/immich/server/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:191:23) at TCP.callbackTrampoline (node:internal/async_hooks:130:17) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key ("ownerId", checksum)=(e2eeaac1-417e-464a-978d-f94ca9a677e1, \\x67a95ded48306813869a4eec796602473d6a08cf) already exists.', schema_name: 'public', table_name: 'assets', constraint_name: 'UQ_assets_owner_checksum', file: 'nbtinsert.c', line: '663', routine: '_bt_check_unique' }, sql: 'insert into "assets" ("ownerId", "libraryId", "checksum", "originalPath", "deviceAssetId", "deviceId", "fileCreatedAt", "fileModifiedAt", "localDateTime", "type", "isFavorite", "isArchived", "duration", "isVisible", "originalFileName") values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) returning *', params: [ 'e2eeaac1-417e-464a-978d-f94ca9a677e1',  , <Buffer 67 a9 5d ed 48 30 68 13 86 9a 4e ec 79 66 02 47 3d 6a 08 cf>, '/photos/upload/e2eeaac1-417e-464a-978d-f94ca9a677e1/55/07/55072965-23fa-494e-aa04-6ec2b653e27d.MOV', '5B36F956-4422-4487-8D9B-07C8D48A1E80/L0/001', '6a8cf465fc8b1fdc27de504f067aeb5e957dbc380302e04574f5533fc6929718', 2025-01-28T17:51:05.000Z, 2025-01-29T03:25:10.000Z, 2025-01-28T17:51:05.000Z,  'VIDEO', false, false, '0:00:00.000000',  , 'IMG_4987.MOV' ] } ``` ### Additional information _No response_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#5283