immich-app / immich

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

Since apk v1.105.0 login/upload possible but timeline won't refresh, keeps spinning #9534

Closed Deathproof76 closed 4 months ago

Deathproof76 commented 5 months ago

The bug

Using the android mobile app from the playstore on a Samsung S23U: Since v1.105.0 I get weird errors where photos will get uploaded but not refreshed in the app. Tried to logout and in again via google oauth and mail/pw. But after relogin the timelime is building indefinitely.

I also tried direct ip in LAN. It somehow helps switching between Wifi and mobile Data. After doing that I'm able to see the remote photos and can upload photos but the gallery won't refresh and the backup cloud icon is crossed out*. The uploaded photos can be seen in the Webui though. I used a secondary android phone (some rooted xiaomi with a custom rom) to install v1.105.0 from github and compare with v1.104.0. due to https://github.com/immich-app/immich/issues/9495#issuecomment-2113818459

v1.104.0. works perfectly on the secondary phone but v1.105.0 shows the exact same issues as on the primary android phone.

*(after turning wifi off and waiting for mobile data, the "building timeline" vanishes and I can see photos but it seems to keep building in the background, down left "fotos" is still spinning) d8349746-099b-4491-8151-5fcaefc1824b

update: I can access remote albums, which also show the correct backup status (only on server/on device and server) it seems to be mainly a problem with the timeline. I can search things and filter people/places.

Can't see any unusual in the docker logs, no warnings, errors, nothing:

[Nest] 171  - 05/16/2024, 3:42:58 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    E6ynr_a3d_NhrmPbAAAi
[Nest] 171  - 05/16/2024, 3:42:58 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: E6ynr_a3d_NhrmPbAAAi
[Nest] 171  - 05/16/2024, 3:42:59 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    1-_EQHAJTMkWn8RpAAAk
[Nest] 171  - 05/16/2024, 3:42:59 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    RX_mGm_exUzRw-6IAAAm
[Nest] 171  - 05/16/2024, 3:43:31 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: RX_mGm_exUzRw-6IAAAm
[Nest] 171  - 05/16/2024, 3:43:33 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    BmbhCQSv4hVrdZlfAAAo
[Nest] 171  - 05/16/2024, 3:43:39 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: BmbhCQSv4hVrdZlfAAAo
[Nest] 171  - 05/16/2024, 3:43:39 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: 1-_EQHAJTMkWn8RpAAAk
[Nest] 171  - 05/16/2024, 3:43:39 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: uN7sAk-oJzB0tUGHAAAe
[Nest] 171  - 05/16/2024, 3:43:39 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: PN-L07X6bTtW-oBNAAAg
[Nest] 171  - 05/16/2024, 4:47:53 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: KK_9G-sHe9W1-O3CAAAF
[Nest] 171  - 05/16/2024, 5:01:15 PM     LOG [ImmichServer] [EventRepository] Websocket Connect:    h9UxaZ-tza0X7gN2AAAq
[Nest] 171  - 05/16/2024, 5:01:16 PM     LOG [ImmichServer] [EventRepository] Websocket Disconnect: h9UxaZ-tza0X7gN2AAAq
[Nest] 244  - 05/16/2024, 5:16:04 PM     LOG [ImmichMicroservices] [MediaService] Successfully generated WEBP image preview for asset 152589db-e996-4db3-a0b9-f0faf3b49be3
[05/16/24 17:16:04] INFO     Setting                                            
                             'XLM-Roberta-Large-ViT-H-14__frozen_laion5b_s13b_b9
                             0k' execution providers to                         
                             ['CPUExecutionProvider'], in descending order of   
                             preference                                         
[05/16/24 17:16:04] INFO     Loading clip model                                 
                             'XLM-Roberta-Large-ViT-H-14__frozen_laion5b_s13b_b9
                             0k' to memory                                      
[05/16/24 17:16:04] INFO     Setting 'buffalo_l' execution providers to         
                             ['CPUExecutionProvider'], in descending order of   
                             preference                                         
[Nest] 244  - 05/16/2024, 5:16:04 PM     LOG [ImmichMicroservices] [MediaService] Successfully generated WEBP image thumbnail for asset 152589db-e996-4db3-a0b9-f0faf3b49be3
[Nest] 244  - 05/16/2024, 5:16:05 PM     LOG [ImmichMicroservices] [MediaService] Successfully generated WEBP image preview for asset f2009d45-a27c-48d6-b9a0-073b73bbfb54
[Nest] 244  - 05/16/2024, 5:16:05 PM     LOG [ImmichMicroservices] [MediaService] Successfully generated WEBP image thumbnail for asset f2009d45-a27c-48d6-b9a0-073b73bbfb54
[05/16/24 17:16:08] INFO     Loading facial recognition model 'buffalo_l' to    
                             memory                                             

The mobile logs show Key 'currentUser' not found in Store, Error while getting remote assets | ApiException 401: {"message":"Invalid user token","error":"Unauthorized","statusCode":401} , PersonService | Error while fetching curated people | ApiException 400: Socket operation failed: GET /person (Inner exception: Failed host lookup: 'immich.mydomain.com')

The OS that Immich Server is running on

docker

Version of Immich Server

v1.105.1

Version of Immich Mobile App

v1.105.0

Platform with the issue

Your docker-compose.yml content

irrelevant

Your .env content

irrelevant

Reproduction steps

1. install apk v1.105.0
2. try to open or login
3. gallery won't refresh or stuck on timeline building

Relevant log output

2024-05-16 14:50:02.199042 | SEVERE   | ImmichErrorLogger    | PlatformDispatcher - Catch all | Key 'currentUser' not found in Store |
#0      Store.get (package:immich_mobile/entities/store.entity.dart:35)
#1      SyncService._syncRemoteAlbumsToDb (package:immich_mobile/services/sync.service.dart:297)
#2      SyncService.syncRemoteAlbumsToDb.<anonymous closure> (package:immich_mobile/services/sync.service.dart:66)
#3      new Future.sync (dart:async/future.dart:305)
#4      AsyncMutex.run.<anonymous closure> (package:immich_mobile/utils/async_mutex.dart:17)
#5      _RootZone.run (dart:async/zone.dart:1655)
#6      _FutureListener.handleWhenComplete (dart:async/future_impl.dart:205)
#7      Future._propagateToListeners.handleWhenCompleteCallback (dart:async/future_impl.dart:808)
#8      Future._propagateToListeners (dart:async/future_impl.dart:864)
#9      Future._completeWithValue (dart:async/future_impl.dart:643)
<asynchronous suspension>

2024-05-16 14:50:02.198689 | SEVERE   | AssetService         | Error while getting remote assets | ApiException 401: {"message":"Invalid user token","error":"Unauthorized","statusCode":401} |
#0      SyncApi.getFullSyncForUser (package:openapi/api/sync_api.dart:101)
<asynchronous suspension>
#1      AssetService._getRemoteAssets (package:immich_mobile/services/asset.service.dart:116)
<asynchronous suspension>
#2      SyncService._syncRemoteAssetsForUser (package:immich_mobile/services/sync.service.dart:241)
<asynchronous suspension>
#3      SyncService._syncRemoteAssetsFull (package:immich_mobile/services/sync.service.dart:231)
<asynchronous suspension>
#4      SyncService.syncRemoteAssetsToDb.<anonymous closure> (package:immich_mobile/services/sync.service.dart:56)
<asynchronous suspension>
#5      AsyncMutex.run.<anonymous closure> (package:immich_mobile/utils/async_mutex.dart:15)
<asynchronous suspension>

2024-05-16 13:54:33.162050 | SEVERE   | PersonService        | Error while fetching curated people | ApiException 400: Socket operation failed: GET /person (Inner exception: Failed host lookup: 'immich.mydomain.com')

#0      IOClient.send (package:http/src/io_client.dart:94)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      ApiClient.invokeAPI (package:openapi/api_client.dart:101)
<asynchronous suspension>
#3      PersonApi.getAllPeople (package:openapi/api/person_api.dart:103)
<asynchronous suspension>
#4      PersonService.getAllPeople (package:immich_mobile/services/person.service.dart:25)
<asynchronous suspension>
#5      getAllPeople (package:immich_mobile/providers/search/people.provider.dart:16)
<asynchronous suspension>
#6      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:348)
<asynchronous suspension>
 |
#0      ApiClient.invokeAPI (package:openapi/api_client.dart:104)
<asynchronous suspension>
#1      PersonApi.getAllPeople (package:openapi/api/person_api.dart:103)
<asynchronous suspension>
#2      PersonService.getAllPeople (package:immich_mobile/services/person.service.dart:25)
<asynchronous suspension>
#3      getAllPeople (package:immich_mobile/providers/search/people.provider.dart:16)
<asynchronous suspension>
#4      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:348)
<asynchronous suspension>

2024-05-16 13:54:33.161549 | SEVERE   | SearchService        | Failed to getExploreData | ApiException 400: Socket operation failed: GET /search/explore (Inner exception: Failed host lookup: 'immich.mydomain.com')

#0      IOClient.send (package:http/src/io_client.dart:94)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93)
<asynchronous suspension>
#2      ApiClient.invokeAPI (package:openapi/api_client.dart:101)
<asynchronous suspension>
#3      SearchApi.getExploreData (package:openapi/api/search_api.dart:90)
<asynchronous suspension>
#4      SearchService.getExploreData (package:immich_mobile/services/search.service.dart:116)
<asynchronous suspension>
#5      getPreviewPlacesProvider.<anonymous closure> (package:immich_mobile/providers/search/search_page_state.provider.dart:10)
<asynchronous suspension>
#6      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:348)
<asynchronous suspension>
 |
#0      ApiClient.invokeAPI (package:openapi/api_client.dart:104)
<asynchronous suspension>
#1      SearchApi.getExploreData (package:openapi/api/search_api.dart:90)
<asynchronous suspension>
#2      SearchService.getExploreData (package:immich_mobile/services/search.service.dart:116)
<asynchronous suspension>
#3      getPreviewPlacesProvider.<anonymous closure> (package:immich_mobile/providers/search/search_page_state.provider.dart:10)
<asynchronous suspension>
#4      FutureHandlerProviderElementMixin.handleFuture.<anonymous closure>.<anonymous closure> (package:riverpod/src/async_notifier/base.dart:348)
<asynchronous suspension>

Additional information

I'm using the https://github.com/imagegenius/docker-immich monolythic dockerimage with tensorchord/pgvecto-rs:pg16-v0.2.0

Deathproof76 commented 5 months ago

I don't know if it's my place to do so, probably too early also, but I'd like to encourage @wardwygaerts @xs2usun @jarelllama to try out the apk from https://github.com/immich-app/immich/pull/9980#issuecomment-2149070097 In my case it helped with identifying a single asset with problematic metadata, which caused the whole problem for me. After deleting the asset from the database (as a quick fix) everything works for me now with the standard Playstore v1.105 apk too. If it's the same issue with your instance you need to turn on fine logging in the mobile app with the pr apk to identify the exact id of the offender. Thank you again @fyfrey and @alextran1502

xs2usun commented 5 months ago

Thank you! It fixed it!

With the app I could locate the same strange date in the db. Some movie of a Toyota Supra I had saved from the internet was causing the problem. My error log:

2024-06-05 14:14:41.575437 | SEVERE | AssetService | getRemoteAssets received too many almost empty chunks, stopping. Not all remote assets could be fetched from the server for user user. | 2024-06-05 14:14:41.575311 | FINE | AssetService | Received 1 assets ranging from (1731-08-07 07:03:48.000Z,f9f05b1b-7b69-485b-9821-d68f18ac8d8f) to (1731-08-07 07:03:48.000Z,f9f05b1b-7b69-485b-9821-d68f18ac8d8f) |

In table assets with id='f9f05b1b-7b69-485b-9821-d68f18ac8d8f' I looked up which file was causing the problem with the weird date. I removed the row from the table.

Then I opened the Immich app on my iPad and the timeline appears correct. I deinstalled the immich app from my Android phone. Installed the latest app from the Play store and the timeline appears fine. So everything was also caused by this strange date in the db. I inspected the file with ExifTool and the Exif data was empty. I also checked the properties of the file in WIndows and it showed the creation date and modified date of 2002-1-7 09:11. I have no idea what caused the strange line in the db.

wardwygaerts commented 5 months ago

I quicky checked the apk from #9980, and noticed my timeline loaded almost immediately, with all my assets (as far as I can see). So I thought, maybe I already removed a 'bad' asset (I cleaned up my pictures last week), so I installed the PlayStore version, but loading timeline was taking ages. Reinstalled the apk and timeline back ok... What are the best settings for the logs to troubleshoot or receive more info?

xs2usun commented 5 months ago

It’s mentioned above in: https://github.com/immich-app/immich/issues/9534#issuecomment-2149436869

Deathproof76 commented 5 months ago

What are the best settings for the logs to troubleshoot or receive more info?

@wardwygaerts With the pr apk like this 336426389-92e1e9d6-2a75-4ede-81c6-9a2f9c88c541

wardwygaerts commented 5 months ago

Thanks!

I also found the bad asset!

2024-06-06 01:27:20.394787 | FINE     | AssetService         | Received 1 assets ranging from (0004-04-04 16:06:30.000Z,7f6a33c8-986e-4036-be11-608a02c686bb) to (0004-04-04 16:06:30.000Z,7f6a33c8-986e-4036-be11-608a02c686bb) |
2024-06-06 01:27:20.370140 | FINE     | AssetService         | Requesting assets older than (0004-04-04 16:06:30.000Z,7f6a33c8-986e-4036-be11-608a02c686bb) |

And this was due my own fault, I changed the date for this image, and entered 004 in stead of 2024...

Corrected the date for this image, reinstalled 1.105 from Playstore, timeline build in couple of seconds!

safehome-jdev commented 5 months ago

This may be a silly question, however, I'm just checking the basics here... is immich.mydomain.com the configured domain or was that replaced/redacted by you?

If so, perhaps in the future you can put some type of placeholder there ( like immich.[DOMAIN].com or immich.<DOMAIN>.com), just so we can identify when something is purposefully changed and not and not assume a typo.

Just a small suggestion is all πŸ™‚

Deathproof76 commented 5 months ago

@safehome-jdev Oh, I didn't think of the possibility that there might be any confusion. Sorry about that. I've redacted my domain that way. Next time I'll use immich.[DOMAIN].com for sure πŸ™‚πŸ‘