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

Adding files with cid version 1 breaks pin ls #1531

Closed
victorb opened this issue Aug 30, 2018 · 3 comments
Closed

Adding files with cid version 1 breaks pin ls #1531

victorb opened this issue Aug 30, 2018 · 3 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@victorb
Copy link
Member

victorb commented Aug 30, 2018

Type:

Bug

Severity:

Medium

Description:

Adding files with --cid-version=1 specified makes running pin ls output error Invalid version, must be a number equal to 1 or 0

Steps to reproduce the error:

$ export IPFS_PATH=$(mktemp -d)

$ node src/cli/bin.js init
initializing ipfs node at /tmp/tmp.ymsJeqqGem
generating 2048-bit RSA keypair...done
peer identity: QmSjwLPSR54YspcuLLQEvbUvDJyNBQLCGmAvtmLqSfwUFn
to get started, enter:

        jsipfs files cat /ipfs/QmfGBRT6BbWJd7yUc2uYdaUZJBbnEFvTqehPFoSMQ6wgdr/readme


$ node src/cli/bin.js add -r --cid-version=1 test/fixtures/greater-than-default-max-chunk-size
added zdj7WbyyZoWVifUHUe58SNS184PpN8qAuCP6HpAY91iA8CveT greater-than-default-max-chunk-size

$ node src/cli/bin.js pin ls
/home/user/projects/ipfs/js-ipfs/node_modules/cids/src/index.js:235
      throw new Error(errorMsg)
      ^

Error: Invalid version, must be a number equal to 1 or 0
    at Function.validateCID (/home/user/projects/ipfs/js-ipfs/node_modules/cids/src/index.js:235:13)
    at new CID (/home/user/projects/ipfs/js-ipfs/node_modules/cids/src/index.js:105:9)
    at toB58String (/home/user/projects/ipfs/js-ipfs/src/core/components/pin.js:26:10)
    at nodes.map (/home/user/projects/ipfs/js-ipfs/src/core/components/pin.js:60:35)
    at Array.map (<anonymous>
    at dag._getRecursive (/home/user/projects/ipfs/js-ipfs/src/core/components/pin.js:60:12)
    at mapAsync (/home/user/projects/ipfs/js-ipfs/src/core/components/dag.js:160:11)
    at /home/user/projects/ipfs/js-ipfs/node_modules/async/internal/map.js:32:9
    at /home/user/projects/ipfs/js-ipfs/node_modules/async/internal/once.js:12:16
    at iteratorCallback (/home/user/projects/ipfs/js-ipfs/node_modules/async/eachOf.js:60:13)
@victorb victorb added the kind/bug A bug in existing code (including security flaws) label Aug 30, 2018
@alanshaw alanshaw added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue status/ready Ready to be worked P2 Medium: Good to have, but can wait until someone steps up labels Aug 30, 2018
@alanshaw
Copy link
Member

@victorbjelkholm do you know if this happens in master? We fixed #1518 recently - it might have effected it.

@victorb
Copy link
Member Author

victorb commented Aug 30, 2018

@alanshaw yes, this happens on current master (commit 46222e1)

@SgtPooki SgtPooki self-assigned this May 17, 2023
@SgtPooki
Copy link
Member

js-ipfs is being deprecated in favor of Helia. You can #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 afterwards (see #4336).

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants