The same photo appears twice in Immich. #7635

Open
opened 2026-02-05 13:11:33 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @xuehuihui on GitHub (Oct 27, 2025).

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

  • Yes

The bug

Some photos in my album appear duplicated — they look identical, but only one photo exists on the main “All Photos” page.
If I delete one of the duplicates from the album, both copies disappear at the same time.

This issue has happened twice so far.

Album view:

Image

Main page view:

Image

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

v2.0.1

Version of Immich Mobile App

v2.0.1

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

iphone 14pro

Your docker-compose.yml content

# 依赖 .env 文件中的环境变量配置, 首次部署需要在本目录创建 .env文件
# .env 文件内容:
# IMMICH_PORT=8448 #immich暴露在外的端口,默认为8080,如与现存端口冲突请修改
# UPLOAD_LOCATION=/opt/immich/photos #相册挂载路径,根据实际情况修改
# #IMPORT_LOCATION=./import #外部存储库,如需启用,请先修改compose.yml对应挂载路径。不需要时请注释掉此行
# PUID=0 #用户UID
# PGID=0 #用户GID
# TZ=Asia/Shanghai #时区
# DB_PASSWORD=xxxx #修改此处的数据库密码
# DB_USERNAME=postgres
# DB_DATABASE_NAME=immich
#

name: immich
services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    volumes:
      - ${UPLOAD_LOCATION}:/photos
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 8448:2283
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false    
    networks:
      - shared_network
  
  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:release
    # 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, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - /opt/immich/config/machine-learning/models:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false
    networks:
      - shared_network

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

  database:
    container_name: immich_database
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:8d292bdb796aa58bbbaa47fe971c8516f6f57d6a47e7172e62754feb6ed4e7b0
    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:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always
    networks:
      - shared_network

networks:
  shared_network:
    external: true

Your .env content

UPLOAD_LOCATION=/mnt/storage/photos 
DB_DATA_LOCATION=/opt/immich/database
IMMICH_MEDIA_LOCATION=/photos
DB_PASSWORD=****
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

Cannot reproduce the issue consistently

Relevant log output


Additional information

No response

