immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
47.23k stars 2.39k forks source link

immich app crashes while backing up on iphone #9884

Closed bekucera closed 1 month ago

bekucera commented 4 months ago

The bug

When I backing up on my iPhone, the app crashes every few 100 photos. I don't know if this is relevant or ok, but the immich_microservices container is taking a lot of CPU.

Im using iphone se 2nd generation with ios 17.5.1

The OS that Immich Server is running on

debian but immich is running in docker

Version of Immich Server

ghcr.io/immich-app/immich-server:release(1.105.1)

Version of Immich Mobile App

1.105.0

Platform with the issue

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}
    command: ['start.sh', 'immich']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 127.0.0.1:2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: ['start.sh', 'microservices']
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  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:
      - immich_cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:84882e87b54734154586e5f8abd4dce69fe7311315e2fc6d67c29614c8de2672
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/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
    restart: always
    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"]

volumes:
  immich_cache:

  immich_library:

  immich_postgres:

Your .env content

DB_DATABASE_NAME=immich
UPLOAD_LOCATION=immich_library
DB_DATA_LOCATION=immich_postgres
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_USERNAME=postgres
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/src/app/bin
NODE_VERSION=20.13.1
YARN_VERSION=1.22.19
NODE_ENV=production
NVIDIA_DRIVER_CAPABILITIES=all
NVIDIA_VISIBLE_DEVICES=all

Reproduction steps

Start backing up on my iphone

Relevant log output

2024-05-30 07:15:05.330032 | WARNING  | HashService          | Failed to hash file /private/var/mobile/Containers/Data/Application/0756AFC7-5B93-450F-B926-56384F68FC11/tmp/.image/63679EEC-3CFC-486B-87D5-319976EC01CE_L0_001_1704243237.308611_o_607abe3b-e134-410e-91ee-cdc7851ac2a9.jpg, skipping |

Additional information

No response

greyivy commented 4 months ago

Also experiencing this on 1.105.0. The app was working fine previously.

DeviousM commented 3 months ago

Mostly likely a related and relevant Q&A thread: https://github.com/immich-app/immich/discussions/8922

I experience the same issue, but in my case I am trying to backup over 19k photos (sync them in reality as all of the photos are already in Immich, imported via Google Takeout and immich-go).

Any foreground sync crashes the app after some time, while also throwing thousands of "Failed to upload" photos ("failed to hash" error in the logs)