Skip to content

Empty album is created when mobile app attempts to sync existing photos #12166

Closed

Description

@Itay080

The bug

When attempting to backup an album from the 1.113.0 android app that already exists on the server, the app blacklists the photos in the album.
However, if mobile album sync is on, an empty album with the mobile album's name will be created in the server.

The OS that Immich Server is running on

Docker

Version of Immich Server

1.113.0

Version of Immich Mobile App

1.113.0

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}
    user: 1001:1001
    networks:
      immich:
        ipv4_address: 172.20.0.2 
    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}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    environment:
      - TZ=Asia/Jerusalem
    env_file:
      - .env
        #ports:
        #- 2283:3001
    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}
    user: 1001:1001
    networks:
      immich:
        ipv4_address: 172.20.0.3

    # 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:
      - ./data/model_cache:/cache
      - ./data/machine_learning/config:/.config
      - ./data/machine_learning/cache:/.cache
    environment:
      - TZ=Asia/Jerusalem
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
    user: 1001:1001
    healthcheck:
      test: redis-cli ping || exit 1
    environment:
      - TZ=Asia/Jerusalem
    volumes:
      - ./data/redis:/data
    restart: always
    networks:
      immich:
        ipv4_address: 172.20.0.4


  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    user: 1001:1001
    networks:
      immich:
        ipv4_address: 172.20.0.5
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      TZ: Asia/Jerusalem
    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
      - ./data/postgres-run:/var/run/postgresql
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: ["postgres", "-c", "shared_preload_libraries=vectors.so", "-c", 'search_path="$$user", public, vectors', "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"]
    restart: always

networks:
  immich:
    external: true

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/merged/immich/library
# The location where your database files are stored
DB_DATA_LOCATION=./data/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=REDACTED

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

Reproduction steps

  1. Upload an album from the android app with mobile album sync disabled
  2. Clear the android app data
  3. Attempt to reupload the album with mobile album sync turned on
  4. The photos will be blacklisted by the app since the photos already exist on the server. However, an empty album with the mobile album's name will be created

Relevant log output

No response

Additional information

No response

Activity

  1. alextran1502 commented on Aug 30, 2024

    @alextran1502
    Member

    Empty album with associated name is created is the expecting mechanism. So that when you upload assets, there is album information to put the uploaded assets to.

    As noted on Discord, you are using a different version APK vs PlayStore, so the app does not the correct information of uploaded file to put the assets to the corresponding albums

  2. NicholasFlamy commented on Aug 30, 2024

    @NicholasFlamy
    Collaborator

    So the test case related to this is, what if you have two phones, and the exact same image is on both. The original has the picture in an album named "Album A" and the second phone has it in an album named "Album B"

    In the current implementation, the second phone's (assuming it was backed up after the first phone) album "Album B" would be created but empty and the image would be blacklisted by the app on the second phone

    So currently, it will only add pictures to an album if the pictures are backed up to immich (for the first time, not being blacklisted). And if the pictures get blacklisted, the album will be added to immich as an empty album.

  3. rovitsky commented on Aug 31, 2024

    @rovitsky

    As I understand, the fix is aimed at preventing the creation of the album if all the photos inside are duplicates/were uploaded before. I want to ask if it would it be possible (maybe in the future if it's too much to do in the scope of this issue) make it an option to allow the album to be created with existing photos in Immich being added there?

    Here's the use case: albums from the device were manually replicated in Immich before 1.113.0 and now when new photos are added to the album on the device they are synced into a new album, but the old photos are "stuck" in the old album in Immich. I'd rather have them in both new and old albums at the same time and decide whether I want to keep manually created one instead of re-adding them now in sake of consistency.

    Regardless of the answer - thank you for this albums sync feature.

  4. alextran1502 commented on Aug 31, 2024

    @alextran1502
    Member

    @rovitsky I think what you asked is already support, you can go to the backup option page and press on the "Sync" button, it will curated all local assets that have been uploaded and add them in the corresponding album based on your selection for backup

  5. rovitsky commented on Aug 31, 2024

    @rovitsky

    Indeed that worked, thank you. For some reason albums appeared by themselves without the Sync button so I thought that that's it, my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions