Skylar-Tech / node-red-contrib-matrix-chat

Matrix chat server support for Node-RED
GNU General Public License v3.0
31 stars 10 forks source link

Key generation errors #11

Closed blaxer closed 1 year ago

blaxer commented 2 years ago

Getting the following error constantly repeating in the nodered logs, not sure what I can do to fix it.

generating oneTimeKeys, generating fallback key, Error uploading one-time keys TypeError: account.generate_fallback_key is not a function, at /data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/OlmDevice.js:462:15, at /data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/OlmDevice.js:250:7, at LocalStorageCryptoStore.getAccount (/data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/store/localStorage-crypto-store.js:348:5), at OlmDevice._getAccount (/data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/OlmDevice.js:245:21), at /data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/OlmDevice.js:461:10, at LocalStorageCryptoStore.doTxn (/data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/store/localStorage-crypto-store.js:374:28), at OlmDevice.generateFallbackKey (/data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/OlmDevice.js:460:27), at uploadLoop (/data/node_modules/node-red-contrib-matrix-chat/node_modules/matrix-js-sdk/lib/crypto/index.js:1728:32), at runMicrotasks (), at processTicksAndRejections (internal/process/task_queues.js:95:5)

skylord123 commented 2 years ago

This is interesting. Did you use an existing user or create a new one?

skylord123 commented 2 years ago

I just wanted to update and say that there is known issues with using an existing account (that already has e2ee keys). Check this out for more information: https://github.com/Skylar-Tech/node-red-contrib-matrix-chat#end-to-end-encryption-notes

I'm curious if you are using an existing account and that is what caused this error. I've tried a few things and can't seem to replicate this.

blaxer commented 2 years ago

Yes I was using an existing user that had keys already. I "fixed" the problem by creating a brand new user and just to keep things simple did not enable encryption on any rooms and that seemed to work fine.

skylord123 commented 2 years ago

@blaxer I just released 0.3.0 that comes with a newer version of matrix-js-sdk. I'm hoping the newer release fixes this problem for you.

skylord123 commented 2 years ago

I got this same error and chased down another person having the same issue: https://giters.com/matrix-org/matrix-js-sdk/issues/2092

I upgraded olm in the dev branch to the latest version and the error went away. I then reverted back and tried again and the error came back. So this should be fixed in the next version.

skylord123 commented 2 years ago

@blaxer try version 0.5.8 that just dropped today. In my testing this error went away so this version should fix it for you. Upgrading olm seems to have fixed it.

skylord123 commented 1 year ago

Closing this as there has been no activity in a while.