Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Failures uploading one-time keys #1208

Closed
richvdh opened this issue May 8, 2017 · 4 comments
Closed

Failures uploading one-time keys #1208

richvdh opened this issue May 8, 2017 · 4 comments
Labels

Comments

@richvdh
Copy link
Member

richvdh commented May 8, 2017

Rageshake log says:

05-06 15:54:56.118 1 D/MXCrypto: ## encryptEventContent() : wait after e2e init
@richvdh
Copy link
Member Author

richvdh commented May 8, 2017

@ylecollen
Copy link
Contributor

05-06 13:40:32.571 597 D/RestAdapterCallback: Trigger the event [uploadKeys]
05-06 13:40:32.640 1 D/RestAdapterCallback: ## failure(): [uploadKeys] with error 400 Bad Request
05-06 13:40:32.641 1 E/MXCrypto: ## maybeUploadOneTimeKeys() : failed One time key with key_id 'AAAA2Q' already exists
05-06 13:40:32.643 1 E/MXCrypto: ## start failed : One time key with key_id 'AAAA2Q' already exists

@richvdh
Copy link
Member Author

richvdh commented May 9, 2017

05-06 13:40:32.643 1 E/MXCrypto: ## start failed : One time key with key_id 'AAAA2Q' already exists

This error will only happen if you are trying to change the one-time key, which suggests that, in the past, one-time-keys have been generated but not persisted to the permanent store before uploading - and then, when the app has been restarted, another key with the same key_id has been generated :/.

This might explain #1209

@richvdh
Copy link
Member Author

richvdh commented May 9, 2017

05-06 13:40:32.643 1 E/MXCrypto: ## start failed : One time key with key_id 'AAAA2Q' already exists

This error will only happen if you are trying to change the one-time key,

This turns out to be not quite right: synapse also returns the error if the key is the same but the signature is different. That could happen if the client had previously tried to upload the key, but not got the response. It would then later retry the upload, having re-signed the key.

This could also affect riot-web.

I think the most pragmatic fix to this is to fudge the server so that it does not raise an error if the key is the same and the signature has changed.

@richvdh richvdh changed the title E2e message got stuck without being encrypted Failures uploading one-time keys May 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants