[BUG] Cannot backup any photo or video on MIUI 14 #1515

Closed
opened 2026-02-05 02:11:49 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @zhyfzy on GitHub (Oct 26, 2023).

The bug

It is normal to upload photos and videos through the webpage, but on my Android device, It can only detect the number of total assets, but does nothing after I touch the 'start backup' button. Neither the foreground nor the background is work.

There is an error log in the Android app

Message:
Catch all error: PlatformException(Request for permission failed., User denied permission., null, null) - PlatformException(Request for permission failed., User denied permission., null, null)

FROM:
ImmichErrorLogger

STACK TRACES:
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310)
<asynchronous suspension>
#2      AssetEntity._getFile (package:photo_manager/src/types/entity.dart:712)
<asynchronous suspension>
#3      HashService._hashAssets (package:immich_mobile/shared/services/hash.service.dart:59)
<asynchronous suspension>
#4      SyncService._addAlbumFromDevice (package:immich_mobile/shared/services/sync.service.dart:620)
<asynchronous suspension>
#5      diffSortedLists (package:immich_mobile/utils/diff.dart:30)
<asynchronous suspension>
#6      SyncService._syncLocalAlbumAssetsToDb (package:immich_mobile/shared/services/sync.service.dart:437)
<asynchronous suspension>
#7      AlbumService.refreshDeviceAlbums (package:immich_mobile/modules/album/services/album.service.dart:114)
<asynchronous suspension>
#8      AssetNotifier.getAllAsset (package:immich_mobile/shared/providers/asset.provider.dart:53)
<asynchronous suspension>

And anthor log:

MESSAGE: 
Media location permission is not granted. Cannot access original assets for backup.

FROM:
BackupService

But I have already granted all permissions in the apps setting (Xiaomi 13). It keeps generating logs like this and no files are uploaded.

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

1.82.1

Version of Immich Mobile App

