seedvault-app / seedvault

A backup application for the Android Open Source Project.
1.31k stars 75 forks source link

Can't read metatada cache after phone died during backup #542

Closed mateowoetam closed 6 months ago

mateowoetam commented 1 year ago
type: crash
osVersion: google/coral/coral:13/TP1A.221005.002.B2/2023060700:user/release-keys
package: com.stevesoltys.seedvault:33030030
process: com.stevesoltys.seedvault
processUptime: 833 + 2491 ms

java.lang.AssertionError: Error reading metadata from cache
    at com.stevesoltys.seedvault.metadata.MetadataManager.getMetadata(MetadataManager.kt:48)
    at com.stevesoltys.seedvault.metadata.MetadataManager.getBackupToken(MetadataManager.kt:209)
    at com.stevesoltys.seedvault.App.migrateTokenFromMetadataToSettingsManager(App.kt:113)
    at com.stevesoltys.seedvault.App.access$migrateTokenFromMetadataToSettingsManager(App.kt:44)
    at com.stevesoltys.seedvault.App$onCreate$1.invoke(App.kt:80)
    at com.stevesoltys.seedvault.App$onCreate$1.invoke(App.kt:79)
    at com.stevesoltys.seedvault.AppKt.permitDiskReads(App.kt:142)
    at com.stevesoltys.seedvault.App.onCreate(App.kt:79)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1282)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6790)
    at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2137)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7903)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ExecInit.main(ExecInit.java:49)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)
Caused by: java.io.IOException
    at com.stevesoltys.seedvault.metadata.MetadataManager.getMetadata(MetadataManager.kt:45)
    ... 20 more
grote commented 1 year ago

We probably need a recovery strategy when local metadata is corrupted. Related to #213

grote commented 6 months ago

In https://github.com/seedvault-app/seedvault/pull/614 we now start from fresh metadata and start a new restore set with it.