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

"Unable to restore session" on 2024040401 nightly #1603

Closed
Tracked by #27284
clokep opened this issue Apr 4, 2024 · 9 comments · Fixed by matrix-org/matrix-js-sdk#4168
Closed
Tracked by #27284

"Unable to restore session" on 2024040401 nightly #1603

clokep opened this issue Apr 4, 2024 · 9 comments · Fixed by matrix-org/matrix-js-sdk#4168
Assignees
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Defect Z-Element-R-Blocker A blocker for enabling Element R by default

Comments

@clokep
Copy link

clokep commented Apr 4, 2024

Steps to reproduce

I restarted to update to today's nightly and am greeted with a page saying "Unable to restore session".

I've sent a rageshake already, although was unable to actually click on either of the buttons and had to use the keyboard.

Outcome

I was expecting a usable application. 😄

Operating system

macOS

Application version

2024040401 nightly

How did you install the app?

Unsure

Homeserver

matrix.org

Will you send logs?

Yes

@clokep clokep added the T-Defect label Apr 4, 2024
@clokep
Copy link
Author

clokep commented Apr 4, 2024

Maybe fallout from enabling Rust crypto? #1518? It somewhat sounds like element-hq/element-web#27196 but I'm connected to the Internet and my homeserver is up.

@richvdh richvdh added the A-Element-R Issues affecting the port of Element's crypto layer to Rust label Apr 5, 2024
@t3chguy
Copy link
Member

t3chguy commented Apr 8, 2024

Will you send logs?
Yes

Not seeing any logs from you @clokep

@t3chguy t3chguy added the X-Needs-Info This issue is blocked awaiting information from the reporter label Apr 8, 2024
@richvdh
Copy link
Member

richvdh commented Apr 8, 2024

@t3chguy I linked this issue from the rageshakes; you should see the reverse links above.

@richvdh richvdh removed the X-Needs-Info This issue is blocked awaiting information from the reporter label Apr 8, 2024
@t3chguy
Copy link
Member

t3chguy commented Apr 8, 2024

Ah yes, thanks, my browser was showing me a stale view as I had opened this tab 4 days ago

@BillCarsonFr
Copy link
Member

It's different than element-hq/element-web#27196

Something with getAndDecryptCachedSecretKey

024-04-04T13:25:29.211Z E Unable to load session The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
TypeError: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
    at from (vector://vector/webapp/bundles/1d2e934471ebcb41f3e7/bundle.js:295302:11)
    at Buffer.from (vector://vector/webapp/bundles/1d2e934471ebcb41f3e7/bundle.js:295353:10)
    at decodeBase64 (vector://vector/webapp/bundles/1d2e934471ebcb41f3e7/bundle.js:108039:19)
    at decryptAES (vector://vector/webapp/bundles/1d2e934471ebcb41f3e7/bundle.js:119820:85)
    at async getAndDecryptCachedSecretKey (vector://vector/webapp/bundles/1d2e934471ebcb41f3e7/865.js:4549:44)
    at async migrateBaseData (vector://vector/webapp/bundles/1d2e934471ebcb41f3e7/865.js:4395:53)
    ```

@clokep
Copy link
Author

clokep commented Apr 8, 2024

Please reach out if there's anything I can do to help debug!

@andybalaam
Copy link
Contributor

We are treating this as a blocker for rolling out further migration to Rust crypto.

@BillCarsonFr
Copy link
Member

After investigation, the secret stored in this session are mixed encrypted / not encrypted.
I.e ssss_cache:megolm_backup.v1 is in the form {ciphertext, iv, mac}
But ssss_cache:self_signing is a row UInt8Array

So libolm_migration#getAndDecryptCachedSecretKey is failing to get a key not encrypted and will error because ciphertext is undefined.
The CrossSigning.ts code support retrieving both encrypted or not encrypted

@clokep
Copy link
Author

clokep commented Apr 29, 2024

Just to confirm matrix-org/matrix-js-sdk#4168 did fix this issue for me. 🎉 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Element-R Issues affecting the port of Element's crypto layer to Rust T-Defect Z-Element-R-Blocker A blocker for enabling Element R by default
Projects
None yet
5 participants