immich-app / immich

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

Android app - no photos/places at all in the map view: "No photos in this area" #9218

Closed dgtal1 closed 1 month ago

dgtal1 commented 5 months ago

The bug

When I navigate to the map view in the app - it does not show any photos or places. The UI becomes unresponsive - the navigation buttons do not work. I recorded a video depicting this: https://www.youtube.com/shorts/TUqUN7hTGCs

My source of photos if External library with about 55k photos. DB query run quite fast as my postgre DB is hosted on SSD. Everything works fine in the web app. It's just the Android app that is failing.

The OS that Immich Server is running on

Synology DSM

Version of Immich Server

v1.103.1

Version of Immich Mobile App

v1.103.1 build.137

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
      - ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
      - ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video      
      - /etc/localtime:/etc/localtime:ro
      - "/volume1/photo:/external_originals/photo:ro"
    env_file:
      - .env
    ports:
      - 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
      - ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
      - ${ENCODED_VIDEO_LOCATION}:/usr/src/app/upload/encoded-video      
      - /etc/localtime:/etc/localtime:ro
      - "/volume1/photo:/external_originals/photo: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:      
      - ${MODEL_CACHE_LOCATION}:/cache  #- model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
    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}
    volumes:      
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data    # - pgdata:/var/lib/postgresql/data
    restart: always

    ports:
      - "5433:5432"

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=/volume1/photo/immich_upload
#UPLOAD_LOCATION=./upload
THUMB_LOCATION=./artifacts/thumbs
ENCODED_VIDEO_LOCATION=./artifacts/encoded-video

MODEL_CACHE_LOCATION=./artifacts/model-cache

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

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=***

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=***
DB_DATABASE_NAME=immich
DB_DATA_LOCATION=./db_data

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Enter the Search view
2. Click 'Your map' tile
3. Observe the issue
...

Relevant log output

2024-05-02 13:08:30.730972 | INFO     | AssetNotifier        | Load partner assets: 811ms |
2024-05-02 13:08:09.332583 | INFO     | AssetNotifier        | Load partner assets: 778ms |
2024-05-02 13:08:03.791186 | INFO     | AssetNotifier        | Load partner assets: 579ms |
2024-05-02 13:07:32.941282 | INFO     | AssetNotifier        | Load partner assets: 503ms |
2024-05-02 13:07:21.171924 | INFO     | AssetNotifier        | Load partner assets: 516ms |
2024-05-02 13:06:28.473824 | INFO     | AssetNotifier        | Load partner assets: 478ms |
2024-05-02 13:05:45.005090 | INFO     | AssetNotifier        | Load partner assets: 452ms |
2024-05-02 13:01:24.349887 | INFO     | AssetNotifier        | Load partner assets: 680ms |
2024-05-02 12:23:51.085616 | SEVERE   | ImmichErrorLogger    | PlatformDispatcher - Catch all | PlatformException(error, Calling addLayer when a newer style is loading/has loaded., null, java.lang.IllegalStateException: Calling addLayer when a newer style is loading/has loaded.
    at com.mapbox.mapboxsdk.maps.a0.y(Unknown Source:19)
    at com.mapbox.mapboxsdk.maps.a0.c(Unknown Source:2)
    at com.mapbox.mapboxgl.MapboxMapController.X(Unknown Source:34)
    at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(Unknown Source:1147)
    at n8.j$a.a(Unknown Source:17)
    at b8.c.l(Unknown Source:18)
    at b8.c.m(Unknown Source:41)
    at b8.c.i(Unknown Source:0)
    at b8.b.run(Unknown Source:12)
    at android.os.Handler.handleCallback(Unknown Source:2)
    at android.os.Handler.dispatchMessage(Unknown Source:4)
    at android.os.Looper.loopOnce(Unknown Source:182)
    at android.os.Looper.loop(Unknown Source:82)
    at android.app.ActivityThread.main(Unknown Source:123)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11)
    at com.android.internal.os.ZygoteInit.main(Unknown Source:312)
) |
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334)
<asynchronous suspension>
#2      MethodChannelMaplibreGl.addHeatmapLayer (package:maplibre_gl_platform_interface/src/method_channel_maplibre_gl.dart:780)
<asynchronous suspension>
#3      MaplibreMapController.addHeatmapLayer (package:maplibre_gl/src/controller.dart:655)
<asynchronous suspension>
#4      MapMarkers.reloadAllLayersForMarkers (package:immich_mobile/extensions/maplibrecontroller_extensions.dart:43)
<asynchronous suspension>

2024-05-02 12:23:48.417977 | INFO     | AssetNotifier        | Load partner assets: 986ms |
2024-05-02 13:08:09.332583 | INFO     | AssetNotifier        | Load partner assets: 778ms |
2024-05-02 13:08:03.791186 | INFO     | AssetNotifier        | Load partner assets: 579ms |
2024-05-02 13:07:32.941282 | INFO     | AssetNotifier        | Load partner assets: 503ms |
2024-05-02 13:07:21.171924 | INFO     | AssetNotifier        | Load partner assets: 516ms |
2024-05-02 13:06:28.473824 | INFO     | AssetNotifier        | Load partner assets: 478ms |
2024-05-02 13:05:45.005090 | INFO     | AssetNotifier        | Load partner assets: 452ms |
2024-05-02 13:01:24.349887 | INFO     | AssetNotifier        | Load partner assets: 680ms |
2024-05-02 12:23:51.085616 | SEVERE   | ImmichErrorLogger    | PlatformDispatcher - Catch all | PlatformException(error, Calling addLayer when a newer style is loading/has loaded., null, java.lang.IllegalStateException: Calling addLayer when a newer style is loading/has loaded.
    at com.mapbox.mapboxsdk.maps.a0.y(Unknown Source:19)
    at com.mapbox.mapboxsdk.maps.a0.c(Unknown Source:2)
    at com.mapbox.mapboxgl.MapboxMapController.X(Unknown Source:34)
    at com.mapbox.mapboxgl.MapboxMapController.onMethodCall(Unknown Source:1147)
    at n8.j$a.a(Unknown Source:17)
    at b8.c.l(Unknown Source:18)
    at b8.c.m(Unknown Source:41)
    at b8.c.i(Unknown Source:0)
    at b8.b.run(Unknown Source:12)
    at android.os.Handler.handleCallback(Unknown Source:2)
    at android.os.Handler.dispatchMessage(Unknown Source:4)
    at android.os.Looper.loopOnce(Unknown Source:182)
    at android.os.Looper.loop(Unknown Source:82)
    at android.app.ActivityThread.main(Unknown Source:123)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11)
    at com.android.internal.os.ZygoteInit.main(Unknown Source:312)
) |
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334)
<asynchronous suspension>
#2      MethodChannelMaplibreGl.addHeatmapLayer (package:maplibre_gl_platform_interface/src/method_channel_maplibre_gl.dart:780)
<asynchronous suspension>
#3      MaplibreMapController.addHeatmapLayer (package:maplibre_gl/src/controller.dart:655)
<asynchronous suspension>
#4      MapMarkers.reloadAllLayersForMarkers (package:immich_mobile/extensions/maplibrecontroller_extensions.dart:43)
<asynchronous suspension>

Additional information

In the web app it takes about 6-8 seconds to show the places on the map every time I tried. In the mobile app I wanted over 30 seconds and nothing. Tried multiple times as well.

The same happens on my iPad with the iPadOS immich app including UI being frozen/unresponsive.

schuhbacca commented 5 months ago

Is this over proxy or local ip?

dgtal1 commented 5 months ago

Is this over proxy or local ip?

Both. Doesn't matter how I acccess my immich instance in the app - via local IP or proxy.

New finding: after waiting for ages something gets loaded finally - looks like an image from a thermal camera. Altough the performance is still terrible and the buttons are frozen for a long while when I move the map.

There's a huge performance difference between the web app and the mobile apps. The initial view doesn't freeze in the web app and it's responsive all the time. The mobile apps need 3 times as much time to render the initial view with all the photos. I think the thermal map rendering may be the problem. It looks nice, but doesn't really add much value to me. The simpler view of the web app is much faster. Actually I very much like how Photoprism does this. It's fast and shows round thumbs from the places rather than just colored circles. The overall look is better. Perhaps an idea immich could borrow from it 😉

schuhbacca commented 5 months ago

Bug for mobile app performance is open here: https://github.com/immich-app/immich/issues/4174

alextran1502 commented 5 months ago

@dgtal1 fyi, we are looking at reworking these mechanism for the mobile app. Right now it is fetching all data before building the UI, since it was coming from my initial naive design where I don't have a lot of data to begin with 😅. We plan to make those into streaming and rebuilding at the same time instead.

dgtal1 commented 5 months ago

@dgtal1 fyi, we are looking at reworking these mechanism for the mobile app. Right now it is fetching all data before building the UI, since it was coming from my initial naive design where I don't have a lot of data to begin with 😅. We plan to make those into streaming and rebuilding at the same time instead.

Great news. Thanks and looking forward!

vb0 commented 4 months ago

@dgtal1 fyi, we are looking at reworking these mechanism for the mobile app. Right now it is fetching all data before building the UI, since it was coming from my initial naive design where I don't have a lot of data to begin with 😅. We plan to make those into streaming and rebuilding at the same time instead.

Just to confirm, as I have multiple times more pictures than the originator of this issue and my mobile map doesn't load too (the feed also doesn't load anything except the very few local pics, and it shows "Photos" "tab" rotating all the time): this will never work on the current design, right?

dgtal1 commented 1 month ago

It's a shame that the fix for this was first promised by @alextran1502 and now it's not planned 😞 I think the current design of the mobile app isn't well suited for large libraries performance-wise as can be seen in my case and case of @vb0. But well, it's a free software. It is what it is

alextran1502 commented 1 month ago

@dgtal1 I think GitHub's "Not Planned" wording might bring the wrong message here; it means that there are other similar GitHub issues that reported this issue, so we are consolidating into one issue instead of leaving multiple similar issues open. Since GitHub let you close an issue with "Resolved" or "Not planed", we chose Not Planed because the issue isn't resolved yet. Just trying to clean up our bug back log for ease of tracking

dgtal1 commented 1 month ago

oh, I wasn't aware of that limitation of Github. Thanks for clarifying! Great news you're still planning to work on the fix for this!🎉 I think it's possible to close with comment, so for similar cases in the future the maintainer could give such a comment. Thanks again!

bo0tzz commented 1 month ago

I do usually add a comment when closing duplicates, but in this case there was already one upthread so it seemed redundant.