js-ipfs icon indicating copy to clipboard operation
js-ipfs copied to clipboard

Error when publishing IPNS entry

Open tknoch-symphony opened this issue 2 years ago • 1 comments

Hello, I'm a rookie in IPFS world so please take that into account.

  • Version:
  • Version: 0.14.3
  • Platform:
  • Subsystem:

Severity:

Description:

I successfully ran a IPFS node on my nestjs API using js-ipfs (ipfs-core). When trying to publish a IPNS record, I get the following error:

Error: ipns record for f5uxa3ttf4acicabciqhcqrufyvadw2s7tyk2lp7tiaca737jtwpi6sjeiwzv4xqpsmwehi could not be stored in the routing - Error: Write failed
    at Object.dbWriteFailedError (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/datastore-core/cjs/src/errors.js:20:16)
    at TieredDatastore.put (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/datastore-core/cjs/src/tiered.js:34:20)
    at IpnsPublisher._publishEntry (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/ipfs-core/cjs/src/ipns/publisher.js:85:19)
    at IpnsPublisher._putRecordToRouting (/Users/tiagoknoch/source/nestjs-tutorial/mycv/node_modules/ipfs-core/cjs/src/ipns/publisher.js:67:5)

Code sample:

  async test() {
    const ipfs = await create();
    const file = await ipfs.add({
      path: 'text.txt',
      content: new TextEncoder().encode(
        'Hello World ' + new Date().toISOString(),
      ),
    });
    const addr = `/ipfs/${file.cid.toString()}`;
    const res = await this.node.name.publish(addr);
    console.log(`https://gateway.ipfs.io/ipns/${res.name}`);
  }

tknoch-symphony avatar Sep 06 '22 07:09 tknoch-symphony

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

welcome[bot] avatar Sep 06 '22 07:09 welcome[bot]

Hey @tknoch-symphony any progress with your issue , I am having exactly the same error.

mbutan avatar Oct 12 '22 16:10 mbutan

@mbutan no luck, as you see I got no answer, same thing in IPFS forum. Let me know if you manage something

tknoch-symphony avatar Oct 13 '22 07:10 tknoch-symphony

I've solved this before by simply doing ipfs.stop() and ipfs.start() and retrying automatically which improves rate of it working 100s of times. as to why no idea.

legalizemath avatar Nov 09 '22 18:11 legalizemath

I found the source of the bug and posted a solution. it's in the issue https://github.com/ipfs/js-ipfs/issues/4267

algorista avatar Dec 15 '22 15:12 algorista

js-ipfs is being deprecated in favor of Helia. You can https://github.com/ipfs/js-ipfs/issues/4336 and read the migration guide.

Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see https://github.com/ipfs/js-ipfs/issues/4336).

This issue is most likely resolved in Helia, please try it out!

SgtPooki avatar May 26 '23 19:05 SgtPooki