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

Sometimes IPFS can't find the file #5461

Closed
dlnuwlx opened this issue Sep 14, 2018 · 9 comments
Closed

Sometimes IPFS can't find the file #5461

dlnuwlx opened this issue Sep 14, 2018 · 9 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@dlnuwlx
Copy link

dlnuwlx commented Sep 14, 2018

Hi experts
I have two PCs with external ip (node A , B)
A: ipfs init & ipfs daemon & ipfs add "file"
B: ipfs init & ipfs daemon & ipfs get "hash of file"
Node B hungs and can't download the file, but if run "ipfs swarm connect(A->B or B->A)" , B can download the file. why node B can't find the file by DHT net? Is "ipfs swarm connect” a must?

Tips: if run "ipfs swarm peers" in A or B, I can see many peers, so bootstraps is working!

@dlnuwlx
Copy link
Author

dlnuwlx commented Sep 14, 2018

update!
Even if run "ipfs swarm connect(A->B or B->A)", sometimes B download the file(about 1M) more than three minutes

@magik6k
Copy link
Member

magik6k commented Sep 14, 2018

Which version are you using? (ipfs version --all).

@dlnuwlx
Copy link
Author

dlnuwlx commented Sep 14, 2018

Which version are you using? (ipfs version --all).

go-ipfs version: 0.4.17-
Repo version: 7
System version: amd64/linux
Golang version: go1.10.3

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Sep 14, 2018
@eingenito
Copy link
Contributor

Hey @dlnuwlx did you solve this problem? ipfs swarm connect shouldn't be required between two hosts sharing files. But it can speed up the time it takes ipfs to begin transferring data. If your nodes are already connected (like via swarm connect) the fetching host won't need to ask for records from the DHT to start retrieving the data; they can begin transferring data immediately.

Can you try fetching provider records directly from the DHT by running ipfs dht findprovs [hash of file]? That command should return the peer IDs of one or more hosts that have advertised themselves as providers of that hash in the DHT. If that command times out then it indicates a problem and would prevent your (unconnected) ipfs instance running get from ever learning of the providing ipfs instance, and therefore no file transfer.

@dlnuwlx
Copy link
Author

dlnuwlx commented Sep 23, 2018

Hi eingenito
Thanks, Got it,
I found that "ipfs get HASH" was slower than "https://ipfs.io/ipfs/HASH" by browser, "https://ipfs.io" is also a ipfs node as a gateway, right?

@eingenito
Copy link
Contributor

Yes - ipfs.io is a public ipfs gateway. If you can see unique content you've published there it probably means that your providing node (the node you invoked ipfs add on) successfully published a provider record and its peer information to the DHT. It also means that the gateway was able to receive that data from your node via bitswap. That would seem to indicate that there's an issue with your ipfs get node. If the gateway works for your use case that's great.

I'm gonna close your issue, but feel free to reopen if you have questions. Actually you may get better turnaround if you post questions to https://discuss.ipfs.io/ which also makes them more accessible for others searching for information.

@kikoncuo
Copy link

Same problem when testing in a private swarm.

I have nodes 1, 2 and 3.

Node 1 is connected to 2, node 2 is connected to 3.

1 can't access files from 3 unless 2 has them and vice-versa.

go-ipfs version: 0.4.22-
Repo version: 7
System version: amd64/windows
Golang version: go1.12.7

@Stebalien
Copy link
Member

@kikoncuo Please file a new issue.

@kikoncuo
Copy link

Done I´ve changed the question a bit due to some experiments, I think I found the problem #6711

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)
Projects
None yet
Development

No branches or pull requests

5 participants