immich-app / immich

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

[BUG] Never ending "Preparing..." popup after clicking share button on IOS #5119

Closed romonwafa closed 7 months ago

romonwafa commented 7 months ago

The bug

When clicking on the share button for any photo or video, a never-ending popup shows up that says "Preparing..." It cannot be closed and the only way to get back into the IOS app is to restart it.

The OS that Immich Server is running on

Ubuntu 22.10 LTS

Version of Immich Server

1.87

Version of Immich Mobile App

1.86.0 build.126

Platform with the issue

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - /home/ubuntu/docker/immich/upload:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "microservices" ]
    volumes:
      - /home/ubuntu/docker/immich/upload:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - /home/ubuntu/docker/immich/model-cache:/cache
    env_file:
      - .env
    restart: always

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: always

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - /home/ubuntu/docker/immich/tsdata:/data
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - /home/ubuntu/docker/immich/pgdata:/var/lib/postgresql/data
    restart: always

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

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=/home/user/docker/immich/upload

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

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=REDACTED
DB_PASSWORD=REDACTED

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

REDIS_HOSTNAME=immich_redis

#IMMICH_SERVER_URL=REDACTED
#IMMICH_WEB_URL=REDACTED

Reproduction steps

1. Open app
2. Click on any photo or video
3. Click share button (bottom left)

Additional information

I saw @dodg3r post a comment about this same issue a few hours ago: https://github.com/immich-app/immich/issues/4187#issuecomment-1816792191_a. However, the original issue he replied to was that the popup shows up for a split-second then goes away and nothing happens. This issue seems to be different.

alextran1502 commented 7 months ago

Do you know if the asset you are trying to shared is either a library asset, or asset that gets uploaded from the mobile app, etc

romonwafa commented 7 months ago

By library assets do you mean assets in the phone's camera roll that have not yet been uploaded to the server?

In that case, the issue occurs with both phone library assets and assets that get uploaded by the mobile app.

To test this, I paused automatic foreground backup and snapped a test photo to check if it's happening with library assets as well and I get the same issue.

I also uploaded a test asset to the server through the browser on PC, and trying to share it within the phone app yields the same issue.

Please correct me if I'm misunderstood what a library asset is.

alextran1502 commented 7 months ago

Ah I was trying to determine if this issue is from sharing an external library's asset or from the assets that are uploaded to Immich. Can you help me grab the mobile log after the sharing failed

romonwafa commented 7 months ago

Seems to happen to both. Here's the mobile logs.

Note that the sharing actually does work (the share sheet pops up), but the problem is getting access to the application after the share sheet as the "Preparing..." message doesn't go away. So after sharing one image, the only way to get back into the app is to close the app and restart it. Immich_log_2023-11-18T133419.038326.csv

alextran1502 commented 7 months ago

Are you using a reverse proxy to access the instance from the app? If you use local IP, does it still happen?

romonwafa commented 7 months ago

Yes this issue occurs when connecting to the server from the local address as well.

LocalNetwork_Immich_log_2023-11-18T135257.958530.csv

alextran1502 commented 7 months ago

Thank you, I can reproduce this now

alextran1502 commented 7 months ago

@shenlong-tanwen Can you reproduce this, by selecting and sharing from the main timeline. I have a feeling it related to this PR https://github.com/immich-app/immich/pull/5104

shenlong-tanwen commented 7 months ago

It was from #4923 😅. Let me go through all the contexts once and fix them. Few mins