Album sync on mobile never finishes with large number of albums #4844

Closed
opened 2026-02-05 10:55:39 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @ronbruins on GitHub (Dec 3, 2024).

The bug

When opening the album tab the sync for albums seems to never finish with a large number of albums (tested with 1800)

The OS that Immich Server is running on

Ubuntu

Version of Immich Server

v1.121.0

Version of Immich Mobile App

v.1.121.0 (latest)

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}
    # 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
      - photo:/mnt/media/photo:rw
      - video:/mnt/media/video:rw
      - homes:/mnt/media/homes:rw

    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}
    # 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
    ports:
      - 3003:3003
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
    ports:
      - 6379:6379
    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
    ports:
      - 5432:5432
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    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
    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

volumes:
  model-cache:
  photo:
    driver_opts:
      type: "nfs"
      o: "addr=192.**.**.35,nfsvers=4,nolock,soft,rw"
      device: ":/volume1/photo"
  video:
    driver_opts:
      type: "nfs"
      o: "addr=192.**.**.35,nfsvers=4,nolock,soft,rw"
      device: ":/***/video"
  homes:
    driver_opts:
      type: "nfs"
      o: "addr=192.**.**.35,nfsvers=4,nolock,soft,rw"
      device: ":/***/homes"

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=./library
UPLOAD_LOCATION=/**/immich/library
# The location where your database files are stored
#DB_DATA_LOCATION=./postgres
DB_DATA_LOCATION=/**/docker_local/immich-app/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=postgres

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

Reproduction steps

  1. create large number of albums
  2. go into mobile to the album tab
  3. the album icon keeps spinning and the log shows it is syncing the albums

Relevant log output

No response

Additional information

Even though there was a fix for this in the current release, the initial sync should not by default need to sync everything. IMO it should more behave like the timeline, or like the web app, only load the assets when opening the album

Originally created by @ronbruins on GitHub (Dec 3, 2024). ### The bug When opening the album tab the sync for albums seems to never finish with a large number of albums (tested with 1800) ### The OS that Immich Server is running on Ubuntu ### Version of Immich Server v1.121.0 ### Version of Immich Mobile App v.1.121.0 (latest) ### Platform with the issue - [ ] 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} # 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 - photo:/mnt/media/photo:rw - video:/mnt/media/video:rw - homes:/mnt/media/homes:rw 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} # 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 ports: - 3003:3003 env_file: - .env restart: always healthcheck: disable: false redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5 ports: - 6379:6379 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 ports: - 5432:5432 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' 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 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 volumes: model-cache: photo: driver_opts: type: "nfs" o: "addr=192.**.**.35,nfsvers=4,nolock,soft,rw" device: ":/volume1/photo" video: driver_opts: type: "nfs" o: "addr=192.**.**.35,nfsvers=4,nolock,soft,rw" device: ":/***/video" homes: driver_opts: type: "nfs" o: "addr=192.**.**.35,nfsvers=4,nolock,soft,rw" device: ":/***/homes" ``` ### 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=./library UPLOAD_LOCATION=/**/immich/library # The location where your database files are stored #DB_DATA_LOCATION=./postgres DB_DATA_LOCATION=/**/docker_local/immich-app/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=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. create large number of albums 2. go into mobile to the album tab 3. the album icon keeps spinning and the log shows it is syncing the albums ### Relevant log output _No response_ ### Additional information Even though there was a fix for this in the current release, the initial sync should not by default need to sync everything. IMO it should more behave like the timeline, or like the web app, only load the assets when opening the album
OVERLORD added the 📱mobile label 2026-02-05 10:55:39 +03:00
Author
Owner

@Mitmischer commented on GitHub (Dec 12, 2024):

Might be related to #12674 (maybe the same problem but different symptoms?)

@Mitmischer commented on GitHub (Dec 12, 2024): Might be related to #12674 (maybe the same problem but different symptoms?)
Author
Owner

@rahulc07 commented on GitHub (Dec 31, 2024):

Can confirm but a slightly different problem, for me I have an album with 50k+ photos in it and album sync never finishes on Android or iOS it just outright crashes the app

@rahulc07 commented on GitHub (Dec 31, 2024): Can confirm but a slightly different problem, for me I have an album with 50k+ photos in it and album sync never finishes on Android or iOS it just outright crashes the app
Author
Owner

@thorsten-hehn commented on GitHub (Feb 16, 2025):

Can also confirm that on my iPhone, the album sync with approx. 900 albums never finishes. Running version v1.126.1 both on my server (Raspberry Pi 4) and on the mobile app (iPhone SE with updated iOS). The album symbol is spinning approx. 2-3 minutes, until the Immich app crashes. Have tried to restart the app and the album synchronization several times (approx. 10 times), but without success. Have tried the setting "Prefer server images", also without success. Any idea how to fix this?

