cinnyapp / cinny

Yet another matrix client
https://cinny.in
GNU Affero General Public License v3.0
1.85k stars 239 forks source link

2.2.6 fails to sync due to encryption exception #1179

Open TheBlueMatt opened 1 year ago

TheBlueMatt commented 1 year ago

Describe the bug

When upgrading from 2.2.4 to 2.2.6 self-hosted, most of my channels dissapear, and a handful of spaces dissapear. This remains true after a cache wipe + reload. Console exception is:

Caught /sync error Error: Unable to encrypt with m.megaolm.v1.aes-sha2
    setRoomEncryptionImpl https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:18
    onCryptoEvent https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:18
    processSyncResponse https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:15
    hj https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:14

before cache wipe, and after it was:

Caught /sync error Error: Unable to encrypt with m.megaolm.v1.aes-sha2
    setRoomEncryptionImpl https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:18
    onCryptoEvent https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:18
    processSyncResponse https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:15
    hj https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:14
    processSyncResponse https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:15
    doSync https://cinny.bitcoin.ninja/assets/index-cb0350e9.js:15
...

Reproduction

No response

Expected behavior

No response

Platform and versions

Self-hosted Cinny 2.2.6 web, running in Firefox 102.9.0 ESR.

Additional context

No response

TheBlueMatt commented 1 year ago

Oh probably worth mentioning I do not have this issue in the latest element-web.

williamkray commented 1 year ago

unable to reproduce here, i upgraded to 2.2.6 without issue... seems like you're having encryption issues based on that sync error output, is your session verified? have you tried to export and import keys from a working session? are the missing rooms and spaces encrypted or are you seeing missing rooms and spaces that are not encrypted?

TheBlueMatt commented 1 year ago

Yea, the session is verified, I tried logging in in another browser context with no previous state and an empty cinny and had the same issue. Downgrading to 2.2.4 even after 2.2.6 ran fixed the issue no problem, with the same local state.

TheBlueMatt commented 1 year ago

IIUC given the initial sync fails it just....loads half my rooms and then doesn't load any more after the error.

williamkray commented 1 year ago

do you run into the same issue with cinny 2.2.6 hosted elsewhere (e.g. cinny.in)? if so, something is wrong with your account data. if not, something is wrong with your installation.

TheBlueMatt commented 1 year ago

Yes, I see the same issue on app.cinny.in. It seems quite strange that I don't see it on the latest element, however, so I'm not sure how broken my account data could be.

williamkray commented 1 year ago

it's very possible element is the one that is broken by being more lax about following spec... if the data in your account is not to spec but happens to be a format that element reads (because the spec was more nebulous before that feature was finalized) then these things can happen.

TheBlueMatt commented 1 year ago

Okay....but what can I do about it? I'd ideally love to continue using Cinny, but now I fully cannot. I also have no idea what might have edited my account data in a way that Cinny no longer accepts - I mostly only use Cinny and the latest Element. Further, I'm a bit confused here, because AFAIU the only changes in 2.2.6 were the security updates which were applied to both Cinny and Element at the same time, so presumably they should both reject the same issues?

williamkray commented 1 year ago

i mean, you could dig into the issues and try to identify what the data in your account is that is causing the issue, or you could just start migrating to a new matrix account. before doing anything drastic like modifying your account data, i would set up a fresh matrix account and verify that the issue doesn't persist with it. then you can join all the same rooms etc, and feel more free to start hacking away at your busted account data. if you control the homeserver, you could even wipe all the account data associated with that account and start fresh, or deactivate and reactivate the account.

i'm not a dev here, i'm just telling you what i would try doing. if you ping me i'd be happy to get you set up with a matrix id on my homeserver for testing or for complete migration.