Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Error: Key does not exist. on pass account id to name.publish #2046

Closed
@MicrowaveDev

Description

@MicrowaveDev
  • Version: 0.35.0
  • Platform: Darwin mac.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64

Type: Bug

Severity: Medium

Description: Error on trying to pass account Peer ID instead of name to ipfs.name.publish

(node:20297) UnhandledPromiseRejectionWarning: Error: Key 'QmUctS4HYzuFrqNQmjnRoRn6kBnMecBZobBQfsPzo46nbA' does not exist. ENOENT: no such file or directory, open '/root/.jsipfs/keys/pkcs8/QmUctS4HYzuFrqNQmjnRoRn6kBnMecBZobBQfsPzo46nbA.data'
    at _error (/root/my-app/node_modules/libp2p-keychain/src/keychain.js:53:38)
    at store.get (/root/my-app/node_modules/libp2p-keychain/src/keychain.js:386:16)
    at ReadFileContext.fs.readFile (/root/my-app/node_modules/datastore-fs/src/index.js:216:16)
    at ReadFileContext.callback (/root/my-app/node_modules/graceful-fs/graceful-fs.js:90:16)
    at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:237:13)
(node:20297) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:20297) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to reproduce the error:

const IPFS = require('ipfs');
const node = new IPFS({
  pass: 'traffic enough crater wear tissue term town have switch exhibit onion asset'
});

const keys = await = node.key.list();
const peerId = keys[0].id;

node.name.publish('QmdFuxvDj27kW3j3DbosoicC828jm7ZtJNbVubFQ8aTbNV', {
  key: peerId
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick upkind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions