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

copied file cannot be found by peer #899

Closed
anarcat opened this issue Mar 8, 2015 · 11 comments
Closed

copied file cannot be found by peer #899

anarcat opened this issue Mar 8, 2015 · 11 comments
Labels
kind/bug A bug in existing code (including security flaws) topic/bitswap Topic bitswap topic/dht Topic dht topic/libp2p Topic libp2p

Comments

@anarcat
Copy link
Contributor

anarcat commented Mar 8, 2015

so @anarcat's ipfs adventures continue! the story so far:

  1. i added a 3.2GB file on my laptop, which took an hour (ipfs add horrendously slow #898)
  2. i copied it to my workstation, which took an hour, but completed (local transfer takes forever #872)
  3. my friend, during that time, tried to copy the file from the laptop, and got around 1GB of the file until i shutdown the laptop

Now the file is on the workstation, but my friend can't get the file. It's still stuck at 1GB, even though a daemon is running on the workstation. I expected this to just work...

@whyrusleeping
Copy link
Member

The way I would go about debugging this, is make sure you know the peer ID's of both machines, make sure they are both running, then start the file request.

run ipfs swarm peers and confirm that the other peer is in the list (this means there is an active connection between the two). If the peer does not show up, try a manual connection (if you have to do this, this means the DHT isnt resolving properly):

$ ipfs swarm connect /ip4/$IPADDR/tcp/$PORT/ipfs/$PEERID

If that completes successfuly, bitswap should send its wantlist to the newly connected peer, resulting in a continuation of the transfer, if the transfer resumes after the connection succeeds, then that tells me something is wonky in the DHT.

If both peers are connected directly, and still no transfer is happening (and youre sure the file is actually where you think it is) you should check ipfs bitswap stat.

This command should show a bunch of entries in your wantlist, these should be the blocks of the file you are requesting, in either case (blocks in wantlist or not) i have no idea what would cause that. Getting a stack dump of both machines would help me out a bunch.

@whyrusleeping whyrusleeping added kind/bug A bug in existing code (including security flaws) topic/bitswap Topic bitswap topic/libp2p Topic libp2p topic/dht Topic dht labels Mar 9, 2015
@anarcat
Copy link
Contributor Author

anarcat commented Mar 9, 2015

i don't see the other node in ipfs swarm peers. I can't connect using ipfs swarm connect /ipfs/$PEERID. He's probably behind NAT so I don't know his real IP.

I'm not the one wanting the file, so ipfs bitswap stat doesn't show anything in the wantlist.

How do I generate a stack dump?

@whyrusleeping
Copy link
Member

you can generate a stack dump with Ctrl + \ (it sends a SIGQUIT).

It he is behind a NAT, then he will have to try doing an ipfs swarm connect to you, If that fails as well, (you are both behind restrictive NATs), then we currently can't make that work. If thats the case, we should start looking at relay connections sooner rather than later.

@anarcat
Copy link
Contributor Author

anarcat commented Mar 9, 2015

we are both behind NAT.

funny thing is that he was able to transfer 1GB of the file while it was on the laptop, which is behind the same NAT! it's only since the laptop is closed that the file can't be transfered.

@anarcat
Copy link
Contributor Author

anarcat commented Mar 9, 2015

in other words, NAT to NAT transfer worked at some point, i believe.

@whyrusleeping
Copy link
Member

okay, then I would have him try doing an 'ipfs swarm connect' to you.

@anarcat
Copy link
Contributor Author

anarcat commented Mar 9, 2015

seems like there was some progress now, went from 1.08GB to 1.10GB... so i guess something is happening. maybe it just seems so slow (because of #872) that my friend thought it was just stopped..?

@micah
Copy link

micah commented Mar 9, 2015

It is definitely possible that I thought that it just stopped, it is hard to see progress when it is updating only at 1GB at a time. However, I was pretty sure that I had left it for a long time without it progressing at all (8hrs at minimum). I dont know if @anarcat was in my peer list then, but he is now.

@whyrusleeping
Copy link
Member

okay, slow is something that will likely be fixed by #900, if not... Ill have to debug some more!

@jbenet
Copy link
Member

jbenet commented Mar 9, 2015

I suspect there may be dht problems at play here. If there's an intermediate node that's our clients cant find they'll just stall. (since the dht isnt yet huge, it still suffers from nodes going up and down or our still imperfect NAT traversal). Though this stalling should not happen (even with dht problems) if you're directly connected. bitswap can bypass routing entirely if two nodes are directly connected and making forward progress.

@whyrusleeping maybe we should have something like a manual "ipfs routing provide -r "

@whyrusleeping
Copy link
Member

Going to close this for now, feel free to reopen if the problem persists or reappears

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) topic/bitswap Topic bitswap topic/dht Topic dht topic/libp2p Topic libp2p
Projects
None yet
Development

No branches or pull requests

4 participants