hyperdrive-daemon icon indicating copy to clipboard operation
hyperdrive-daemon copied to clipboard

Issue with empty buffer in mount

Open pfrazee opened this issue 5 years ago • 0 comments

Somehow or other I seem to have accidentally created a mount with a bad key. This causes hyperdrive-daemon to crash with the following error:

Error: key must be a buffer of size crypto_generichash_KEYBYTES_MIN
    at Object.exports.discoveryKey (/Users/paulfrazee/work/beaker/app/node_modules/hypercore-crypto/index.js:86:10)
    at Corestore._generateKeys (/Users/paulfrazee/work/beaker/app/node_modules/corestore/index.js:231:39)
    at Corestore.get (/Users/paulfrazee/work/beaker/app/node_modules/corestore/index.js:270:32)
    at NamespacedCorestore.get (/Users/paulfrazee/work/beaker/app/node_modules/corestore/index.js:45:29)
    at MountableHypertrie._createHypertrie (/Users/paulfrazee/work/beaker/app/node_modules/mountable-hypertrie/index.js:81:36)
    at MountableHypertrie._trieForMountNode (/Users/paulfrazee/work/beaker/app/node_modules/mountable-hypertrie/index.js:132:10)
    at /Users/paulfrazee/work/beaker/app/node_modules/mountable-hypertrie/index.js:449:14
    at nextDone (/Users/paulfrazee/work/beaker/app/node_modules/nanoiterator/index.js:105:3)
    at Iterator._next (/Users/paulfrazee/work/beaker/app/node_modules/hypertrie/lib/iterator.js:54:26)
    at update (/Users/paulfrazee/work/beaker/app/node_modules/nanoiterator/index.js:115:13)

It's calling discoveryKey() with an empty Buffer, which is why I think I've got a mount with a bad/empty key.

pfrazee avatar Jan 25 '20 21:01 pfrazee