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

POST /keys/upload gives error 400 #4213

Closed
Gulianrdgd opened this issue May 22, 2024 · 2 comments
Closed

POST /keys/upload gives error 400 #4213

Gulianrdgd opened this issue May 22, 2024 · 2 comments
Labels

Comments

@Gulianrdgd
Copy link

Gulianrdgd commented May 22, 2024

Currently I am trying to setup e2ee with the new initRustCrypto() everything works as far as I can see however my console is filled with POST requests to /client/v3/keys/upload with recieves error code 400:

{"errcode":"M_UNKNOWN","error":"One time key signed_curve25519:AAAAAAAAAA0 already exists ... "}

It tries to upload the keys everytime we do a SYNC request

Screenshot from 2024-05-22 12-26-48.

I am starting the client like this:

this.client.initRustCrypto().then( 
() => {
	this.client.startClient({
		initialSyncLimit: settings.pagination,
		includeArchivedRooms: false,
	})

For me it is always the same curve and the same string behind the curve, regardless of which account is logged in. In issue #4132 a user reports the same issue but with AAA...8

@dosubot dosubot bot added the T-Defect label May 22, 2024
@richvdh
Copy link
Member

richvdh commented May 23, 2024

Can you tell us more about how you are creating the MatrixClient? Perhaps you could share a Short, Self Contained, Correct, Example.

It looks like the rust crypto library has forgotten that it has already created a one-time-key for this device with that ID, but this information should be stored in indexeddb.

This could happen if:

  • you initialise two MatrixClient instances with the same access token, but your indexeddb isn't working (or you have cleared it out somehow), or:
  • you have called the /login REST API, passing a device ID for a device that already exists.

@Gulianrdgd
Copy link
Author

Gulianrdgd commented Jun 5, 2024

It was indeed that I deleted my indexdb. Removing all my cookies, sessions storage etc... Did the trick.

Thanks for the response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants