[BETA] Apps marks pictures as not synced, but the pictures shows in WEBUI #6742

Closed
opened 2026-02-05 12:30:30 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @radhoo2k10 on GitHub (Aug 4, 2025).

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

  • Yes

The bug

When syncing pictures the app marks some pictures as not synced, but they are shown in the webui.
Have to delete the pictures from Webui to fix the problem. This is not a good solution as two other people are also using the immich server that are none technical.

The OS that Immich Server is running on

ubuntu 24.04.1 server

Version of Immich Server

v1.137.3

Version of Immich Mobile App

v1.137.3

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: 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}
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    # 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}:/usr/src/app/upload
      - /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, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] 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/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8
    image: docker.io/valkey/valkey:8-bookworm@sha256:42cba146593a5ea9a622002c1b7cba5da7be248650cbb64ecb9c6c33d29794b1
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    #image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      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
    restart: always

volumes:
  model-cache:

Your .env content

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

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/immich/immich/
# The location where your database files are stored
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=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# 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=************************

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

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

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/immich/immich/
# The location where your database files are stored
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=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# 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=**********************

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

Reproduction steps

When syncing pictures the app marks some pictures as not synced, but the are shown in the webui.
Using the new BETA sync.

APP:

Image

WEBUI:

Image

Relevant log output

Query failed : {
  durationMs: 8.878951999999117,
  error: PostgresError: duplicate key value violates unique constraint "UQ_asset                                                                                                                                                                                                                                             s_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connec                                                                                                                                                                                                                                             tion.js:794:26)
      at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js                                                                                                                                                                                                                                             :480:6)
      at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connecti                                                                                                                                                                                                                                             on.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)=(5037d190-7ac6-43a3-8433-94bf0e95903b, \\                                                                                                                                                                                                                                             xa4f8ceddb8d6b8d4e7eeba0b37bf237f2b883d60) 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: [
    '5037d190-7ac6-43a3-8433-94bf0e95903b',
    null,
    <Buffer a4 f8 ce dd b8 d6 b8 d4 e7 ee ba 0b 37 bf 23 7f 2b 88 3d 60>,
    '/usr/src/app/upload/upload/5037d190-7ac6-43a3-8433-94bf0e95903b/9a/e9/9ae9f                                                                                                                                                                                                                                             ca5-086b-4a48-84fd-ec5f21f7cff0.jpg',
    '1000002961',
    'd72c6706e48988ee27e3f7f7e1aebf6fea0d23ee6b441fce6d52414f1b8826bd',
    2025-08-03T16:07:40.055Z,
    2025-08-03T16:07:39.999Z,
    2025-08-03T16:07:40.055Z,
    'IMAGE',
    false,
    '0',
    'timeline',
    '20250803_180739.jpg'
  ]
}
Query failed : {
  durationMs: 8.476731000002474,
  error: PostgresError: duplicate key value violates unique constraint "UQ_asset                                                                                                                                                                                                                                             s_owner_checksum"
      at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connec                                                                                                                                                                                                                                             tion.js:794:26)
      at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js                                                                                                                                                                                                                                             :480:6)
      at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connecti                                                                                                                                                                                                                                             on.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)=(5037d190-7ac6-43a3-8433-94bf0e95903b, \\                                                                                                                                                                                                                                             xc086081150c3e214232b62044fd2a0e1036713b5) 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: [
    '5037d190-7ac6-43a3-8433-94bf0e95903b',
    null,
    <Buffer c0 86 08 11 50 c3 e2 14 23 2b 62 04 4f d2 a0 e1 03 67 13 b5>,
    '/usr/src/app/upload/upload/5037d190-7ac6-43a3-8433-94bf0e95903b/1b/20/1b206                                                                                                                                                                                                                                             4d6-8611-4b7c-a224-09c9c3903915.jpg',
    '1000002960',
    'd72c6706e48988ee27e3f7f7e1aebf6fea0d23ee6b441fce6d52414f1b8826bd',
    2025-08-03T12:13:02.684Z,
    2025-08-03T12:13:02.604Z,
    2025-08-03T12:13:02.684Z,
    'IMAGE',
    false,
    '0',
    'timeline',
    '20250803_141301.jpg'
  ]
}

Additional information

No response

Originally created by @radhoo2k10 on GitHub (Aug 4, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [ ] Yes ### The bug When syncing pictures the app marks some pictures as not synced, but they are shown in the webui. Have to delete the pictures from Webui to fix the problem. This is not a good solution as two other people are also using the immich server that are none technical. ### The OS that Immich Server is running on ubuntu 24.04.1 server ### Version of Immich Server v1.137.3 ### Version of Immich Mobile App v1.137.3 ### Platform with the issue - [x] Server - [ ] Web - [x] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: 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} labels: - "com.centurylinklabs.watchtower.enable=false" # 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}:/usr/src/app/upload - /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, openvino] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} labels: - "com.centurylinklabs.watchtower.enable=false" # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] 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/redis:6.2-alpine@sha256:eaba718fecd1196d88533de7ba49bf903ad33664a92debb24660a922ecd9cac8 image: docker.io/valkey/valkey:8-bookworm@sha256:42cba146593a5ea9a622002c1b7cba5da7be248650cbb64ecb9c6c33d29794b1 labels: - "com.centurylinklabs.watchtower.enable=false" healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres #image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0 labels: - "com.centurylinklabs.watchtower.enable=false" environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' 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 restart: always volumes: model-cache: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/immich/immich/ # The location where your database files are stored 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=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # 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=************************ # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/immich/immich/ # The location where your database files are stored 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=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # 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=********************** # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps When syncing pictures the app marks some pictures as not synced, but the are shown in the webui. Using the new BETA sync. APP: <img width="1180" height="866" alt="Image" src="https://github.com/user-attachments/assets/d80b44f8-cd0d-42d8-936a-73a69cf92c68" /> WEBUI: <img width="715" height="314" alt="Image" src="https://github.com/user-attachments/assets/946305ad-5a11-42ca-af00-353334002471" /> ### Relevant log output ```shell Query failed : { durationMs: 8.878951999999117, error: PostgresError: duplicate key value violates unique constraint "UQ_asset s_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connec tion.js:794:26) at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js :480:6) at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connecti on.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)=(5037d190-7ac6-43a3-8433-94bf0e95903b, \\ xa4f8ceddb8d6b8d4e7eeba0b37bf237f2b883d60) 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: [ '5037d190-7ac6-43a3-8433-94bf0e95903b', null, <Buffer a4 f8 ce dd b8 d6 b8 d4 e7 ee ba 0b 37 bf 23 7f 2b 88 3d 60>, '/usr/src/app/upload/upload/5037d190-7ac6-43a3-8433-94bf0e95903b/9a/e9/9ae9f ca5-086b-4a48-84fd-ec5f21f7cff0.jpg', '1000002961', 'd72c6706e48988ee27e3f7f7e1aebf6fea0d23ee6b441fce6d52414f1b8826bd', 2025-08-03T16:07:40.055Z, 2025-08-03T16:07:39.999Z, 2025-08-03T16:07:40.055Z, 'IMAGE', false, '0', 'timeline', '20250803_180739.jpg' ] } Query failed : { durationMs: 8.476731000002474, error: PostgresError: duplicate key value violates unique constraint "UQ_asset s_owner_checksum" at ErrorResponse (/usr/src/app/server/node_modules/postgres/cjs/src/connec tion.js:794:26) at handle (/usr/src/app/server/node_modules/postgres/cjs/src/connection.js :480:6) at Socket.data (/usr/src/app/server/node_modules/postgres/cjs/src/connecti on.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)=(5037d190-7ac6-43a3-8433-94bf0e95903b, \\ xc086081150c3e214232b62044fd2a0e1036713b5) 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: [ '5037d190-7ac6-43a3-8433-94bf0e95903b', null, <Buffer c0 86 08 11 50 c3 e2 14 23 2b 62 04 4f d2 a0 e1 03 67 13 b5>, '/usr/src/app/upload/upload/5037d190-7ac6-43a3-8433-94bf0e95903b/1b/20/1b206 4d6-8611-4b7c-a224-09c9c3903915.jpg', '1000002960', 'd72c6706e48988ee27e3f7f7e1aebf6fea0d23ee6b441fce6d52414f1b8826bd', 2025-08-03T12:13:02.684Z, 2025-08-03T12:13:02.604Z, 2025-08-03T12:13:02.684Z, 'IMAGE', false, '0', 'timeline', '20250803_141301.jpg' ] } ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Aug 4, 2025):

Can you help share the mobile app logs?

@alextran1502 commented on GitHub (Aug 4, 2025): Can you help share the mobile app logs?
Author
Owner

@radhoo2k10 commented on GitHub (Aug 4, 2025):

Immich_log_2025-08-04T19_25_10.185190.log

ignore the errors where it couldn't find the local end points. That is fixed now.

@radhoo2k10 commented on GitHub (Aug 4, 2025): [Immich_log_2025-08-04T19_25_10.185190.log](https://github.com/user-attachments/files/21582596/Immich_log_2025-08-04T19_25_10.185190.log) ignore the errors where it couldn't find the local end points. That is fixed now.
Author
Owner

@alextran1502 commented on GitHub (Aug 4, 2025):

@shenlong-tanwen Is this another case of index not getting created correctly? for the libraryId?

@alextran1502 commented on GitHub (Aug 4, 2025): @shenlong-tanwen Is this another case of index not getting created correctly? for the libraryId?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6742