@thorsten-hehn commented on GitHub (Feb 16, 2025): Can also confirm that on my iPhone, the album sync with approx. 900 albums never finishes. Running version v1.126.1 both on my server (Raspberry Pi 4) and on the mobile app (iPhone SE with updated iOS). The album symbol is spinning approx. 2-3 minutes, until the Immich app crashes. Have tried to restart the app and the album synchronization several times (approx. 10 times), but without success. Have tried the setting "Prefer server images", also without success. Any idea how to fix this?
Author
Owner

@thorsten-hehn commented on GitHub (Mar 1, 2025):

Complete deinstallation and reinstallation of the iOS app solved the issue for me. Since I also updated to v1.128.0, I don't know of this also played a role.

@thorsten-hehn commented on GitHub (Mar 1, 2025): Complete deinstallation and reinstallation of the iOS app solved the issue for me. Since I also updated to v1.128.0, I don't know of this also played a role.
Author
Owner

@drewzh commented on GitHub (Mar 6, 2025):

App is essentially unusable for my wife and myself. Both our phones never sync unless we specifically do it within app (and even then it's very buggy/slow). Background sync works very rarely and even then, you can tell something isn't right because each background task syncs a single photo rather than streaming a set images. App constantly freezes and has to be closed forcibly. I guess it's because we have a large 70k photo collection. It's essentially a non-starter due to the iOS app issues unfortunately, so I'm putting it on the back burner until these things can be ironed out.

iPhone 15 Pro + iPhone 13, latest iOS, latest app and server running on high end hardware on local LAN to immich server.

@drewzh commented on GitHub (Mar 6, 2025): App is essentially unusable for my wife and myself. Both our phones never sync unless we specifically do it within app (and even then it's very buggy/slow). Background sync works very rarely and even then, you can tell something isn't right because each background task syncs a single photo rather than streaming a set images. App constantly freezes and has to be closed forcibly. I guess it's because we have a large 70k photo collection. It's essentially a non-starter due to the iOS app issues unfortunately, so I'm putting it on the back burner until these things can be ironed out. iPhone 15 Pro + iPhone 13, latest iOS, latest app and server running on high end hardware on local LAN to immich server.
Author
Owner

@charlieegan3 commented on GitHub (May 31, 2025):

I'm running v1.134 and found the same issue in my iOS app on an iPhone 15 Pro after importing a very large number of albums (around 470). The spinner icon on the albums tab was not stopping and the phone was getting very hot. There wasn't much to see in the logs of the iOS app that might have explained anything unusual.

After seeing the comment above after re-installing the app I found that the issue was resolved.

@charlieegan3 commented on GitHub (May 31, 2025): I'm running v1.134 and found the same issue in my iOS app on an iPhone 15 Pro after importing a very large number of albums (around 470). The spinner icon on the albums tab was not stopping and the phone was getting very hot. There wasn't much to see in the logs of the iOS app that might have explained anything unusual. After seeing the [comment above](https://github.com/immich-app/immich/issues/14462#issuecomment-2692113216) after re-installing the app I found that the issue was resolved.
Author
Owner

@charlieegan3 commented on GitHub (Jun 1, 2025):

I've imported around another 900 albums and have the same issue again. Closer inspection of the mobile app's logs show many Synced changes of remote album $NAME to DB and Upserted $COUNT assets into the DB. It would appear that the app is doing lots of work to sync the state and taking a very long time when there are 1000s of changes to albums and assets on the server.

Phone is getting very hot, but going to leave it to see if it completes this time. Interestingly the log lines seem to have stopped, but the spinner continues on the Albums tab.

@charlieegan3 commented on GitHub (Jun 1, 2025): I've imported around another 900 albums and have the same issue again. Closer inspection of the mobile app's logs show many `Synced changes of remote album $NAME to DB` and `Upserted $COUNT assets into the DB`. It would appear that the app is doing lots of work to sync the state and taking a very long time when there are 1000s of changes to albums and assets on the server. Phone is getting very hot, but going to leave it to see if it completes this time. Interestingly the log lines seem to have stopped, but the spinner continues on the Albums tab.
Author
Owner

@Snufkin-8 commented on GitHub (Jul 9, 2025):

I have the same issue, I am using Android phone. I have around 2000 album, 1.5M photos and 100K video. The album loading never end and get hang or very slow response when clicking into the album. And the timeline also loading all the time.

It seems to me that I cannot use immich in mobile version.

Could help on it too please ?
Many thanks

@Snufkin-8 commented on GitHub (Jul 9, 2025): I have the same issue, I am using Android phone. I have around 2000 album, 1.5M photos and 100K video. The album loading never end and get hang or very slow response when clicking into the album. And the timeline also loading all the time. It seems to me that I cannot use immich in mobile version. Could help on it too please ? Many thanks
Author
Owner

@alextran1502 commented on GitHub (Jul 9, 2025):

Will be fixed in #19370

@alextran1502 commented on GitHub (Jul 9, 2025): Will be fixed in #19370
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#4844