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

Element-R: Manual room key export fails for big account #26681

Closed
BillCarsonFr opened this issue Dec 1, 2023 · 10 comments
Closed

Element-R: Manual room key export fails for big account #26681

BillCarsonFr opened this issue Dec 1, 2023 · 10 comments
Assignees
Labels
A-E2EE-Key-Backup 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 Team: Crypto Z-Labs

Comments

@BillCarsonFr
Copy link
Member

Step to reproduce

  1. Have a session with a lot of keys in store
  2. Go to Settings > Security & Privacy and click on Export E2ERoom keys

=> Will fail with unknown error

Error exporting e2e keys: Error: DomException UnknownError (0): The operation failed for reasons unrelated to the database itself and not covered by any other error code.

@BillCarsonFr BillCarsonFr added A-Element-R Issues affecting the port of Element's crypto layer to Rust Team: Crypto labels Dec 1, 2023
@github-actions github-actions bot added the Z-Labs label Dec 1, 2023
@florianduros florianduros added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Occasional Affects or can be seen by some users regularly or most users rarely labels Dec 4, 2023
@richvdh
Copy link
Member

richvdh commented Dec 7, 2023

This is basically the same cause as #26488: we try and read all of the sessions from the db in one big transaction, which at best freezes the app for many seconds, and at worst OOMs or generally kills things. We'll need a flow in which keys can be extracted incrementally.

@richvdh
Copy link
Member

richvdh commented Dec 12, 2023

See also element-hq/element-desktop#1394 which concerns import of large backups.

@andybalaam andybalaam self-assigned this Dec 13, 2023
@richvdh
Copy link
Member

richvdh commented Jan 3, 2024

@BillCarsonFr: why is this blocked?

@andybalaam
Copy link
Contributor

@ara4n , @BillCarsonFr please could you rageshake after a failed export and link to this issue? I am getting an error in my setup but I have a sneaking suspicion it's not the same thing you are seeing.

@andybalaam
Copy link
Contributor

First step done here: matrix-org/matrix-rust-sdk#3012

I am pausing this for now to concentrate on things that block Element Web R.

@BillCarsonFr
Copy link
Member Author

@BillCarsonFr
Copy link
Member Author

I tried with the recently merged PR (new efficient crypto db format + use of exportAsJson), and it's now working with my account.
I have about ~200k keys, the resulting file is ~140MB and it took ~20s

So it's working 🎉
We still lack some feedback, during the process only the button is grayed out. But given that it's 20s it might be acceptable to just show some loading weel, maybe we don't need a progress bar.

IMO we can close this

@Hywan
Copy link
Member

Hywan commented Feb 19, 2024

If an account has 1 million keys, it's gonna take 100s, be 1mn40s. I believe that if we can generate a progress bar, that could be good. Or at least: “You have a lost of keys, it can take a while, please wait and don't close this window”.

@andybalaam
Copy link
Contributor

@ara4n any chance you could try exporting from Nightly? We think the existing improvements might be enough to make it work for you, and the deeper fixes we have been considering are proving difficult and time-consuming.

@andybalaam
Copy link
Contributor

andybalaam commented Feb 23, 2024

OK, we have confirmation from @ara4n that a large export succeeded, so we consider the fixes we've done so far to be adequate. Ideally, we'd make a fully-scalable solution but we are not going to work more on that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE-Key-Backup 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 Team: Crypto Z-Labs
Projects
None yet
Development

No branches or pull requests

5 participants