-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
/keys/query loop in unverified sessions #27165
/keys/query loop in unverified sessions #27165
Comments
I'm suspecting it's happening since the switch to the Rust Crypto SDK, but I will have to confirm that tomorrow. |
This sounds like #26194 which @richvdh closed in matrix-org/matrix-js-sdk#3757 |
Please send debug logs from within the application. |
I have just re-produced the issue using the build on https://develop.element.io and uploaded logs from there. |
Because I said I'd do so last night: I can also confirm that this behavior does not occur with EDIT: I sadly cannot provide logs from this test because I did so running the |
The debug logs show lots of calls to |
I was unable to reproduce this following the reproduction steps.
Surely if it is an empty database, you cannot login? Did you register the user somehow? Or are you using an unusual authentication system? Assuming you're using an existing account: when I try to log in again, I see this screen: @fnwbr can you confirm if you see that? |
Thanks for giving this a look, I can check back in tomorrow and provide more details. But to answer one question:
Yep, sorry for not mentioning. We're using the LDAP provider module as outlined in: |
I just want to say that this issue happened to me for a long time. These endless loops triggered bans so I decided to stop my service (unfederated server) after not getting help in the chat. Today I've re-installed the server with a hope it's solved, but it's not. |
I was able to reproduce this too. I think you need an account which:
Note that being verified (and actually having access to the secrets in secret storage) doesn't seem to be a factor here. Contrary to what you might expect, |
@richvdh, to me it happens in a completely new server, so I wasn't in any room (encrypted or not) and I was the only user on that server. |
Ok please can you file a separate issue with as much detail as you can, and send a bug report from within the application |
@BillCarsonFr looked at this and observed that we call However, it looks like we do that quite deliberately: https://github.com/matrix-org/matrix-rust-sdk/blob/5df53d7338a381fd596c580f36cbe69fdcfceed8/crates/matrix-sdk-crypto/src/store/mod.rs#L648. I think we should understand why that line is there before we rip it out. |
Actually, no, that's not what that code is doing. Ignore my last comment; I still don't really understand why this bug is happening. |
So the loop goes:
The obvious solution is to have |
I'm not sure if this issue should be closed despite matrix-org/matrix-rust-sdk#3442 has been merged. I let @richvdh decides 🙂. |
Thanks @Hywan. Yes, we'll keep this open until the fix actually lands in element-web (which means a new release of the wasm bindings, and a fix to matrix-org/matrix-rust-sdk#3447) |
@richvdh, thanks a lot for looking on this! I completely shut down 2 of my servers months ago because of this bug. |
I'm afraid I can't speak to Element Android. It may be affected by the same problem, or it may be something else. I'd suggest opening an issue on the element-android repository. |
Slightly more involved than normal because it requires us to pass a backup version into OlmMachine.importBackedUpRoomKeys. On the other hand we can now re-enable the test that was disabled in #4214 due to matrix-org/matrix-rust-sdk#3447 Fixes: element-hq/element-web#27165
FYI we have a server with a main at 100% and we can pinpoint that to the deploy of v1.11.67, which seems to be because this version migrates 30% of the users to the Rust crypto layer which triggers this bug. We only have 10-ish people with this new version but it's enough to peg the main of this server, probably also because it was quite loaded before that. Thanks for fixing it. |
Hey while this issue is being fixed (thanks!), would be possible to prevent that by using some of the ratelimiting configurations? |
* Preserve ESM for async imports to work correctly (matrix-org#4187) * fix: fix lazy rust crypto import * test: use "commonjs" for tests because of circular deps * chore: revert commonjs for "module" * refactor: remove unnecessary example * refactor: add comments Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> * refactor: improve comment Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update babel.config.js --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update organization (matrix-org#4212) * v32.4.0 * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 (matrix-org#4214) * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 * Disable affected test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * `initRustCrypto`: allow app to pass in the store key directly (matrix-org#4210) * `initRustCrypto`: allow app to pass in the store key directly ... instead of using the pickleKey. This allows us to avoid a slow PBKDF operation. * Fix link in doc-comment * Bump matrix-sdk-crypto-wasm to 5.0.0 (matrix-org#4216) Slightly more involved than normal because it requires us to pass a backup version into OlmMachine.importBackedUpRoomKeys. On the other hand we can now re-enable the test that was disabled in matrix-org#4214 due to matrix-org/matrix-rust-sdk#3447 Fixes: element-hq/element-web#27165 * Remove more deprecated methods, fields, and exports (matrix-org#4217) * Don't run migration for Rust crypto if the legacy store is empty (matrix-org#4218) * Don't run migration for Rust crypto if the legacy store is empty Fixes element-hq/element-web#27447 * Add copyright for the TypeScript files in legacy DB dumps * Provide a type for the accountPickle we check for before migration * Remove redundant backup response This is unused * Simplify keys response * Downgrade log message. --------- Co-authored-by: Richard van der Hoff <richard@matrix.org> * v33.0.0-rc.0 * v33.0.0 --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: R Midhun Suresh <hi@midhun.dev> Co-authored-by: RiotRobot <releases@riot.im> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Andy Balaam <andy.balaam@matrix.org> Co-authored-by: Richard van der Hoff <richard@matrix.org>
* Preserve ESM for async imports to work correctly (matrix-org#4187) * fix: fix lazy rust crypto import * test: use "commonjs" for tests because of circular deps * chore: revert commonjs for "module" * refactor: remove unnecessary example * refactor: add comments Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> * refactor: improve comment Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update babel.config.js --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update organization (matrix-org#4212) * v32.4.0 * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 (matrix-org#4214) * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 * Disable affected test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * `initRustCrypto`: allow app to pass in the store key directly (matrix-org#4210) * `initRustCrypto`: allow app to pass in the store key directly ... instead of using the pickleKey. This allows us to avoid a slow PBKDF operation. * Fix link in doc-comment * Bump matrix-sdk-crypto-wasm to 5.0.0 (matrix-org#4216) Slightly more involved than normal because it requires us to pass a backup version into OlmMachine.importBackedUpRoomKeys. On the other hand we can now re-enable the test that was disabled in matrix-org#4214 due to matrix-org/matrix-rust-sdk#3447 Fixes: element-hq/element-web#27165 * Remove more deprecated methods, fields, and exports (matrix-org#4217) * Don't run migration for Rust crypto if the legacy store is empty (matrix-org#4218) * Don't run migration for Rust crypto if the legacy store is empty Fixes element-hq/element-web#27447 * Add copyright for the TypeScript files in legacy DB dumps * Provide a type for the accountPickle we check for before migration * Remove redundant backup response This is unused * Simplify keys response * Downgrade log message. --------- Co-authored-by: Richard van der Hoff <richard@matrix.org> * v33.0.0-rc.0 * v33.0.0 --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: R Midhun Suresh <hi@midhun.dev> Co-authored-by: RiotRobot <releases@riot.im> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Andy Balaam <andy.balaam@matrix.org> Co-authored-by: Richard van der Hoff <richard@matrix.org>
* Bringing develop to v 33.0.0 (#5) * Preserve ESM for async imports to work correctly (matrix-org#4187) * fix: fix lazy rust crypto import * test: use "commonjs" for tests because of circular deps * chore: revert commonjs for "module" * refactor: remove unnecessary example * refactor: add comments Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> * refactor: improve comment Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update babel.config.js --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update organization (matrix-org#4212) * v32.4.0 * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 (matrix-org#4214) * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 * Disable affected test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * `initRustCrypto`: allow app to pass in the store key directly (matrix-org#4210) * `initRustCrypto`: allow app to pass in the store key directly ... instead of using the pickleKey. This allows us to avoid a slow PBKDF operation. * Fix link in doc-comment * Bump matrix-sdk-crypto-wasm to 5.0.0 (matrix-org#4216) Slightly more involved than normal because it requires us to pass a backup version into OlmMachine.importBackedUpRoomKeys. On the other hand we can now re-enable the test that was disabled in matrix-org#4214 due to matrix-org/matrix-rust-sdk#3447 Fixes: element-hq/element-web#27165 * Remove more deprecated methods, fields, and exports (matrix-org#4217) * Don't run migration for Rust crypto if the legacy store is empty (matrix-org#4218) * Don't run migration for Rust crypto if the legacy store is empty Fixes element-hq/element-web#27447 * Add copyright for the TypeScript files in legacy DB dumps * Provide a type for the accountPickle we check for before migration * Remove redundant backup response This is unused * Simplify keys response * Downgrade log message. --------- Co-authored-by: Richard van der Hoff <richard@matrix.org> * v33.0.0-rc.0 * v33.0.0 --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: R Midhun Suresh <hi@midhun.dev> Co-authored-by: RiotRobot <releases@riot.im> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Andy Balaam <andy.balaam@matrix.org> Co-authored-by: Richard van der Hoff <richard@matrix.org> * Bring develop to v33.0.0 (#6) * Preserve ESM for async imports to work correctly (matrix-org#4187) * fix: fix lazy rust crypto import * test: use "commonjs" for tests because of circular deps * chore: revert commonjs for "module" * refactor: remove unnecessary example * refactor: add comments Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> * refactor: improve comment Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update babel.config.js --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> * Update organization (matrix-org#4212) * v32.4.0 * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 (matrix-org#4214) * Update dependency @matrix-org/matrix-sdk-crypto-wasm to v4.10.0 * Disable affected test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * `initRustCrypto`: allow app to pass in the store key directly (matrix-org#4210) * `initRustCrypto`: allow app to pass in the store key directly ... instead of using the pickleKey. This allows us to avoid a slow PBKDF operation. * Fix link in doc-comment * Bump matrix-sdk-crypto-wasm to 5.0.0 (matrix-org#4216) Slightly more involved than normal because it requires us to pass a backup version into OlmMachine.importBackedUpRoomKeys. On the other hand we can now re-enable the test that was disabled in matrix-org#4214 due to matrix-org/matrix-rust-sdk#3447 Fixes: element-hq/element-web#27165 * Remove more deprecated methods, fields, and exports (matrix-org#4217) * Don't run migration for Rust crypto if the legacy store is empty (matrix-org#4218) * Don't run migration for Rust crypto if the legacy store is empty Fixes element-hq/element-web#27447 * Add copyright for the TypeScript files in legacy DB dumps * Provide a type for the accountPickle we check for before migration * Remove redundant backup response This is unused * Simplify keys response * Downgrade log message. --------- Co-authored-by: Richard van der Hoff <richard@matrix.org> * v33.0.0-rc.0 * v33.0.0 --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: R Midhun Suresh <hi@midhun.dev> Co-authored-by: RiotRobot <releases@riot.im> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Andy Balaam <andy.balaam@matrix.org> Co-authored-by: Richard van der Hoff <richard@matrix.org> --------- Signed-off-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Bayyr Oorjak <the.bayyr.oorjak@gmail.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: R Midhun Suresh <hi@midhun.dev> Co-authored-by: RiotRobot <releases@riot.im> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Andy Balaam <andy.balaam@matrix.org> Co-authored-by: Richard van der Hoff <richard@matrix.org>
I've outlined this in #element-web:matrix.org already; but to no luck. We've started seeing this as of 1 or 2 weeks ago:
Steps to reproduce
I tried this on a fresh Synapse instance with an empty database.
Outcome
What did you expect?
Element to not go crazy.
What happened instead?
Watch the console output repeating the following block about 60 times per second:
Application version
Element version: 1.11.60 Crypto version: Rust SDK 0.7.0 (b1918e9), Vodozemac 0.5.1
Homeserver
Synapse v1.102.0
The text was updated successfully, but these errors were encountered: