immich-app / immich

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

Mobile app fails to show new assets #9295

Closed natedawg closed 5 months ago

natedawg commented 5 months ago

The bug

The mobile app fails to refresh and show new photos that are visible on the web. Pull to refresh shows a error in the log.

The OS that Immich Server is running on

Docker on debian

Version of Immich Server

v1.10.3.1

Version of Immich Mobile App

v1.10.3.1

Platform with the issue

Your docker-compose.yml content

NA

Your .env content

NA

Reproduction steps

1. View the timeline on android.
2. Expect to see new photos that show up on the web.
3. New photos fail to load even on pull to refresh. A error is shown in the log.
...

Relevant log output

PlatformDispatcher - Catch all

type '_Map<String, dynamic>' is not a subtype of type 'String' in type cast

#0      _CastListBase.[] (dart:_internal/cast.dart:99)
#1      ListBase.toList (dart:collection/list.dart:225)
#2      AuditDeletesResponseDto.fromJson (package:openapi/model/audit_deletes_response_dto.dart:54)
#3      ApiClient.fromJson (package:openapi/api_client.dart:262)
#4      ApiClient.deserialize (package:openapi/api_client.dart:158)
<asynchronous suspension>
#5      AuditApi.getAuditDeletes (package:openapi/api/audit_api.dart:74)
<asynchronous suspension>
#6      AssetService._getRemoteAssetChanges (package:immich_mobile/shared/services/asset.service.dart:57)
<asynchronous suspension>
#7      SyncService._syncRemoteAssetChanges (package:immich_mobile/shared/services/sync.service.dart:161)
<asynchronous suspension>
#8      SyncService.syncRemoteAssetsToDb.<anonymous closure> (package:immich_mobile/shared/services/sync.service.dart:53)
<asynchronous suspension>
#9      AsyncMutex.run.<anonymous closure> (package:immich_mobile/utils/async_mutex.dart:15)
<asynchronous suspension>

Additional information

Using traefik as a reverse proxy.

alextran1502 commented 5 months ago

The current workaround is to logout and log back in, we are looking into identifying the root cause

kitkatod commented 5 months ago

I'm also running into the issue described here, however the workaround of logging out/in on the Android app does not resolve the issue and items are still missing from the timeline. Even uninstalling/reinstalling the app does not seem to affect the behavior.

Images are displayed when viewing the album through the "Backup Albums" selection menu, however not on the timeline and never synced.

If this should be a separate issue opened let me know.

alextran1502 commented 5 months ago

@kitkatod @natedawg Can you help me with some data points that if

  1. You are connecting your instance over a reverse proxy/VPN?
  2. You are using Android?
itzTheMeow commented 5 months ago

I'm also having the same issue on the iOS app. Using a VPN and my instance is behind an nginx reverse proxy.

Logging out and back in loads the new assets.

type '_Map<String, dynamic>' is not a subtype of type 'String' in type cast

#0      _CastListBase.[] (dart:_internal/cast.dart:99)
#1      ListBase.toList (dart:collection/list.dart:225)
#2      AuditDeletesResponseDto.fromJson (package:openapi/model/audit_deletes_response_dto.dart:54)
#3      ApiClient.fromJson (package:openapi/api_client.dart:262)
#4      ApiClient.deserialize (package:openapi/api_client.dart:158)
<asynchronous suspension>
#5      AuditApi.getAuditDeletes (package:openapi/api/audit_api.dart:74)
<asynchronous suspension>
#6      AssetService._getRemoteAssetChanges (package:immich_mobile/shared/services/asset.service.dart:57)
<asynchronous suspension>
#7      SyncService._syncRemoteAssetChanges (package:immich_mobile/shared/services/sync.service.dart:161)
<asynchronous suspension>
#8      SyncService.syncRemoteAssetsToDb.<anonymous closure> (package:immich_mobile/shared/services/sync.service.dart:53)
<asynchronous suspension>
#9      AssetService.refreshRemoteAssets (package:immich_mobile/shared/services/asset.service.dart:45)
<asynchronous suspension>
#10     AssetNotifier.getAllAsset (package:immich_mobile/shared/providers/asset.provider.dart:52)
<asynchronous suspension>
alextran1502 commented 5 months ago

Are you guys also have background backup enabled?

alextran1502 commented 5 months ago

If you guys install the app over the APK file in the release, can you try downloading this APK to see if it helps resolve the issue?

https://drive.google.com/file/d/1WLkzkqP4PLjdUFE17IJYwUdG-1xy4HnW/view?usp=sharing

itzTheMeow commented 5 months ago

I do not have backup enabled. Also all of my libraries are external.

kitkatod commented 5 months ago

I can confirm I'm currently running Immich behind a Caddy reverse proxy, and Immich on a Pixel 8 Pro.

After uninstalling Immich on Android and installing the referenced APK it seems to be finding all of the assets it missed!

alextran1502 commented 5 months ago

@kitkatod Thank you for help me test the APK. Can you try taking a few photos, wait a bit, then go to the app and see if the app can detect those new photos?

kitkatod commented 5 months ago

I just finished taking a few pictures. Images were uploaded quickly and appeared on the Immich website within seconds. I also followed the same steps after disabling wifi, and after a short delay images started to be uploaded.

natedawg commented 5 months ago

@alextran1502

Can you help me with some data points that if

1. You are connecting your instance over a reverse proxy/VPN?

2. You are using Android?

I'm using traefik as a reverse proxy and Android with no background sync. Most assets are in a external library.

FYI There was a major Traefik release v3.0 this week. I have not had time to go over the release notes or do any migration if needed. However it looks like others here are using different proxies though.

I will test the apk later today,

frejaya commented 5 months ago

I've had this problem as well. It usually goes away eventually and I keep the icon feature turned off so I mostly ignore it but it's been troublesome for creating albums.

I'm running Immich on Synology NAS DSM with the built-in reverse proxy feature that Synology provides in the control panel of DSM. App on iOS

alextran1502 commented 5 months ago

I am hoping the APK is the fix for the solution so we can push out an update for the next release to fix this issue

natedawg commented 5 months ago

Just tested the apk and it's working. New photos show up on Android when opening the app and when refreshing. There are no errors in the log.

freemjohn commented 5 months ago

https://github.com/immich-app/immich/issues/9389 Direct connection with stunnel does not fixes this issue.

alextran1502 commented 5 months ago

@freemjohn can you try the APK linked in this issue?

freemjohn commented 5 months ago

@freemjohn can you try the APK linked in this issue?

Harder than looks, can't just update, different signature, forced to resetup

freemjohn commented 5 months ago

Looks like fixed in test version above(cant be updated) and latest update(thats the way) 1.105.1

freemjohn commented 5 months ago

Tested on +4 devices, still need to relogin or no new photos shown 2/4 devices.