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 commands want to consume all stdin #858

Closed
joeyh opened this issue Mar 5, 2015 · 7 comments
Closed

ipfs commands want to consume all stdin #858

joeyh opened this issue Mar 5, 2015 · 7 comments
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) topic/cleanup Topic cleanup topic/commands Topic commands

Comments

@joeyh
Copy link

joeyh commented Mar 5, 2015

When building a git-annex to ipfs bridge, I noticed that some ipfs commands were blocking, trying to read stdin. In this case, stdin was being used for git-annex IPC.

Commands observed to read stdin in this way:

ipfs cat $addr > file

ipfs add -q file

In both cases, I had to use </dev/null to provide ipfs with an empty stdin to avoid it hanging.

@joeyh
Copy link
Author

joeyh commented Mar 5, 2015

Also, with stdin set up this way,

ipfs get --output=$file $addr

fails with "Error: Expected 1 arguments, got 2"

Amazingly, </dev/null fixed that too. So stdin is somehow influencing argument processing.

@whyrusleeping
Copy link
Member

@mappum Any ideas on this one?

@whyrusleeping whyrusleeping added kind/bug A bug in existing code (including security flaws) topic/commands Topic commands labels Mar 5, 2015
@jbenet
Copy link
Member

jbenet commented Mar 12, 2015

the problem here is that the cmds lib is to aggressive on parsing args. It treats stdin as an input always. It should not, it should only do so for commands that enable it, and where the other arguments don't obviate stdin.

@jbenet
Copy link
Member

jbenet commented Apr 17, 2015

We should fix this soon-- it's really annoying for users.

@jbenet
Copy link
Member

jbenet commented Apr 17, 2015

ipfs/team-mgmt#5

@chriscool
Copy link
Contributor

I think this issue is the same as issue #1141 (ipfs cat "multihash too short" error when using stdin) and is fixed by PR #1238 (Improve stdin parsing).

@chriscool
Copy link
Contributor

This should be fixed as PR #1238 as been merged.

@RichardLitt RichardLitt added the exp/novice Someone with a little familiarity can pick up label Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) topic/cleanup Topic cleanup topic/commands Topic commands
Projects
None yet
Development

No branches or pull requests

5 participants