Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs add with two files only adds one of them in 0.4.20 #6254

Closed
olizilla opened this issue Apr 25, 2019 · 7 comments
Closed

ipfs add with two files only adds one of them in 0.4.20 #6254

olizilla opened this issue Apr 25, 2019 · 7 comments
Assignees

Comments

@olizilla
Copy link
Member

Version information:

$ ipfs version --all
go-ipfs version: 0.4.20-
Repo version: 7
System version: amd64/darwin
Golang version: go1.12.4

Type: bug

Description:

Adding 2 files via the CLI returns the cid for only 1 of the files:

$ iim use go 0.4.20
$ ipfs version
ipfs version 0.4.20
$ echo "A" > a.txt
$ echo "B" > b.txt
$ ipfs add a.txt b.txt
added QmNRpQVA5n7osjtyjYaWEQpwYnbV1QoVkrSe7oyccMJh1m a.txt
 2 B / 4 B [================================>--------------------------------]  50.00%

For comparison, on 0.4.19

$ iim use go 0.4.19
$ ipfs version
ipfs version 0.4.19
$ ipfs add a.txt b.txt
added QmNRpQVA5n7osjtyjYaWEQpwYnbV1QoVkrSe7oyccMJh1m a.txt
added QmbN4uJU4zirdG1g9qcYYAAHNCU6MRHZBSwTx61WGVKich b.txt
 4 B / 4 B [=================================================================] 100.00%

Same issue occurs via the http api, found will debugging a build failure on js-ipfs-http-client after updating to 0.4.20, see: ipfs-inactive/js-ipfs-http-client#973

@olizilla olizilla changed the title ipfs add with two files only the cid for one of them in 0.4.20 ipfs add with two files only returns the cid for one of them in 0.4.20 Apr 25, 2019
@olizilla
Copy link
Member Author

on the cli, it doesn't seem to be the argument order that determines which file will be added, but the first on when alphabetically ordered. If you add a.txt and b.txt it doesn't matter which order you pass them in, it's always the CID for a.txt that gets reported

$ ipfs add b.txt a.txt
added QmNRpQVA5n7osjtyjYaWEQpwYnbV1QoVkrSe7oyccMJh1m a.txt
 2 B / 4 B [================================>--------------------------------]  50.00%

$ ipfs add a.txt b.txt
added QmNRpQVA5n7osjtyjYaWEQpwYnbV1QoVkrSe7oyccMJh1m a.txt
 2 B / 4 B [================================>--------------------------------]  50.00%

@alanshaw
Copy link
Member

only returns the cid

It's a little worse than that - it actually only adds one file:

⨎ ipfs add --only-hash extreme-closeup.jpg 
added QmdpvgAXfyhyk4Erwge93CkiWt7TpndYm4SW3mZndRBpsc extreme-closeup.jpg
 70.99 KiB / 70.99 KiB [=============================================================================================================================] 100.00%

⨎ ipfs add alan-cat.jpg extreme-closeup.jpg 
added QmXmYiRaRg4YRVdtPRv3CgH1sje7xzjNPv9yCyUcSe8SAC alan-cat.jpg
 100.83 KiB / 171.81 KiB [========================================================================>--------------------------------------------------]  58.68%

⨎ ipfs ls QmdpvgAXfyhyk4Erwge93CkiWt7TpndYm4SW3mZndRBpsc
Error: merkledag: not found

@olizilla olizilla changed the title ipfs add with two files only returns the cid for one of them in 0.4.20 ipfs add with two files only adds one of them in 0.4.20 Apr 25, 2019
@magik6k
Copy link
Member

magik6k commented Apr 25, 2019

This is probably a regression from #6019. Should be easy to fix

@magik6k
Copy link
Member

magik6k commented Apr 25, 2019

Pushed a fix: #6255

@Stebalien
Copy link
Member

Does this relate to #3300?

@Stebalien
Copy link
Member

Answer: no. That's an issue in go-ipfs-cmds (we put all arguments into a single directory)

@olizilla
Copy link
Member Author

Could you share a rough ETA for when this fix will land in a release so we can schedule an ipfs-desktop release. Folks are going to start asking us for a relase with 0.4.20 in, but this is a blocker for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants