Adamantcheese/Kuroba

App stuck on loading screen

Opened this issue · 2 comments

Overview

The app seems stuck in a loading boot while the same error is written in the logcat again and again.
The user only sees the splash screen, which is frozen. It makes the phone unresponsive for a few seconds.
This bug is probably related to #880 and others.
It happens way more frequently since the app lost the posting capability after the Cloudflare captcha.
The app is persistence-related, has to do with the pin table.

Steps to (probably) reproduce:

  1. Open a thread
  2. Overflow menu -> Open in browser
  3. Post something in the browser
  4. Come back and refresh the thread until the new post shows up
  5. Bookmark the thread
  6. Open the new post context menu -> "more" -> "Mark as my post"
  7. Wait some time until the thread is archived?

Error trace

2024-01-11 17:26:32.173 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Database helper
2024-01-11 17:26:32.213 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Database board manager
2024-01-11 17:26:32.213 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Database site manager
2024-01-11 17:26:32.214 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Site repository
2024-01-11 17:26:32.214 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Board repository
2024-01-11 17:26:32.214 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Board manager
2024-01-11 17:26:32.444 5956-5956/com.github.adamantcheese.chan.dev I/WebViewFactory: Loading com.google.android.webview version 120.0.6099.193 (code 609919333)
2024-01-11 17:26:32.451 5956-5956/com.github.adamantcheese.chan.dev W/linker: Warning: "/data/app/com.google.android.trichromelibrary_609919333-uQPc22vc9LfqGiqNkWfDyA==/base.apk!/lib/arm64-v8a/libmonochrome_64.so" unused DT entry: unknown processor-specific (type 0x70000001 arg 0x0) (ignoring)
2024-01-11 17:26:32.474 5956-5956/com.github.adamantcheese.chan.dev I/cr_WVCFactoryProvider: Loaded version=120.0.6099.193 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
2024-01-11 17:26:32.494 5956-6036/com.github.adamantcheese.chan.dev E/chromium: [0111/172632.494555:ERROR:variations_seed_loader.cc(37)] Seed missing signature.
2024-01-11 17:26:32.508 5956-5956/com.github.adamantcheese.chan.dev I/cr_LibraryLoader: Successfully loaded native library
2024-01-11 17:26:32.509 5956-5956/com.github.adamantcheese.chan.dev I/cr_CachingUmaRecorder: Flushed 6 samples from 6 histograms, 0 samples were dropped.
2024-01-11 17:26:32.522 5956-5956/com.github.adamantcheese.chan.dev D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2024-01-11 17:26:32.592 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | SiteModel: Config: null, Settings: {
      "settings": {
        "preference_captcha_type_chan4": {
          "value": "CHAN4_CUSTOM"
        },
        "preference_captcha_autosolve": {
          "value": false
        }
      }
    }
2024-01-11 17:26:32.869 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Database loadable manager
2024-01-11 17:26:32.871 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Site resolver
2024-01-11 17:26:32.871 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Database filter manager
2024-01-11 17:26:32.872 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Filter engine
2024-01-11 17:26:32.872 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Database pin manager
2024-01-11 17:26:32.872 5956-5956/com.github.adamantcheese.chan.dev D/Kuroba-dev | Dependency Injection: Watch manager
2024-01-11 17:26:32.914 5956-6030/com.github.adamantcheese.chan.dev E/Kuroba-dev | SiteRepository: Site is null, id: 0
2024-01-11 17:26:32.928 5956-6030/com.github.adamantcheese.chan.dev E/Kuroba-dev | DatabaseCallable: executeTask
    java.sql.SQLException: Transaction callable threw non-SQL exception
        at com.j256.ormlite.misc.TransactionManager.callInTransaction(TransactionManager.java:270)
        at com.j256.ormlite.misc.TransactionManager.callInTransaction(TransactionManager.java:178)
        at com.j256.ormlite.misc.TransactionManager.callInTransaction(TransactionManager.java:158)
        at com.github.adamantcheese.chan.core.database.DatabaseUtils$DatabaseCallable.call(DatabaseUtils.java:122)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'com.github.adamantcheese.chan.core.model.orm.Board com.github.adamantcheese.chan.core.site.Site.board(java.lang.String)' on a null object reference
        at com.github.adamantcheese.chan.core.database.DatabaseLoadableManager.updateLoadableFields(DatabaseLoadableManager.java:130)
        at com.github.adamantcheese.chan.core.database.DatabaseLoadableManager.refreshForeign(DatabaseLoadableManager.java:98)
        at com.github.adamantcheese.chan.core.database.DatabasePinManager.lambda$getPins$4(DatabasePinManager.java:79)
        at com.github.adamantcheese.chan.core.database.DatabasePinManager.$r8$lambda$KpOZf-p7z8VJ_XfpIvWmvqqznco(Unknown Source:0)
        at com.github.adamantcheese.chan.core.database.DatabasePinManager$$ExternalSyntheticLambda0.call(Unknown Source:2)
        at com.j256.ormlite.misc.TransactionManager.callInTransaction(TransactionManager.java:238)
        at com.j256.ormlite.misc.TransactionManager.callInTransaction(TransactionManager.java:178) 
        at com.j256.ormlite.misc.TransactionManager.callInTransaction(TransactionManager.java:158) 
        at com.github.adamantcheese.chan.core.database.DatabaseUtils$DatabaseCallable.call(DatabaseUtils.java:122) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 
2024-01-11 17:26:32.930 5956-5956/com.github.adamantcheese.chan.dev D/AndroidRuntime: Shutting down VM

Workaround:

Delete the offending rows in the pin table of the DB. To make sure just clean the entire table.

I trimmed down your log to where the error is, looks like something's null that shouldn't be.

It happened again, the thread was still alive this time. No "Mark as my post was involved". So the reduced list is now:

  1. Open a thread
  2. Overflow menu -> Open in browser
  3. Post something in the browser
  4. Come back to the app and wait or refresh the thread until the new post shows up
  5. Bookmark the thread
  6. Close the app.
  7. Open the app, bug happens