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

Restoring from online backup failed with: "missing field: sender_claimed_keys" #26774

Closed
ara4n opened this issue Dec 15, 2023 · 4 comments
Closed
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs

Comments

@ara4n
Copy link
Member

ara4n commented Dec 15, 2023

Steps to reproduce

  1. Import 420,000 keys from my online backup into EWR nightly now that Element R: App freezes while backing up megolm keys #26488 is hopefully fixed.

Takes about 2m to return the https://matrix-client.matrix.org/_matrix/client/v3/room_keys/keys?version=2 req, which looks complete and promising.

However, it then starts rapidly requesting lots of keys for specific sessions from the server - it's as if it's not actually getting them from the ~300MB download it just pulled from the server?

At some point it craps out with...

rageshake.ts:77 Error restoring backup Error: missing field `sender_claimed_keys`
    at module.exports.__wbindgen_error_new (matrix_sdk_crypto_wasm.js:7273:1)
    at serde_wasm_bindgen::error::Error::new::haa52582176c8e8a7 (0156008e:0x346ed8)
    at byn$mgfn-shared$serde::de::Error::missing_field::hcb818cd6c817fdc6 (0156008e:0x3d85d6)
    at serde::de::Error::missing_field::hcb818cd6c817fdc6 (0156008e:0x3013a0)
    at olmmachine_importBackedUpRoomKeys (0156008e:0xc3cd7)
    at OlmMachine.importBackedUpRoomKeys (matrix_sdk_crypto_wasm.js:4115:1)
    at RustBackupManager.importBackedUpRoomKeys (backup.ts:209:31)
    at RustCrypto.importBackedUpRoomKeys (rust-crypto.ts:1200:41)
    at MatrixClient.restoreKeyBackup (client.ts:3971:34)
    at async RestoreKeyBackupDialog.tsx:231:17

...and it only seems to have processed around 1,700 keys.

Outcome

What did you expect?

Restoring from online backup to work.

What happened instead?

Looks like it's being too strict on the keys in the backup? and/or it's not actually processing the keys it got from the server?

Meanwhile, trying to restore from offline backup in EWR immediately 'Aw snap's the tab, presumably due to OOM.

Operating system

No response

Application version

Element version: e9f0a8c-react-de5931d5a8e5-js-68898aeff2c5 Crypto version: Rust SDK 0.6.0 (438880a), Vodozemac 0.5.0

How did you install the app?

No response

Homeserver

No response

Will you send logs?

Yes

@richvdh
Copy link
Member

richvdh commented Jan 21, 2024

This is not yet fixed because element has not yet been updated to a sufficiently recent version of matrix-sdk-crypto-wasm.

@richvdh
Copy link
Member

richvdh commented Jan 23, 2024

This was partially fixed by matrix-org/matrix-rust-sdk-crypto-wasm#85 and matrix-org/matrix-js-sdk#4006, but it appears there are other causes (cf matrix-org/matrix-js-sdk#4006 and matrix-org/matrix-rust-sdk-crypto-wasm#92)

@uhoreg
Copy link
Member

uhoreg commented Jan 25, 2024

I don't think matrix-org/matrix-rust-sdk-crypto-wasm#92 is related to this, because key backups don't use the EncryptionAlgorithm class. It just passes the raw JSON to the OlmMachine.

@uhoreg
Copy link
Member

uhoreg commented Jan 29, 2024

The relevant PRs are merged now, so this should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Z-Labs
Projects
None yet
Development

No branches or pull requests

4 participants