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

Creating a key backup fails for local Riot / HS #7787

Closed
jryans opened this issue Dec 6, 2018 · 2 comments
Closed

Creating a key backup fails for local Riot / HS #7787

jryans opened this issue Dec 6, 2018 · 2 comments

Comments

@jryans
Copy link
Collaborator

jryans commented Dec 6, 2018

Description

If I enable the key backup lab, it works fine with riot.im/develop and a matrix.org account. However, when I try with a local Riot install and local Synapse install, I get an error when creating the key backup.

Steps to reproduce

  1. Use a local Riot and Synapse install
  2. Enable the key backup lab
  3. Try to create a key backup
  4. Enter and confirm a passphrase

After confirming the passphrase, I get the following error:

Unhandled rejection TypeError: Expected Buffer
    encode@http://localhost:8080/bundles/_dev_/bundle.js:35515:41
    encodeRecoveryKey@http://localhost:8080/bundles/_dev_/bundle.js:16217:21
    _callee4$@http://localhost:8080/bundles/_dev_/bundle.js:3127:44
    tryCatch@http://localhost:8080/bundles/_dev_/bundle.js:46705:37
    invoke@http://localhost:8080/bundles/_dev_/bundle.js:46939:22
    defineIteratorMethods/</prototype[method]@http://localhost:8080/bundles/_dev_/bundle.js:46757:16
    run@http://localhost:8080/bundles/_dev_/bundle.js:280676:22
    notify/<@http://localhost:8080/bundles/_dev_/bundle.js:280693:30
    flush@http://localhost:8080/bundles/_dev_/bundle.js:276494:9
From previous event:
    ../matrix-js-sdk/lib/client.js/</MatrixClient.prototype.prepareKeyBackupVersion</<@http://localhost:8080/bundles/_dev_/bundle.js:3145:16
    _callee2$@http://localhost:8080/bundles/_dev_/5.js:219:91
    tryCatch@http://localhost:8080/bundles/_dev_/bundle.js:139521:37
    invoke@http://localhost:8080/bundles/_dev_/bundle.js:139755:22
    defineIteratorMethods/</prototype[method]@http://localhost:8080/bundles/_dev_/bundle.js:139573:16
    tryCatcher@http://localhost:8080/bundles/_dev_/bundle.js:145163:16
    ../matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[16]</module.exports/PromiseSpawn.prototype._promiseFulfilled@http://localhost:8080/bundles/_dev_/bundle.js:142296:18
    ../matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[16]</module.exports/Promise.coroutine/<@http://localhost:8080/bundles/_dev_/bundle.js:142400:9
    _onPassPhraseConfirmNextClick@http://localhost:8080/bundles/_dev_/5.js:240:20
    boundFunc@http://localhost:8080/bundles/_dev_/bundle.js:316043:9
    ./node_modules/react-dom/lib/ReactErrorUtils.js/ReactErrorUtils.invokeGuardedCallback@http://localhost:8080/bundles/_dev_/bundle.js:316049:7
    executeDispatch@http://localhost:8080/bundles/_dev_/bundle.js:309723:5
    executeDispatchesInOrder@http://localhost:8080/bundles/_dev_/bundle.js:309746:5
    executeDispatchesAndRelease@http://localhost:8080/bundles/_dev_/bundle.js:309138:5
    executeDispatchesAndReleaseTopLevel@http://localhost:8080/bundles/_dev_/bundle.js:309149:10
    forEachAccumulated@http://localhost:8080/bundles/_dev_/bundle.js:322450:5
    processEventQueue@http://localhost:8080/bundles/_dev_/bundle.js:309349:7
    runEventQueueInBatch@http://localhost:8080/bundles/_dev_/bundle.js:316081:3
    handleTopLevel@http://localhost:8080/bundles/_dev_/bundle.js:316091:5
    handleTopLevelImpl@http://localhost:8080/bundles/_dev_/bundle.js:316176:5
    perform@http://localhost:8080/bundles/_dev_/bundle.js:321676:13
    batchedUpdates@http://localhost:8080/bundles/_dev_/bundle.js:315804:14
    batchedUpdates@http://localhost:8080/bundles/_dev_/bundle.js:319662:10
    dispatchEvent@http://localhost:8080/bundles/_dev_/bundle.js:316251:7

Version information

  • Platform: web

For the web app:

  • Browser: Firefox 65
  • OS: macOS
  • URL: Local Riot install (should be latest code from develop)
@jryans
Copy link
Collaborator Author

jryans commented Dec 6, 2018

I am using Yarn locally. I did not import npm's package-lock.json into Yarn, so it pulled the latest versions of deps that match version ranges.

While presumably various packages were updated, the interesting one is base-x which changed from 3.0.4 to 3.0.5. It appears that 3.0.5 tests that the input to encode is a Buffer causing this error. (It also happens to change to an entirely different implementation.)

@jryans
Copy link
Collaborator Author

jryans commented Dec 6, 2018

Since only Yarn users would hit this, I'll resolve this by importing package-lock.json into Yarn locally (and assuming we do switch to Yarn as proposed in #7756, we should do the same for the committed yarn.lock file).

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

No branches or pull requests

2 participants