1.82.1 build.2106

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
      - /etc/localtime:/etc/localtime:ro
    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}
      # extends:
      #file: hwaccel.yml
      #service: hwaccel
    command: ["start.sh", "microservices"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    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:
      - 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:
      - 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:
      - 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

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=/media/terra/immich

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

LOG_LEVEL=verbose

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=some-random-text
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. Deploying immich through docker-compose and conducting init settings
2. Open the Android app and login 
3. Touch the 'start backup' button in the android app, but nothing happened.
...

Additional information

No response

Originally created by @zhyfzy on GitHub (Oct 26, 2023). ### The bug It is normal to upload photos and videos through the webpage, but on my Android device, It can only detect the number of total assets, but does nothing after I touch the 'start backup' button. Neither the foreground nor the background is work. There is an error log in the Android app ``` Message: Catch all error: PlatformException(Request for permission failed., User denied permission., null, null) - PlatformException(Request for permission failed., User denied permission., null, null) FROM: ImmichErrorLogger STACK TRACES: #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310) <asynchronous suspension> #2 AssetEntity._getFile (package:photo_manager/src/types/entity.dart:712) <asynchronous suspension> #3 HashService._hashAssets (package:immich_mobile/shared/services/hash.service.dart:59) <asynchronous suspension> #4 SyncService._addAlbumFromDevice (package:immich_mobile/shared/services/sync.service.dart:620) <asynchronous suspension> #5 diffSortedLists (package:immich_mobile/utils/diff.dart:30) <asynchronous suspension> #6 SyncService._syncLocalAlbumAssetsToDb (package:immich_mobile/shared/services/sync.service.dart:437) <asynchronous suspension> #7 AlbumService.refreshDeviceAlbums (package:immich_mobile/modules/album/services/album.service.dart:114) <asynchronous suspension> #8 AssetNotifier.getAllAsset (package:immich_mobile/shared/providers/asset.provider.dart:53) <asynchronous suspension> ``` And anthor log: ``` MESSAGE: Media location permission is not granted. Cannot access original assets for backup. FROM: BackupService ``` But I have already granted all permissions in the apps setting (Xiaomi 13). It keeps generating logs like this and no files are uploaded. ### The OS that Immich Server is running on Ubuntu 22.04 ### Version of Immich Server 1.82.1 ### Version of Immich Mobile App 1.82.1 build.2106 ### Platform with the issue - [X] 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 - /etc/localtime:/etc/localtime:ro 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} # extends: #file: hwaccel.yml #service: hwaccel command: ["start.sh", "microservices"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro 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: - 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: - 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: - 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 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=/media/terra/immich # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release LOG_LEVEL=verbose # Connection secrets for postgres and typesense. You should change these to random passwords TYPESENSE_API_KEY=some-random-text 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. Deploying immich through docker-compose and conducting init settings 2. Open the Android app and login 3. Touch the 'start backup' button in the android app, but nothing happened. ... ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Oct 26, 2023):

What is the Android version of your phone?

@alextran1502 commented on GitHub (Oct 26, 2023): What is the Android version of your phone?
Author
Owner

@zhyfzy commented on GitHub (Oct 26, 2023):

What is the Android version of your phone?

Android 14 (MIUI 14.0.3)

@zhyfzy commented on GitHub (Oct 26, 2023): > What is the Android version of your phone? Android 14 (MIUI 14.0.3)
Author
Owner

@alextran1502 commented on GitHub (Oct 26, 2023):

Do you mind reinstalling the app and try again for the permission?

@alextran1502 commented on GitHub (Oct 26, 2023): Do you mind reinstalling the app and try again for the permission?
Author
Owner

@zhyfzy commented on GitHub (Oct 27, 2023):

Do you mind reinstalling the app and try again for the permission?

yes,i have reinstalled both the Android app and docker containers (clean install),but this problem still exists

@zhyfzy commented on GitHub (Oct 27, 2023): > Do you mind reinstalling the app and try again for the permission? yes,i have reinstalled both the Android app and docker containers (clean install),but this problem still exists
Author
Owner

@alextran1502 commented on GitHub (Oct 27, 2023):

Thank you, I will try to create the same Android version on an emulator to see if I can reproduce this issue

@alextran1502 commented on GitHub (Oct 27, 2023): Thank you, I will try to create the same Android version on an emulator to see if I can reproduce this issue
Author
Owner

@thjkl-gthb commented on GitHub (Nov 10, 2023):

I got the same issue and my phone's version is Android 14 (MIUI 14.0.2)

@thjkl-gthb commented on GitHub (Nov 10, 2023): I got the same issue and my phone's version is Android 14 (MIUI 14.0.2)
Author
Owner

@thjkl-gthb commented on GitHub (Nov 10, 2023):

I got the same issue and my phone's version is Android 14 (MIUI 14.0.2) @alextran1502

Update: It's working on my another phone with MIUI 12(Rooted), so it may be related to the system settings like security enhancement

Plus, for the non-working phone, it can't load the Pic in "Albums on device" under the library

@thjkl-gthb commented on GitHub (Nov 10, 2023): > I got the same issue and my phone's version is Android 14 (MIUI 14.0.2) @alextran1502 Update: It's working on my another phone with MIUI 12(Rooted), so it may be related to the system settings like security enhancement Plus, for the non-working phone, it can't load the Pic in "Albums on device" under the library
Author
Owner

@robert-zc-github commented on GitHub (Dec 3, 2023):

Update: I also meet this on My MI 13(Android 14, MIUI 14.0.5), it seems that it is cauesd by a system bug. The permission had not been applied correctly, i correct that by relaunch the App permissions: in Settings -> Apps -> Permissions -> Permissions -> choose immich, select "Access photos and videos" permission to "Deny", and than reselect to "Always allow".

When i return to immich, I found the backup progress start.

@robert-zc-github commented on GitHub (Dec 3, 2023): Update: I also meet this on My MI 13(Android 14, MIUI 14.0.5), it seems that it is cauesd by a system bug. The permission had not been applied correctly, i correct that by relaunch the App permissions: in Settings -> Apps -> Permissions -> Permissions -> choose immich, select "Access photos and videos" permission to "Deny", and than reselect to "Always allow". When i return to immich, I found the backup progress start.
Author
Owner

@zhyfzy commented on GitHub (Dec 7, 2023):

Update: I also meet this on My MI 13(Android 14, MIUI 14.0.5), it seems that it is cauesd by a system bug. The permission had not been applied correctly, i correct that by relaunch the App permissions: in Settings -> Apps -> Permissions -> Permissions -> choose immich, select "Access photos and videos" permission to "Deny", and than reselect to "Always allow".

When i return to immich, I found the backup progress start.

Thank you, this works for me

@zhyfzy commented on GitHub (Dec 7, 2023): > Update: I also meet this on My MI 13(Android 14, MIUI 14.0.5), it seems that it is cauesd by a system bug. The permission had not been applied correctly, i correct that by relaunch the App permissions: in Settings -> Apps -> Permissions -> Permissions -> choose immich, select "Access photos and videos" permission to "Deny", and than reselect to "Always allow". > > When i return to immich, I found the backup progress start. Thank you, this works for me
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1515