Problem retrieving CID

I’m testing CID replication and cannot figure out what’s wrong on the following scenario.

I fire up a node on my local environment and connected it to a boostrap node I have running on the cloud.

ipfs bootstrap add /ip4/x.x.x.x/tcp/4001/p2p/12D3KooWEZdMhuKkgTf9awufAYJNxK6cRaUG4arsZzciV6PKdqoR
ipfs swarm connect /ip4/x.x.x.x/tcp/4001/p2p/12D3KooWEZdMhuKkgTf9awufAYJNxK6cRaUG4arsZzciV6PKdqoR
connect 12D3KooWEZdMhuKkgTf9awufAYJNxK6cRaUG4arsZzciV6PKdqoR success

You can see these command appear to be working fine. I upload a file on my local node, and I check from the bootstrap node if I’m the provider:

ipfs routing findprovs QmW1hFb4hupEnbwaWyMAZyS6D6CmLYysvjcie12Eiwp1Mv

12D3KooWNQpXcYyqE13dvHGKMaoadfBX9njivM6qQsgHkZgJg7o1

My peerd Id is indeed: 12D3KooWNQpXcYyqE13dvHGKMaoadfBX9njivM6qQsgHkZgJg7o1.

So the connection between bootstrap node and my local node look good. However, I do

ipfs cat QmW1hFb4hupEnbwaWyMAZyS6D6CmLYysvjcie12Eiwp1Mv

or

ipfs get QmW1hFb4hupEnbwaWyMAZyS6D6CmLYysvjcie12Eiwp1Mv

and so on, I’m unable to get the CID. The command just doesn’t return anything, it stays there and eventually times out

How is it that the bootstrap can identify who cas QmW1hFb4hupEnbwaWyMAZyS6D6CmLYysvjcie12Eiwp1Mv, but cannot get the content of it?

Hi, some pointers that should help:

  • The node with data is not publicly diallable and uses relay addresses
  • You can tell by doing ipfs id 12D3KooWNQpXcYyqE13dvHGKMaoadfBX9njivM6qQsgHkZgJg7o1 and seeing /p2p-circuit addresses – means you are behind a relay and explains the behavior you observed:
  • DCUtR may not work in 100% of network topologies. The fix, is to ensure your “data provider” node is publicly diallable (have public IP and port).
    • Rule of thumb: “retrieval clients” can be behind NATs and firewalls, but “reliable servers” should have a public address, if possible
    • If you run a server somewhere in the cloud, kubernetes, vps/rps, etc – ensure firewall allows incoming and outgoing traffic (both UDP and TCP) on port 4001, and that correct public address is announced.
      • If you have multiple layers of NATs/firewalls you may use Addresses.AppendAnnounce to manually announce the right public IP and port.
    • If you run a desktop node in a consumer ISP network, you may want to enable uPnP on your router and make sure Kubo config has Swarm.DisableNatPortMap=false), or manually forward/expose port 4001.
    • You may want to set Swarm.RelayClient.Enabled=false during testing, to ensure only direct connectivity is used on your “server”.
  • TIP: you can do CID retrieval diagnostic via IPFS Check online tool.
2 Likes

Thank you. I was able to troubleshoot various things that you mentioned. In the end the problem was that I had several VPN software running at the same time and it was causing issues.

1 Like