Originally created by @xuehuihui on GitHub (Oct 27, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug Some photos in my album appear duplicated — they look identical, but only one photo exists on the main “All Photos” page. If I delete one of the duplicates from the album, both copies disappear at the same time. This issue has happened twice so far. Album view: <img width="1179" height="2556" alt="Image" src="https://github.com/user-attachments/assets/183b2ac9-3247-4225-b7d7-386cc06d10ca" /> Main page view: <img width="1179" height="2556" alt="Image" src="https://github.com/user-attachments/assets/690326e1-6780-475e-bb9f-2d81f92f2e7c" /> ### The OS that Immich Server is running on Ubuntu 22.04 ### Version of Immich Server v2.0.1 ### Version of Immich Mobile App v2.0.1 ### Platform with the issue - [ ] Server - [ ] Web - [x] Mobile ### Device make and model iphone 14pro ### Your docker-compose.yml content ```YAML # 依赖 .env 文件中的环境变量配置, 首次部署需要在本目录创建 .env文件 # .env 文件内容: # IMMICH_PORT=8448 #immich暴露在外的端口,默认为8080,如与现存端口冲突请修改 # UPLOAD_LOCATION=/opt/immich/photos #相册挂载路径,根据实际情况修改 # #IMPORT_LOCATION=./import #外部存储库,如需启用,请先修改compose.yml对应挂载路径。不需要时请注释掉此行 # PUID=0 #用户UID # PGID=0 #用户GID # TZ=Asia/Shanghai #时区 # DB_PASSWORD=xxxx #修改此处的数据库密码 # DB_USERNAME=postgres # DB_DATABASE_NAME=immich # name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:release volumes: - ${UPLOAD_LOCATION}:/photos - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - 8448:2283 depends_on: - redis - database restart: always healthcheck: disable: false networks: - shared_network 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:release # 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, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - /opt/immich/config/machine-learning/models:/cache env_file: - .env restart: always healthcheck: disable: false networks: - shared_network redis: container_name: immich_redis image: docker.io/valkey/valkey:8-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571 healthcheck: test: redis-cli ping || exit 1 restart: always networks: - shared_network database: container_name: immich_database image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:8d292bdb796aa58bbbaa47fe971c8516f6f57d6a47e7172e62754feb6ed4e7b0 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: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data shm_size: 128mb restart: always networks: - shared_network networks: shared_network: external: true ``` ### Your .env content ```Shell UPLOAD_LOCATION=/mnt/storage/photos DB_DATA_LOCATION=/opt/immich/database IMMICH_MEDIA_LOCATION=/photos DB_PASSWORD=**** DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps Cannot reproduce the issue consistently ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@m147 commented on GitHub (Dec 8, 2025):

Same issue. Very annoying. Any fixes?

@m147 commented on GitHub (Dec 8, 2025): Same issue. Very annoying. Any fixes?
Author
Owner

@timonrieger commented on GitHub (Dec 17, 2025):

Some photos in my album appear duplicated — they look identical, but only one photo exists on the main “All Photos” page.
If I delete one of the duplicates from the album, both copies disappear at the same time.

Can you check your database please?

docker exec -it immich_postgres psql --dbname=immich --username=postgres

Then run the query:

SELECT "albumId", "assetId", COUNT(*) 
FROM "album_asset" 
WHERE "albumId" = '<your-album-id>' 
GROUP BY "albumId", "assetId" 
HAVING COUNT(*) > 1;

To find the album ID, you can list albums:

SELECT id, "albumName" FROM album WHERE "deletedAt" IS NULL ORDER BY "createdAt" DESC LIMIT 10;

This shows any duplicate (albumId, assetId) pairs across the album. If this returns rows, there are duplicate entries in the database (which shouldn't happen due to the primary key constraint). If it returns no rows, the issue is likely in the UI layer.

@timonrieger commented on GitHub (Dec 17, 2025): > Some photos in my album appear duplicated — they look identical, but only one photo exists on the main “All Photos” page. > If I delete one of the duplicates from the album, both copies disappear at the same time. Can you check your database please? ```bash docker exec -it immich_postgres psql --dbname=immich --username=postgres ``` Then run the query: ```sql SELECT "albumId", "assetId", COUNT(*) FROM "album_asset" WHERE "albumId" = '<your-album-id>' GROUP BY "albumId", "assetId" HAVING COUNT(*) > 1; ``` To find the album ID, you can list albums: ```sql SELECT id, "albumName" FROM album WHERE "deletedAt" IS NULL ORDER BY "createdAt" DESC LIMIT 10; ``` This shows any duplicate `(albumId, assetId)` pairs across the album. If this returns rows, there are duplicate entries in the database (which shouldn't happen due to the primary key constraint). If it returns no rows, the issue is likely in the UI layer.
Author
Owner

@andrzej-r commented on GitHub (Jan 29, 2026):

Same issue with 2.5.2 (server and mobile app).

Not sure if that is related but so far all duplicated photos were taken and uploaded when travelling in a different timezone. Also, the mobile app displays them under wrong days. In some cases even two different days, e.g. a photo with a time stamp 30/12/2025 4:54pm +09:00 is shown/duplicated in 1/1/2026 and 2/1/2026.

The same album is displayed in the web app without duplicates and is grouped by days matching the photo timestamps.

@andrzej-r commented on GitHub (Jan 29, 2026): Same issue with 2.5.2 (server and mobile app). Not sure if that is related but so far all duplicated photos were taken and uploaded when travelling in a different timezone. Also, the mobile app displays them under wrong days. In some cases even two different days, e.g. a photo with a time stamp 30/12/2025 4:54pm +09:00 is shown/duplicated in 1/1/2026 and 2/1/2026. The same album is displayed in the web app without duplicates and is grouped by days matching the photo timestamps.
Author
Owner

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

@andrzej-r if you clear the app data (assuming you are on Android) and let the device reindex, do you still see the issue?

@alextran1502 commented on GitHub (Jan 29, 2026): @andrzej-r if you clear the app data (assuming you are on Android) and let the device reindex, do you still see the issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7635