Deleting photos causes immich android app to get into a bad state. #4720

Closed
opened 2026-02-20 03:09:35 -05:00 by deekerman · 9 comments
Owner

Originally created by @shawzymoto on GitHub (Jan 22, 2025).

The bug

I will delete a photo sometimes and its fine. I think its when i delete a photo from the server as well that it seems to hang. I just get the spinner indefinitely. I will kill the app and try to come back in and it will show the pictures but the icon that shows the backup status just keeps spinning. When i check the server the version isnt blank like it cant connect to the server. I have to log out and back in for it to restore.

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.24.2

Version of Immich Mobile App

v1.24.2

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

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:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${EXTERNAL_PATH}:/usr/src/app/external
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:2283
    depends_on:
      - redis
      - database
    restart: unless-stopped
    labels:
      - "traefik.http.routers.immich-server.rule=Host(`[this is my custom internal domain]`)"
    networks:
      - shared-network

  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
    env_file:
      - .env
    restart: unless-stopped
    networks:
      - shared-network

  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900
    healthcheck:
      test: redis-cli ping || exit 1
    restart: unless-stopped
    networks:
      - shared-network

  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
    volumes:
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname='${DB_DATABASE_NAME}' || 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: unless-stopped
    networks:
      - shared-network


  pgbackups:
    image: prodrigestivill/postgres-backup-local
    restart: unless-stopped
    user: postgres:postgres
    volumes:
        - ${DB_BACKUP_LOCATION}:/backups
    links:
        - database
    depends_on:
        - database
    environment:
        - POSTGRES_HOST=database
        - POSTGRES_DB=${DB_DATABASE_NAME}
        - POSTGRES_USER=${DB_USERNAME}
        - POSTGRES_PASSWORD=${DB_PASSWORD}
     #  - POSTGRES_PASSWORD_FILE=/run/secrets/db_password <-- alternative for POSTGRES_PASSWORD (to use with docker secrets)
        - POSTGRES_EXTRA_OPTS=-Z1 --schema=public --blobs
        - SCHEDULE=@daily
        - BACKUP_KEEP_DAYS=7
        - BACKUP_KEEP_WEEKS=4
        - BACKUP_KEEP_MONTHS=6
        - HEALTHCHECK_PORT=8080
    networks:
      - shared-network

volumes:
  model-cache:

networks:
  shared-network:
    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/immich-photos

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

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=[nice try]

EXTERNAL_PATH=/mnt/immich-external

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
DB_DATA_LOCATION=./postgres
DB_BACKUP_LOCATION=/mnt/immich-db


REDIS_HOSTNAME=immich_redis

PORTAINER_DATA=./portainer_data

Reproduction steps

  1. android mobile app
  2. delete images
  3. i was able to delete a couple and then on the 3rd it hung.

...

Relevant log output

Error getting user information from the server [CATCH ALL]

Additional information

No response

Originally created by @shawzymoto on GitHub (Jan 22, 2025). ### The bug I will delete a photo sometimes and its fine. I think its when i delete a photo from the server as well that it seems to hang. I just get the spinner indefinitely. I will kill the app and try to come back in and it will show the pictures but the icon that shows the backup status just keeps spinning. When i check the server the version isnt blank like it cant connect to the server. I have to log out and back in for it to restore. ### The OS that Immich Server is running on Debian ### Version of Immich Server v1.24.2 ### Version of Immich Mobile App v1.24.2 ### Platform with the issue - [x] Server - [ ] Web - [x] Mobile ### Your docker-compose.yml content ```YAML 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: - ${UPLOAD_LOCATION}:/usr/src/app/upload - ${EXTERNAL_PATH}:/usr/src/app/external - /etc/localtime:/etc/localtime:ro env_file: - .env ports: - 2283:2283 depends_on: - redis - database restart: unless-stopped labels: - "traefik.http.routers.immich-server.rule=Host(`[this is my custom internal domain]`)" networks: - shared-network 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 env_file: - .env restart: unless-stopped networks: - shared-network redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:d6c2911ac51b289db208767581a5d154544f2b2fe4914ea5056443f62dc6e900 healthcheck: test: redis-cli ping || exit 1 restart: unless-stopped networks: - shared-network database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' volumes: - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: test: pg_isready --dbname='${DB_DATABASE_NAME}' || 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: unless-stopped networks: - shared-network pgbackups: image: prodrigestivill/postgres-backup-local restart: unless-stopped user: postgres:postgres volumes: - ${DB_BACKUP_LOCATION}:/backups links: - database depends_on: - database environment: - POSTGRES_HOST=database - POSTGRES_DB=${DB_DATABASE_NAME} - POSTGRES_USER=${DB_USERNAME} - POSTGRES_PASSWORD=${DB_PASSWORD} # - POSTGRES_PASSWORD_FILE=/run/secrets/db_password <-- alternative for POSTGRES_PASSWORD (to use with docker secrets) - POSTGRES_EXTRA_OPTS=-Z1 --schema=public --blobs - SCHEDULE=@daily - BACKUP_KEEP_DAYS=7 - BACKUP_KEEP_WEEKS=4 - BACKUP_KEEP_MONTHS=6 - HEALTHCHECK_PORT=8080 networks: - shared-network volumes: model-cache: networks: shared-network: external: true ``` ### 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-photos # The Immich version to use. You can pin this to a specific version like "v1.71.0" #IMMICH_VERSION=release IMMICH_VERSION=v1.124.2 # Connection secret for postgres. You should change it to a random password DB_PASSWORD=[nice try] EXTERNAL_PATH=/mnt/immich-external # The values below this line do not need to be changed ################################################################################### DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich DB_DATA_LOCATION=./postgres DB_BACKUP_LOCATION=/mnt/immich-db REDIS_HOSTNAME=immich_redis PORTAINER_DATA=./portainer_data ``` ### Reproduction steps 1. android mobile app 2. delete images 3. i was able to delete a couple and then on the 3rd it hung. ... ### Relevant log output ```shell Error getting user information from the server [CATCH ALL] ``` ### Additional information _No response_
deekerman 2026-02-20 03:09:35 -05:00
Author
Owner

@shawzymoto commented on GitHub (Jan 22, 2025):

The only other thing i could think of that i had done recently was install immich tv on my google chromecast tv. I have its screensaver coming from immich tv.

Would this cause issues deleting photos? its a stretch but its all i can think of.

@shawzymoto commented on GitHub (Jan 22, 2025): The only other thing i could think of that i had done recently was install immich tv on my google chromecast tv. I have its screensaver coming from immich tv. Would this cause issues deleting photos? its a stretch but its all i can think of.
Author
Owner

@shawzymoto commented on GitHub (Jan 22, 2025):

i was able to get this out of the log as well.

Failed to delete asset from device

PlatformException(deleteWithIds failed, null, null, null)

#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334)

#2 PhotoManagerPlugin.deleteWithIds (package:photo_manager/src/internal/plugin.dart:340)

#3 AssetNotifier._deleteLocalAssets (package:immich_mobile/providers/asset.provider.dart:275)

#4 AssetNotifier.deleteAssets (package:immich_mobile/providers/asset.provider.dart:187)

#5 MultiselectGrid.build.onDelete (package:immich_mobile/widgets/asset_grid/multiselect_grid.dart:183)

@shawzymoto commented on GitHub (Jan 22, 2025): i was able to get this out of the log as well. Failed to delete asset from device PlatformException(deleteWithIds failed, null, null, null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334) <asynchronous suspension> #2 PhotoManagerPlugin.deleteWithIds (package:photo_manager/src/internal/plugin.dart:340) <asynchronous suspension> #3 AssetNotifier._deleteLocalAssets (package:immich_mobile/providers/asset.provider.dart:275) <asynchronous suspension> #4 AssetNotifier.deleteAssets (package:immich_mobile/providers/asset.provider.dart:187) <asynchronous suspension> #5 MultiselectGrid.build.onDelete (package:immich_mobile/widgets/asset_grid/multiselect_grid.dart:183) <asynchronous suspension>
Author
Owner

