immich icon indicating copy to clipboard operation
immich copied to clipboard

[BUG] Backup stuck if one of the photo is "corrupted" on iOS

Open igoooor opened this issue 1 year ago • 4 comments

The bug

It seems that I have a "corrupted" image on my iPhone device.

The backup is completely stuck on the same file name IMG_2728.JPG. I can stop the backup, restart it, do it foreground or background (also enable background properly in iOS settings), I can restart the app or even my phone. It always stays stuck on the file name.

By clicking on the picture icon next to the progress bar, I can see which picture it is. Knowing the picture and the date, I was able to navigate in the official Photos app and find that picture (actually 2, I have duplicates). I wanted to delete them, but first back them up via Airdrop. When I airdrop them, they actually have a different filename IMG_2730.JPG and IMG_2728 2.JPG. I still deleted them and restarted the backup, but same issue. So then I scrolled through my photos inside of the immich app to find that photos again. And here I could find them, but also a "corrupted" image. What do I mean by "corrupted":

  • the picture is completely black
  • I can not click on it
  • I can on click and hold on it
  • I can not see that image in the official Photos app

I can still try to delete it by doing the following manipulation:

  • click and hold on a different image to enable the multi select mode
  • additionally select that "corrupted" image
  • delete them The the image seems to be gone, but if I refresh the UI (e.g. restart the app), the image is back.

Now to the immich ios app logs. A quick note about the logs, I am not able to export them in any way (via email, copy text, via airdrop or anything), it just end up being empty, so I won't be able to copy paste logs here. But I made screenshots. When I restart the backup, I have the following error in the logs IMG_2299 And then a bit less relevant but still, when I click and hold on the corrupted image I have the following error in the logs: IMG_CA8FE4E71AE3-1

I had a discussion about that issue already in Discord with @alextran1502 (see #help-desk-support Backup stuck, logs says "PathNotFoundException")

So basically I am stuck, because I have this file I can't get rid of (I tried everything I could google to delete it) and the backup is stuck because of that PathNotFoundException

I guess one "simple" solution would be to ignore that exception and go through the next file, and keep the message in the logs maybe? But I'm just a PHP developer, so I don't know all the iOS mechanics to be confident to say "it is simple!" or even to submit a pull request.

The OS that Immich Server is running on

Ubuntu 20.04 aarch64

Version of Immich Server

v1.52.1

Version of Immich Mobile App

v1.52.0 build .90 (iOS)

Platform with the issue

  • [ ] Server
  • [ ] Web
  • [X] Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-server.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:release
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - stack.env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - model-cache:/cache
    env_file:
      - stack.env
    environment:
      - NODE_ENV=production
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    env_file:
      - stack.env
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.0
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
    logging:
      driver: none
    volumes:
      - tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      PG_DATA: /var/lib/postgresql/data
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:release
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

Your .env content

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=REDACTED
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/mnt/disk1/immich/volumes/upload
TYPESENSE_API_KEY=lkjdshgsdfg-xvcbxcq-sdfghfghdd-azeaeae
PUBLIC_LOGIN_PAGE_MESSAGE=
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

Reproduction steps

1.
2.
3.
...

Additional information

No response

igoooor avatar Mar 31 '23 08:03 igoooor

@igoooor is it possible to have that image here? I will try to replicate it on iOS simulator.

truedem0n avatar May 09 '23 15:05 truedem0n

@truedem0n unfortunately this is not an image I can download or see, somehow it is some kind of ghost file I don't have access but immich detects. Alternatively, I synced all my images with PhotoSync (to another service) and it did not fail, so they must be ignoring it somehow maybe?

igoooor avatar May 09 '23 15:05 igoooor

@igoooor did you try restarting docker Immich containers?

truedem0n avatar May 09 '23 16:05 truedem0n

yes, also reinstalling them (and delete volumes)

igoooor avatar May 09 '23 16:05 igoooor

Nope. Not anymore.

On Thu, Mar 14, 2024, 2:37 p.m. DeclanE @.***> wrote:

@igoooor https://github.com/igoooor Are you still having this issue?

— Reply to this email directly, view it on GitHub https://github.com/immich-app/immich/issues/2136#issuecomment-1997937579, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2A2CKSPJHUXB6XXV43MPDYYHKNNAVCNFSM6AAAAAAWOJXGR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJXHEZTONJXHE . You are receiving this because you were mentioned.Message ID: @.***>

truedem0n avatar Mar 14 '24 17:03 truedem0n

Stale, I believe this has been fixed

alextran1502 avatar Apr 27 '24 16:04 alextran1502