[BUG] Mobile app does not check response code when downloading asset #1384

Closed
opened 2026-02-05 01:35:48 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @lividhen on GitHub (Sep 30, 2023).

The bug

Hitting share or download on an image results in downloading a corrupt 52 byte image.

The OS that Immich Server is running on

Macos ventura

Version of Immich Server

1.79.1

Version of Immich Mobile App

1.78.1 build.102
1.79.1 build.103

Platform with the issue

  • Server
  • Web
  • Mobile

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:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: unless-stopped

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: unless-stopped

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

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

  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:
      - tsdata:/data
    restart: unless-stopped

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

  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:
      - pgdata:/var/lib/postgresql/data
    restart: unless-stopped

  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: unless-stopped

volumes:
  pgdata:
  model-cache:
  tsdata:

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=(redacted) 

# 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=postgres
# 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

Reproduction steps

1. Open an image
2. Select share or download

Additional information

Behind an nginx proxy.

Originally created by @lividhen on GitHub (Sep 30, 2023). ### The bug Hitting share or download on an image results in downloading a corrupt 52 byte image. ### The OS that Immich Server is running on Macos ventura ### Version of Immich Server 1.79.1 ### Version of Immich Mobile App ~~1.78.1 build.102~~ 1.79.1 build.103 ### Platform with the issue - [ ] Server - [ ] Web - [X] Mobile ### Your docker-compose.yml content ```YAML 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: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense restart: unless-stopped immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload env_file: - .env depends_on: - redis - database - typesense restart: unless-stopped immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: unless-stopped immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: unless-stopped 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: - tsdata:/data restart: unless-stopped redis: container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: unless-stopped 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: - pgdata:/var/lib/postgresql/data restart: unless-stopped 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: unless-stopped volumes: pgdata: model-cache: tsdata: ``` ### 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=(redacted) # 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=postgres # 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 ``` ### Reproduction steps ```bash 1. Open an image 2. Select share or download ``` ### Additional information Behind an nginx proxy.
OVERLORD added the 📱mobile label 2026-02-05 01:35:48 +03:00
Author
Owner

@bo0tzz commented on GitHub (Sep 30, 2023):

Does this also happen from the web app? Can you locate the original image in your library folder and check if that is also corrupted?

@bo0tzz commented on GitHub (Sep 30, 2023): Does this also happen from the web app? Can you locate the original image in your library folder and check if that is also corrupted?
Author
Owner

@lividhen commented on GitHub (Sep 30, 2023):

Downloading from the web ui works just fine and the original library folder is intact.

@lividhen commented on GitHub (Sep 30, 2023): Downloading from the web ui works just fine and the original library folder is intact.
Author
Owner

@bo0tzz commented on GitHub (Oct 1, 2023):

Are you using Android or iOS? Is this happening with images that are also stored on your phone, or only on the server? Can you try both of those scenarios?

cc @fyfrey @alextran1502

@bo0tzz commented on GitHub (Oct 1, 2023): Are you using Android or iOS? Is this happening with images that are also stored on your phone, or only on the server? Can you try both of those scenarios? cc @fyfrey @alextran1502
Author
Owner

@lividhen commented on GitHub (Oct 1, 2023):

Using Android. If the image is already stored on the phone it shares as expected. It is only trying to share or download images that are only on the server through the app that the issue occurs.

@lividhen commented on GitHub (Oct 1, 2023): Using Android. If the image is already stored on the phone it shares as expected. It is only trying to share or download images that are only on the server through the app that the issue occurs.
Author
Owner

@lividhen commented on GitHub (Oct 18, 2023):

Oh I feel dumb I just opened the file as text and it's an error message.
{"statusCode":500,"message":"Internal server error"}

@lividhen commented on GitHub (Oct 18, 2023): Oh I feel dumb I just opened the file as text and it's an error message. `{"statusCode":500,"message":"Internal server error"}`
Author
Owner

@bo0tzz commented on GitHub (Oct 18, 2023):

Ha, that's pretty funny. Can you reproduce it and check the server logs to see the actual error message? In the meantime, I'll rename this issue, since the file containing that is definitely a bug as well.

@bo0tzz commented on GitHub (Oct 18, 2023): Ha, that's pretty funny. Can you reproduce it and check the server logs to see the actual error message? In the meantime, I'll rename this issue, since the file containing that is definitely a bug as well.
Author
Owner

@lividhen commented on GitHub (Oct 18, 2023):

Alright, so glad I have time to troubleshoot this now. My immich docker image can't see the place it's looking for the image.
ERROR [ExceptionHandler] ENOENT: no such file or directory, stat '/Users/lividhen/immich/admin/2023/2023-6-30/20230630-065054-6BBE25CC.jpg'

I do have an admin folder with all the images but I can't find an admin folder defined anywhere so I'm not sure how to change it or really give the docker image access to the directory.

@lividhen commented on GitHub (Oct 18, 2023): Alright, so glad I have time to troubleshoot this now. My immich docker image can't see the place it's looking for the image. `ERROR [ExceptionHandler] ENOENT: no such file or directory, stat '/Users/lividhen/immich/admin/2023/2023-6-30/20230630-065054-6BBE25CC.jpg'` I do have an admin folder with all the images but I can't find an admin folder defined anywhere so I'm not sure how to change it or really give the docker image access to the directory.
Author
Owner

@lividhen commented on GitHub (Oct 18, 2023):

I mounted the admin folder at the same place inside the docker container and it seems to work now. I'm not sure what the root cause of the problem was though 😂

@lividhen commented on GitHub (Oct 18, 2023): I mounted the admin folder at the same place inside the docker container and it seems to work now. I'm not sure what the root cause of the problem was though 😂
Author
Owner

@etnoy commented on GitHub (Oct 19, 2023):

We need to

  1. Make so that the server automatically marks missing external files as offline
  2. Hides the download button (in a friendly way) for offline items
@etnoy commented on GitHub (Oct 19, 2023): We need to 1) Make so that the server automatically marks missing external files as offline 2) Hides the download button (in a friendly way) for offline items
Author
Owner

@bo0tzz commented on GitHub (Oct 19, 2023):

  1. Check the response code of the download request when downloading an asset on the mobile app.
@bo0tzz commented on GitHub (Oct 19, 2023): 3. Check the response code of the download request when downloading an asset on the mobile app.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1384