@shawzymoto commented on GitHub (Jan 22, 2025):

and this...........

#0 AssetPathEntity.obtainPathFromProperties (package:photo_manager/src/types/entity.dart:162)

#1 AssetPathEntity.fromId (package:photo_manager/src/types/entity.dart:59)

#2 AlbumMediaRepository.getAssets (package:immich_mobile/repositories/album_media.repository.dart:44)

#3 HashService.getHashedAssets (package:immich_mobile/services/hash.service.dart:38)

#4 SyncService._syncDeviceAlbumFast (package:immich_mobile/services/sync.service.dart:656)

#5 SyncService._syncAlbumInDbAndOnDevice (package:immich_mobile/services/sync.service.dart:563)

#6 diffSortedLists (package:immich_mobile/utils/diff.dart:23)

#7 SyncService._syncLocalAlbumAssetsToDb (package:immich_mobile/services/sync.service.dart:510)

#8 AlbumService.refreshDeviceAlbums (package:immich_mobile/services/album.service.dart:132)

#9 AssetNotifier.getAllAsset (package:immich_mobile/providers/asset.provider.dart:56)

#10 AppLifeCycleNotifier.handleAppResume (package:immich_mobile/providers/app_life_cycle.provider.dart:67)

@shawzymoto commented on GitHub (Jan 22, 2025): and this........... #0 AssetPathEntity.obtainPathFromProperties (package:photo_manager/src/types/entity.dart:162) <asynchronous suspension> #1 AssetPathEntity.fromId (package:photo_manager/src/types/entity.dart:59) <asynchronous suspension> #2 AlbumMediaRepository.getAssets (package:immich_mobile/repositories/album_media.repository.dart:44) <asynchronous suspension> #3 HashService.getHashedAssets (package:immich_mobile/services/hash.service.dart:38) <asynchronous suspension> #4 SyncService._syncDeviceAlbumFast (package:immich_mobile/services/sync.service.dart:656) <asynchronous suspension> #5 SyncService._syncAlbumInDbAndOnDevice (package:immich_mobile/services/sync.service.dart:563) <asynchronous suspension> #6 diffSortedLists (package:immich_mobile/utils/diff.dart:23) <asynchronous suspension> #7 SyncService._syncLocalAlbumAssetsToDb (package:immich_mobile/services/sync.service.dart:510) <asynchronous suspension> #8 AlbumService.refreshDeviceAlbums (package:immich_mobile/services/album.service.dart:132) <asynchronous suspension> #9 AssetNotifier.getAllAsset (package:immich_mobile/providers/asset.provider.dart:56) <asynchronous suspension> #10 AppLifeCycleNotifier.handleAppResume (package:immich_mobile/providers/app_life_cycle.provider.dart:67) <asynchronous suspension>
Author
Owner

@Saschl commented on GitHub (Jan 23, 2025):

I think I found the culprit for the issue:

