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

Failed storage upgrade for "PreviouslyVerifiedButNoLonger" #4424

Closed
Assignees

Comments

@andybalaam
Copy link
Member

andybalaam commented Dec 17, 2024

In #4067 , we changed the storage format for identity state, but forgot to provide a migration, so if an identity was in state PreviouslyVerifiedButNoLonger, it causes a crash.

See rageshakes here: https://github.com/element-hq/element-android-rageshakes/issues?q=is%3Aissue+is%3Aopen+VerifiedStateOrBool+

2024-12-09T07:54:05*227GMT+00:00Z 604 D/ /Tag: TRACE matrix_sdk_crypto::backups: Verifying backup auth data backup_info=MegolmBackupV1Curve25519AesSha2(MegolmV1AuthData { public_key: "curve25519:JDef8cKMe1HDVC53LkLTr2omw572lhdCU/RtjMupCE4", signatures: Signatures({"@docent053:element.utnet.tech": {"ed25519:QIQLPUFJBE": Ok(Ed25519("ed25519:pxQMD6NMH1+kJ45uMMCbybQHn914Jo9xP4HePv7TF8zE54HlXqvtMdyDgVvPahzIPkyI2W87Bw3NzyYWdgl3AQ")), "ed25519:hPHmYphgXT0AcsNSntCTtfPcmpNtiN/q6x+izRHn4K0": Ok(Ed25519("ed25519:tfts0BYUOVaHt2ToL77PQwLlt5XmokI5Z5AwGak/Q0raXQfp5Z6szmlDId3dwOTi7n+ydNRCqCEWm/6Lkx6gCA"))}}), extra: {} })

2024-12-09T07:54:05*252GMT+00:00Z org.matrix.rustcomponents.sdk.crypto.CryptoStoreException$CryptoStore: data did not match any variant of untagged enum VerifiedStateOrBool
	at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeCryptoStoreError.read(SourceFile:8)
	at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeCryptoStoreError.read(SourceFile:1)
	at org.matrix.rustcomponents.sdk.crypto.FfiConverter$DefaultImpls.liftFromRustBuffer(SourceFile:13)
	at org.matrix.rustcomponents.sdk.crypto.FfiConverterRustBuffer$DefaultImpls.liftFromRustBuffer(SourceFile:6)
	at org.matrix.rustcomponents.sdk.crypto.FfiConverterTypeCryptoStoreError.liftFromRustBuffer(SourceFile:1)
	at org.matrix.rustcomponents.sdk.crypto.FfiConverterRustBuffer$DefaultImpls.lift(SourceFile:6)
	at org.matrix.rustcomponents.sdk.crypto.CryptoStoreException$ErrorHandler.lift(SourceFile:3)
	at org.matrix.rustcomponents.sdk.crypto.CryptoStoreException$ErrorHandler.lift(SourceFile:1)
	at org.matrix.rustcomponents.sdk.crypto.Matrix_sdk_crypto_ffiKt.uniffiCheckCallStatus(SourceFile:79)
	at org.matrix.rustcomponents.sdk.crypto.OlmMachine.verifyBackup(SourceFile:67)
	at org.matrix.android.sdk.internal.crypto.OlmMachine$checkAuthDataSignature$2.invokeSuspend(SourceFile:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:12)
	at kotlinx.coroutines.DispatchedTask.run(SourceFile:129)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(SourceFile:1)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(SourceFile:15)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(SourceFile:29)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:1)
@richvdh
Copy link
Member

richvdh commented Dec 18, 2024

Example stacktrace from Element Web:

rageshake.ts:69 Caught /sync error Error: failed to read or write to the crypto store data did not match any variant of untagged enum VerifiedStateOrBool at line 1 column 1253
    at __wbindgen_error_new (matrix_sdk_crypto_wasm_bg.js:10423:1)
    at matrix_sdk_crypto_wasm.wasm.__wbindgen_error_new externref shim (7eec95527b0d432f1172.wasm:0x3796b3)
    at matrix_sdk_crypto_wasm.wasm.matrix_sdk_crypto_wasm::future::future_to_promise_with_custom_error::{{closure}}::{{closure}}::h1f0b8472544812f3 (7eec95527b0d432f1172.wasm:0x177675)
    at matrix_sdk_crypto_wasm.wasm.wasm_bindgen_futures::queue::Queue::new::{{closure}}::hee35e3d47019bd2b (7eec95527b0d432f1172.wasm:0x2807f6)
    at matrix_sdk_crypto_wasm.wasm.<dyn core::ops::function::FnMut<(:8080/A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h09bf971deb6c4ad5 (http://localhost:8080/bundles/7672ac1a4caa74535db1/7eec95527b0d432f1172.wasm)
    at matrix_sdk_crypto_wasm.wasm.closure736 externref shim (7eec95527b0d432f1172.wasm:0x37dfc0)
    at __wbg_adapter_64 (matrix_sdk_crypto_wasm_bg.js:321:

andybalaam added a commit that referenced this issue Dec 18, 2024
This brings in the fix for #4424 that we did on a release branch to
allow a quick release of crypto-wasm
@richvdh
Copy link
Member

richvdh commented Dec 18, 2024

Fixed by #4430

@richvdh richvdh linked a pull request Dec 18, 2024 that will close this issue
@richvdh richvdh closed this as completed Dec 18, 2024
andybalaam added a commit that referenced this issue Dec 18, 2024
richvdh added a commit to matrix-org/matrix-js-sdk that referenced this issue Dec 18, 2024
andybalaam added a commit to matrix-org/matrix-rust-sdk-crypto-wasm that referenced this issue Dec 19, 2024
For the fix for
matrix-org/matrix-rust-sdk#4424 , to allow us
to release without doing the more difficult work of adapting to the
changes in the latest matrix-rust-sdk.
andybalaam added a commit to matrix-org/matrix-js-sdk that referenced this issue Dec 19, 2024
andybalaam added a commit to matrix-org/matrix-js-sdk that referenced this issue Dec 19, 2024
github-merge-queue bot pushed a commit to matrix-org/matrix-js-sdk that referenced this issue Dec 19, 2024
@andybalaam
Copy link
Member Author

The process of rolling out this fix to many places is tracked at element-hq/element-meta#2673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment