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 {ls||cat} <hash> halts, while gateway.ipfs shows the file right away #3530
Comments
|
@avatar-lavventura Let me guess that both your client and server nodes are on the same LAN behind a firewall? I found some weird behaviour when 2 nodes were running that way in my LAN. Both wanted to punch the same hole in the NAT and only one of them succeeded. Unfortunately even if this is your case, I have no idea what is the real problem. It just sounds that if you stop one of the daemons, you might get better results for now. |
|
@wigy-opensource-developer thank you for your response. I am still facing with the same problem. My server runs behind a firewall (on a university domain, so there has to be a firewall). On my case if my client on the same LAN behind the same firewall, there is not halt issue between my client and server. But if the client is outside of the LAN, it halts as I explained. The problem may arise because of the firewall, but the public gateways still could retrieve the added data via ipfs, from my server? |
|
i have a similar issue: a command like this takes forever on my local osx machine (ipfs 0.4.6) but i can see it instantly at: https://ipfs.io/ipfs/QmWvQ8fz9XMJoxQHV5BHKmVqYoVNWkckUxQ8LNSgEkdBgD/bin further if i do:
https://ipfs.io/ipfs/QmWvQ8fz9XMJoxQHV5BHKmVqYoVNWkckUxQ8LNSgEkdBgD/ and then its instantaneous. it almost seems like i can only get to the peer containing these things if and only if i reach it through the ipfs gateway. the peer and client are on two different networks. |
|
ok in my case - i just learned that incoming port 4001 may be blocked. but in that case how does any data get out? since i am able to retrieve things via ipfs.io |
|
@satra Data can get out via connections your node makes outwards. In NATed networks, you can always dial out, but dialing in is the tricky part. In this case, your node behind the firewall had made a connection out to the ipfs.io gateway nodes, but not to your other node outside the network. |
|
@whyrusleeping - i have since changed the firewall to open port 4001, and i can telnet to this port from a remote machine. on this remote machine i start a daemon and do i remove everything from bootstrap and add only the id of the remote node, i.e. hoping that this effectively creates a two node network. and then redo is there a way to diagnose what's going on with traffic? |
|
@satra when you telnet to that port does it print something like I would verify connectivity between the peers by doing |
|
@whyrusleeping - thank you. |
|
@satra and that |
|
@whyrusleeping - yes it does work on the other node. it seems it's related to size of the folder (which doesn't make much sense, because the peer should have been able to pass on all the info).
should return instantly since it's on the ipfs gateway now. that will show you the folders by size. try ls with /docs vs /bin. |
|
also |
|
@satra Hrm... fetching is realllly slow for me, which may explain why it appears to hang. I was able to fetch all the directory entries in 2m45s. The |
|
@satra The issue here is that |
|
thanks for the explanations. is the type information not cached on the peer with the refs? especially since i've pinned this directory on that peer. does it have to fetch the block? |
|
The type information is cached on that peer if it has all the blocks already, yes. But your laptop (the one where This really makes me think that |
|
@whyrusleeping - thank you for walking me through this. now i can move onto one of my actual use cases and see if that works. |
|
@satra no problem! Definitely let us know if you have any other issues |
|
I guess on my case port:4001 was closed to public. Only nodes that on the same network was able to access it but nodes on the external network always face with halt issue. @satra |
|
This issue seems to be resolved, please reopen as needed. |
avatar-lavventura commentedDec 21, 2016
•
edited
Version information:
go-ipfs version: 0.4.4-
Repo version: 4
System version: amd64/linux
Golang version: go1.7
Description:
I am using ipfs integrated to Ethereum but in a very basic manner.
In this following example: a client stores a ipfs hash value inside a contract at ethereum. Server would access to already stored ipfs hash value by using the same contract. When ipfs hash value is obtained at the server, server node could obtain the ipfs file by using
ipfs {ls||cat||get} < hash_value >. But when I useipfs {ls||cat||get} < hash_value >there may occur a halt. Since I am doing all this process inside a script halt problem locks my script.On the contrary I could obtain the files from
ipfs.gateway(which uses public gateways) usingwget(this process force gateways to cache the content till its garbage collector clear up the disk space).[Q] Should I try to retrieve files using
wget -r "https://ipfs.io/ipfs/< some_hash >"since its connection seems more reliable than usingipfs {cat||ls||get} < my_hash >? I am not questioningipfs, I just want to learn what my cause this problem or where I made a mistake and come up with a solution. So far usingwgetthroughipfs.gatewaysolved the halt problem I am facing with.Explanation of this question as follows:
I have a client and server node. On both machines, on the background I am running the following command as guided on the
ipfstutorials:On my client machine, I have add a file into ipfs:
After that on my server, I do try to retrieve the file:
Following error message showed up multiple times.
ipfs {cat||get||ls} < my_hash >halts and I do wait a long time but nothing happens, maybe after few hours it works (The system acting unreliably on my case). This situation is weird because same process was working before without any problem and suddenly it may stop working as it should be.On the other hand, I can see the file right away at my browser after
ipfs addis done: url:https://gateway.ipfs.io/ipfs/< some_hash >or could download the file usingwget -r "https://ipfs.io/ipfs/< my_hash >"".Please note that if a folder added into the
ipfs add -r folder_nameit could retrieved from folder's hash with the following command:Thank you for your valuable time and help.
The text was updated successfully, but these errors were encountered: