Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrading from 1.6.2 to 1.6.10 throws migration exception for the encryption keys #8799

Open
unplugged-maksim opened this issue Apr 3, 2024 · 5 comments
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@unplugged-maksim
Copy link

Steps to reproduce

  1. Install Element messenger version 1.6.2 or below
  2. Follow the auth process
  3. Send some messages
  4. try to install the latest 1.6.10 or above version, the app crashes at startup and you loose the session and keys

Outcome

Upgrade from old version to new

What happened instead?

Lost my session and encryption keys.

Your phone model

Xiaomi 12T PRo

Operating system version

14

Application version and app store

Element 1.6.2 kotlin crypto

Homeserver

matrix.unpluggedsystems.app

Will you send logs?

Yes

Are you willing to provide a PR?

No

@unplugged-maksim unplugged-maksim added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Apr 3, 2024
@unplugged-maksim
Copy link
Author

Crash logs:

Failure while calling rust migration method
2024-04-04 14:44:12.763 9076-9201 MigrateEAtoEROperation im.vector.app.debug E ExtractMigrationDataFailure(cause=org.matrix.rustcomponents.sdk.crypto.MigrationException$Generic: errorMessage=Failed to run migrations)
2024-04-04 14:44:12.763 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.db.migration.rust.ExtractMigrationDataUseCase.extractData(ExtractMigrationDataUseCase.kt:34)
2024-04-04 14:44:12.763 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.session.MigrateEAtoEROperation.dynamicExecute(MigrateEAtoEROperation.kt:70)
2024-04-04 14:44:12.763 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.db.migration.MigrateCryptoTo022.doMigrate(MigrateCryptoTo022.kt:40)
2024-04-04 14:44:12.763 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.util.database.RealmMigrator.perform(RealmMigrator.kt:31)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.db.RealmCryptoStoreMigration.doMigrate(RealmCryptoStoreMigration.kt:93)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.util.database.MatrixRealmMigration.migrate(MatrixRealmMigration.kt:31)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.BaseRealm$6.onMigrationNeeded(BaseRealm.java:892)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.internal.OsSharedRealm.runMigrationCallback(OsSharedRealm.java:581)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.internal.OsSharedRealm.nativeGetSharedRealm(Native Method)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.internal.OsSharedRealm.(OsSharedRealm.java:175)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.internal.OsSharedRealm.getInstance(OsSharedRealm.java:260)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.BaseRealm.(BaseRealm.java:142)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.BaseRealm.(BaseRealm.java:109)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.Realm.(Realm.java:161)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.Realm.createInstance(Realm.java:535)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.RealmCache.createInstance(RealmCache.java:508)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.RealmCache.doCreateRealmOrGetFromCache(RealmCache.java:461)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.RealmCache.createRealmOrGetFromCache(RealmCache.java:422)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at io.realm.Realm.getInstance(Realm.java:464)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.db.HelperKt.doRealmTransaction(Helper.kt:62)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.RustCryptoStore.(RustCryptoStore.kt:89)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.RustCryptoStore_Factory.newInstance(RustCryptoStore_Factory.java:82)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.RustCryptoStore_Factory.get(RustCryptoStore_Factory.java:66)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.RustCryptoStore_Factory.get(RustCryptoStore_Factory.java:17)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.RustCryptoService_Factory.get(RustCryptoService_Factory.java:143)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.RustCryptoService_Factory.get(RustCryptoService_Factory.java:27)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at dagger.internal.DelegateFactory.get(DelegateFactory.java:36)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.session.room.timeline.RoomSummaryEventDecryptor$1.invokeSuspend(RoomSummaryEventDecryptor.kt:72)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at android.os.Handler.handleCallback(Handler.java:942)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at android.os.Handler.dispatchMessage(Handler.java:99)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at android.os.Looper.loopOnce(Looper.java:240)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at android.os.Looper.loop(Looper.java:351)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at android.os.HandlerThread.run(HandlerThread.java:67)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E Caused by: org.matrix.rustcomponents.sdk.crypto.MigrationException$Generic: errorMessage=Failed to run migrations
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeMigrationError.read(matrix_sdk_crypto_ffi.kt:5197)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeMigrationError.read(matrix_sdk_crypto_ffi.kt:5192)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(matrix_sdk_crypto_ffi.kt:171)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(matrix_sdk_crypto_ffi.kt:183)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeMigrationError.liftFromRustBuffer(matrix_sdk_crypto_ffi.kt:5192)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeMigrationError.liftFromRustBuffer(matrix_sdk_crypto_ffi.kt:5192)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterRustBuffer$DefaultImpls.lift(matrix_sdk_crypto_ffi.kt:184)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeMigrationError.lift(matrix_sdk_crypto_ffi.kt:5192)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeMigrationError.lift(matrix_sdk_crypto_ffi.kt:5192)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.MigrationException$ErrorHandler.lift(matrix_sdk_crypto_ffi.kt:5186)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.MigrationException$ErrorHandler.lift(matrix_sdk_crypto_ffi.kt:5185)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.Matrix_sdk_crypto_ffiKt.checkCallStatus(matrix_sdk_crypto_ffi.kt:234)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.Matrix_sdk_crypto_ffiKt.access$checkCallStatus(matrix_sdk_crypto_ffi.kt:1)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.rustcomponents.sdk.crypto.Matrix_sdk_crypto_ffiKt.migrate(matrix_sdk_crypto_ffi.kt:7843)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.session.MigrateEAtoEROperation$dynamicExecute$1.invoke(MigrateEAtoEROperation.kt:71)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.session.MigrateEAtoEROperation$dynamicExecute$1.invoke(MigrateEAtoEROperation.kt:70)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.db.migration.rust.ExtractMigrationDataUseCase.extract(ExtractMigrationDataUseCase.kt:52)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E at org.matrix.android.sdk.internal.crypto.store.db.migration.rust.ExtractMigrationDataUseCase.extractData(ExtractMigrationDataUseCase.kt:32)
2024-04-04 14:44:12.764 9076-9201 MigrateEAtoEROperation im.vector.app.debug E ... 37 more

@toshanmugaraj
Copy link

I face the same issue, and this exception is raised from the rust sdk makes, it harder to debug

@yostyle
Copy link
Contributor

yostyle commented May 28, 2024

Before upgrading to element 1.6.10, could you try this modification

@toshanmugaraj
Copy link

Before upgrading to element 1.6.10, could you try this modification

ok let me try

@toshanmugaraj
Copy link

Before upgrading to element 1.6.10, could you try this modification

Yes that changes fix the crash issue. @yostyle thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

3 participants