Problem reaching a cluster peer through the REST API

Hello,

I am trying to build a web interface that would add files to IPFS through my IPFS Cluster network.
To do so, I know I should try to reach the cluster by reaching /ip4/anyClusterPeerIpAddress/tcp/9094 or via port 9095.

To test if I can first reach one peer via an other peer’s CLI running ipfs-cluster-ctl -l.
The issue I have doing so, is that whatever peer I try to reach from whatever other peer, I get a connection timeout code 0 error:

An error occurred:
  Code: 0
  Message: Get "http://clusterPeerIp:9094/peers": dial tcp clusterPeerIp:9094: i/o timeout

My webdev also tried to reach every peer from our web app using https://github.com/ipfs-cluster/js-cluster-client but for every request sent, we got an empty response, as if the server could not be reached or was sending back nothing.

I have tried many thing with firewalls to make sure the ports were open(which they already should be, as the peers have no trouble reaching eachothers via the 9096 port),
I have also tried to edit the service.json to allow API requests from any IP:

  "api": {
      "ipfsproxy": {
          "listen_multiaddress": "/ip4/0.0.0.0/tcp/9095",
          "node_multiaddress": "/ip4/127.0.0.1/tcp/5001",
     }
  }
"restapi": {
    "http_listen_multiaddress": "/ip4/0.0.0.0/tcp/9094",
}

But still no success. If anyone has any ideas of what might be going wrong, I’m open to any suggestions!

1 Like

Your configuration seems correct.

An i/o timeout usually means your firewall/router/something is indeed filtering traffic from or to that port. If you can talk to it locally but not from a different location on the network that is a pretty clear signal.

I just checked and I can indeed make ipfs-cluster-ctl -l work between two cluster peers operating under the same local internet network (though on 2 different machines).

There might be some extra step I have not done yet, like maybe port forwarding(though I tried) or something of that fashion. I’m kinda stuck here I admit lol

Finally made it work, problem was coming from 2 layers of firewall from my VPS provider that were messing with each others. If anyone encouters the same problem, don’t forget to ask your provider if they have a master firewall lol