Skip to content

[iOS] Some assets cannot be 'deleted from device', which also prevents Free Up Space from working #26126

Description

@nikbpetrov

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

  • Yes

The bug

Summary

Some assets - 9 identified - cannot be deleted from device on iOS, using Immich's "Delete from Device". If those assets are part of the matched assets when using Free Up Space (according to the album preserving/date cutoff filters), then Free Up Space never deletes anything. Both boil down to the same (lack of) behaviour: unlike any other asset, they do not trigger iOS' deletion confirmation dialog

The assets can be downloaded from here: https://drive.nikolaybpetrov.com/s/LR6DWHALtGxqEMF

Details

Initially found this as a bug, where Free Up Space refused to delete local assets - behaviour was identical to #25822. As per that issue, I tried deleting fewer assets, still to no avail. After manual checks, I found that if some assets - the problematic bunch of 9 identified so far - Free Up Space did not prompt the default deletion confirmation dialog, but if those assets were filtered out (e.g. added to an Album that is preserved as per Free Up Space filtering), then Free Up Space works fine. Those 9 problematic assets - unlike thousands of other assets - cannot be 'Delete from Device' - they do not prompt the iOS deletion confirmation dialog (unlike any of the other thousands of assets).

The problematic assets are not part of a shared album, and are not uploaded to icloud (like all other assets on this phone).

Permissions for the Immich app on the iPhone are correct (confirmed by Alex in Discord).

If I re-upload these assets to the iPhone by other means (via Nextcloud), and then upload to Immich, then Delete from Device works as expected (prompts the iOS deletion confirmation dialog). Funnily, iOS Photos app then shows these assets as PNG in the Info tab (even though they were originally JPEG) - though I am presuming some iOS shenanigans.

Database records for these assets appear normal (e.g. no weird deletedAt flag set or something similar). After all, I tried deleting many thousands of assets at once using Free Up Space initially, many attempts, all to no avail.

I've tried resetting the sqlite database on the app as well as clearing image cache - to no avail.

I've tried uploading those assets to an Android phone - deletion (individual or bulk) works as expected.

The OS that Immich Server is running on

Debian 12.12; kernel 6.8.12-9; Immich Server is running in a docker container inside a Proxmox (privileged) LXC

Version of Immich Server

2.5.6

Version of Immich Mobile App

2.5.6.build.246

Platform with the issue

  • Server
  • Web
  • Mobile

Device make and model

iPhone 14 Pro (MQ1F3RX/A), iOS Version 26.2.1

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:
      # 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}:/data      
      - /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, rocm, openvino, rknn] 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://docs.immich.app/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:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:9@sha256:546304417feac0874c3dd576e0952c6bb8f06bb4093ea0c9ca303c73cf458f63
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23
    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:
      # 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
    shm_size: 128mb
    restart: always
    healthcheck:
      disable: false

volumes:
  model-cache:

Your .env content

UPLOAD_LOCATION=/mnt/photos/immich_upload
DB_DATA_LOCATION=./postgres
TZ=Europe/Sofia
IMMICH_VERSION=v2
DB_PASSWORD=...
DB_USERNAME=...
DB_DATABASE_NAME=immich

Reproduction steps

See above - not sure how to reproduce reliably, as re-uploading the same assets seems to work fine. Identifying those assets in their current stuck state, as well as preventing future such occurances, seems to be the goal.

Relevant log output

These are the logs after attempting a Free Up Space cleanup (log level: FINEST):

2026-02-09 01:16:46.008981 | info     | HashService          | Hashing took - 813ms |
2026-02-09 01:16:46.006116 | fine     | HashService          | Hashed 0/1 assets |
2026-02-09 01:16:46.005994 | warning  | HashService          | Failed to hash asset with id: 44103AB7-3D87-49BC-BF35-982764FC4D72/L0/001, name: IMG_5971.MOV, createdAt: 2025-07-23 07:42:29.000Z, from album: Recents. Error: Failed to hash asset: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) |
2026-02-09 01:16:45.752580 | fine     | HashService          | Hashing 1 files |
2026-02-09 01:16:45.749321 | fine     | HashService          | Hashed 0/1 assets |
2026-02-09 01:16:45.749193 | warning  | HashService          | Failed to hash asset with id: 44103AB7-3D87-49BC-BF35-982764FC4D72/L0/001, name: IMG_5971.MOV, createdAt: 2025-07-23 07:42:29.000Z, from album: Favorites. Error: Failed to hash asset: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) |
2026-02-09 01:16:45.495436 | fine     | HashService          | Hashing 1 files |
2026-02-09 01:16:45.494661 | fine     | HashService          | Hashed 0/1 assets |
2026-02-09 01:16:45.494558 | warning  | HashService          | Failed to hash asset with id: 44103AB7-3D87-49BC-BF35-982764FC4D72/L0/001, name: IMG_5971.MOV, createdAt: 2025-07-23 07:42:29.000Z, from album: Videos. Error: Failed to hash asset: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) |
2026-02-09 01:16:45.198208 | fine     | HashService          | Hashing 1 files |
2026-02-09 01:16:45.195813 | info     | HashService          | Starting hashing of assets |
2026-02-09 01:16:43.123909 | info     | DeviceSyncService    | Device sync took - 390ms |
2026-02-09 01:16:43.123887 | info     | DeviceSyncService    | Full device sync took - 390ms |
2026-02-09 01:16:43.114444 | fine     | DeviceSyncService    | Device album Tezza has not changed. Skipping sync. |
2026-02-09 01:16:43.114441 | fine     | DeviceSyncService    | Syncing device album Tezza |
2026-02-09 01:16:43.114430 | fine     | DeviceSyncService    | Device album Animated has not changed. Skipping sync. |
2026-02-09 01:16:43.114426 | fine     | DeviceSyncService    | Syncing device album Animated |
2026-02-09 01:16:43.114403 | fine     | DeviceSyncService    | Device album Slo-mo has not changed. Skipping sync. |
2026-02-09 01:16:43.114398 | fine     | DeviceSyncService    | Syncing device album Slo-mo |
2026-02-09 01:16:43.114384 | fine     | DeviceSyncService    | Device album Skype has not changed. Skipping sync. |
2026-02-09 01:16:43.114381 | fine     | DeviceSyncService    | Syncing device album Skype |