When the next image is being loaded after deleting the first one, the new asset is loaded correctly and display (https://github.com/immich-app/immich/blob/main/mobile/lib/pages/common/gallery_viewer.page.dart#L264), but "currentAssetProvider" is never updated, as the image did not change view "onPageChange"

When trying the next delete, https://github.com/immich-app/immich/blob/main/mobile/lib/widgets/asset_viewer/bottom_gallery_bar.dart#L78 tries to perform a deletion of the previous asset, which likely fails.

@Saschl commented on GitHub (Jan 23, 2025): I think I found the culprit for the issue: When the next image is being loaded after deleting the first one, the new asset is loaded correctly and display (https://github.com/immich-app/immich/blob/main/mobile/lib/pages/common/gallery_viewer.page.dart#L264), but "currentAssetProvider" is never updated, as the image did not change view "onPageChange" When trying the next delete, https://github.com/immich-app/immich/blob/main/mobile/lib/widgets/asset_viewer/bottom_gallery_bar.dart#L78 tries to perform a deletion of the previous asset, which likely fails.
Author
Owner

@shawzymoto commented on GitHub (Jan 25, 2025):

@Saschl it might be the culprit? im not sure but im using the android app. does the same code exist on that client as well?

@shawzymoto commented on GitHub (Jan 25, 2025): @Saschl it might be the culprit? im not sure but im using the android app. does the same code exist on that client as well?
Author
Owner

@TomK32 commented on GitHub (Mar 21, 2025):

I have the same issue with the android app: Deleting photos in the Library -> On this device -> select photos -> delete and after the confirmation dialog it spins forever.

@TomK32 commented on GitHub (Mar 21, 2025): I have the same issue with the android app: Deleting photos in the Library -> On this device -> select photos -> delete and after the confirmation dialog it spins forever.
Author
Owner

@shawzymoto commented on GitHub (Mar 21, 2025):

So the way I got around this was disabling the foreground backup service.
The background service is enabled while charging. This way I could just
delete the images locally before they get backed up. It doesn't really fix
the issue per se but it does work around it a bit.

On Fri, Mar 21, 2025, 15:12 Thomas R. Koll @.***> wrote:

I have the same issue with the android app: Deleting photos in the Library
-> On this device -> select photos -> delete and after the confirmation
dialog it spins forever.


Reply to this email directly, view it on GitHub
https://github.com/immich-app/immich/issues/15541#issuecomment-2744240547,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AZW5FIJAMKBSBUAKAW3ZPFL2VRQBXAVCNFSM6AAAAABVWAGKZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBUGI2DANJUG4
.
You are receiving this because you authored the thread.Message ID:
@.***>
[image: TomK32]TomK32 left a comment (immich-app/immich#15541)
https://github.com/immich-app/immich/issues/15541#issuecomment-2744240547

I have the same issue with the android app: Deleting photos in the Library
-> On this device -> select photos -> delete and after the confirmation
dialog it spins forever.


Reply to this email directly, view it on GitHub
https://github.com/immich-app/immich/issues/15541#issuecomment-2744240547,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AZW5FIJAMKBSBUAKAW3ZPFL2VRQBXAVCNFSM6AAAAABVWAGKZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBUGI2DANJUG4
.
You are receiving this because you authored the thread.Message ID:
@.***>

@shawzymoto commented on GitHub (Mar 21, 2025): So the way I got around this was disabling the foreground backup service. The background service is enabled while charging. This way I could just delete the images locally before they get backed up. It doesn't really fix the issue per se but it does work around it a bit. On Fri, Mar 21, 2025, 15:12 Thomas R. Koll ***@***.***> wrote: > I have the same issue with the android app: Deleting photos in the Library > -> On this device -> select photos -> delete and after the confirmation > dialog it spins forever. > > — > Reply to this email directly, view it on GitHub > <https://github.com/immich-app/immich/issues/15541#issuecomment-2744240547>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AZW5FIJAMKBSBUAKAW3ZPFL2VRQBXAVCNFSM6AAAAABVWAGKZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBUGI2DANJUG4> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > [image: TomK32]*TomK32* left a comment (immich-app/immich#15541) > <https://github.com/immich-app/immich/issues/15541#issuecomment-2744240547> > > I have the same issue with the android app: Deleting photos in the Library > -> On this device -> select photos -> delete and after the confirmation > dialog it spins forever. > > — > Reply to this email directly, view it on GitHub > <https://github.com/immich-app/immich/issues/15541#issuecomment-2744240547>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AZW5FIJAMKBSBUAKAW3ZPFL2VRQBXAVCNFSM6AAAAABVWAGKZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBUGI2DANJUG4> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@bo0tzz commented on GitHub (Sep 18, 2025):

Does anybody still have this issue on the new beta timeline?

@bo0tzz commented on GitHub (Sep 18, 2025): Does anybody still have this issue on the new beta timeline?
Author
Owner

@Saschl commented on GitHub (Sep 19, 2025):

Nope, at least the issue I experienced is gone now

@Saschl commented on GitHub (Sep 19, 2025): Nope, at least the issue I experienced is gone now
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#4720
No description provided.