And these are the logs after attempting an individual asset 'Delete from Device':

2026-02-11 09:02:51.519240 | fine     | socket_io_client:engine.Socket | flushing 1 packets in socket |
2026-02-11 09:02:51.519215 | fine     | socket_io_client:engine.Socket | socket receive: type "ping", data "null" |
2026-02-11 09:02:30.979743 | info     | HashService          | Hashing took - 2078ms |
2026-02-11 09:02:30.908269 | fine     | HashService          | Hashed 0/1 assets |
2026-02-11 09:02:30.908234 | warning  | HashService          | Failed to hash asset with id: 44103AB7-3D87-49BC-BF35-982764FC4D72/L0/001, name: IMG_5971.MOV, createdAt: 2025-07-23 07:42:29.000Z, from album: Recents. Error: Failed to hash asset: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) |
2026-02-11 09:02:30.330809 | fine     | HashService          | Hashing 1 files |
2026-02-11 09:02:30.327987 | fine     | HashService          | Hashed 0/1 assets |
2026-02-11 09:02:30.327883 | warning  | HashService          | Failed to hash asset with id: 44103AB7-3D87-49BC-BF35-982764FC4D72/L0/001, name: IMG_5971.MOV, createdAt: 2025-07-23 07:42:29.000Z, from album: Favorites. Error: Failed to hash asset: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) |
2026-02-11 09:02:29.872458 | fine     | HashService          | Hashing 1 files |
2026-02-11 09:02:29.872238 | fine     | HashService          | Hashed 0/1 assets |
2026-02-11 09:02:29.872188 | warning  | HashService          | Failed to hash asset with id: 44103AB7-3D87-49BC-BF35-982764FC4D72/L0/001, name: IMG_5971.MOV, createdAt: 2025-07-23 07:42:29.000Z, from album: Videos. Error: Failed to hash asset: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) |
2026-02-11 09:02:28.903747 | fine     | HashService          | Hashing 1 files |
2026-02-11 09:02:28.901446 | info     | HashService          | Starting hashing of assets |
2026-02-11 09:02:26.846914 | info     | DeviceSyncService    | Device sync took - 390ms |
2026-02-11 09:02:26.846878 | info     | DeviceSyncService    | Full device sync took - 390ms |
2026-02-11 09:02:26.837321 | fine     | DeviceSyncService    | Device album Screen Recordings has not changed. Skipping sync. |
2026-02-11 09:02:26.837316 | fine     | DeviceSyncService    | Syncing device album Screen Recordings |
2026-02-11 09:02:26.837294 | fine     | DeviceSyncService    | Device album Tezza has not changed. Skipping sync. |
2026-02-11 09:02:26.837291 | fine     | DeviceSyncService    | Syncing device album Tezza |

Additional information

FWIW, here are:
asset date -> asset filename -> asset id (for that account)
(mostly for my future self in case I need to do further checks)

24 Jun 2023 -> 112FC537-EAC3-405A-9765-301C5FCEA9F3_1_105_c.jpeg -> 70228c41-0400-4acc-9ee2-7087916eacfd
23 Sep 2022 -> C836F13A-1BD3-4B1A-878B-22DCE0AB3B9E_4_5005_c.jpeg -> 3bc232f3-ad59-43d4-8a65-9268d6ee6725
17 Sep 2022 -> 664387CA-708F-4A4E-93E7-768E038676C3_4_5005_c.jpeg -> 2f26bc5e-e8fa-4da4-a7cc-181eea829884
17 Sep 2022 -> 7307858F-40A9-44A4-AE35-E189929B92A6_4_5005_c.jpeg -> d5510d46-2783-4d11-9d48-86bebe11b6a5
2 Mar 2023 -> 9C24AB47-F954-481E-B5D2-D8E127F8B69B_4_5005_c.jpeg -> b69d1415-aed1-4d23-bd0f-b222e0b3ceac
7 Jun 2022 -> CB3783B4-8FB7-4F4B-A2A7-B6EEE219F6FA_4_5005_c.jpeg -> c288b8e2-36cc-41d1-a099-fe8e5e9208ff
19 Mar 2022 -> 0DAC55EB-48BE-4710-8EAB-4F1614468884_4_5005_c.jpeg -> 4c4756d2-bb85-4640-aee2-05c799b21493
15 Aug 2021 -> DFCEF564-CE72-4E1A-B8B3-4128096D4EAA_4_5005_c.jpeg -> 7c7fc7e6-02fc-4c58-8fcb-b75362972005
29 Mar 2021 -> FDAEE5B2-6629-41CA-814D-9F714CD1DD00_4_5005_c.jpeg -> 1754add7-da05-4a44-b1c2-b62f0f98911c


After coming back to this, and with some AI help, it looks as if all these assets are edited/cropped (_c suffix, typical of iOS). The originals are likely unreachable, though probably not because of iCloud offloading (not enabled on this device), so the original is probably gone. In any case, when hashing the asset, perhaps one solution would be to try the original, not just the current version. Another one would be, for the Free Up Space utility specifically (or perhaps for hashing more generally, though that's probably unwise), if hashing fails for a given asset, just proceed instead of hard-blocking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions