functionland / go-fula

Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
MIT License
13 stars 6 forks source link

ipfs-cluster Routing not found #222

Open ehsan6sha opened 8 months ago

ehsan6sha commented 8 months ago

ipfs-cluster does not add peer to cluster complaininig routing not found, however the underlying ipfs can ping and connect to the peer target:

ubuntu@pool-4:~$ curl -X POST http://127.0.0.1:5001/api/v0/routing/findpeer?arg=12D3KooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS
{"Extra":"","ID":"","Responses":[{"ID":"12D3KooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS","Addrs":["/ip4/45.130.104.233/udp/4001/quic-v1/p2p/12D3KooWNaR6pKmLt93oi3YyfsSRSeLPHMK1utVNpU9rJEmKm5vW/p2p-circuit","/ip4/51.81.243.144/tcp/4001/p2p/12D3KooWPRGH84dHpLedqFqK62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit","/ip6/2604:2dc0:200:f90::/tcp/4001/p2p/12D3KooWPRGH84dHpLedqFqK62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit","/ip4/51.81.243.144/udp/4001/quic-v1/webtransport/certhash/uEiAxM5W30eIsRnIOhmcMmhpDgSm1sTejbWiV004WNSgzJA/certhash/uEiDG2m2_cz0SkmAGZ1eEH2CWkpKujeoW-eRhFkfWJKyRbQ/p2p/12D3KooWPRGH84dHpLedqFqK62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit","/ip6/2604:2dc0:200:f90::/udp/4001/quic-v1/webtransport/certhash/uEiAxM5W30eIsRnIOhmcMmhpDgSm1sTejbWiV004WNSgzJA/certhash/uEiDG2m2_cz0SkmAGZ1eEH2CWkpKujeoW-eRhFkfWJKyRbQ/p2p/12D3KooWPRGH84dHpLedqFqK62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit","/ip6/2604:2dc0:200:f90::/udp/4001/quic-v1/p2p/12D3KooWPRGH84dHpLedqFqK62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit","/ip4/45.130.104.233/udp/4001/quic/p2p/12D3KooWNaR6pKmLt93oi3YyfsSRSeLPHMK1utVNpU9rJEmKm5vW/p2p-circuit","/ip4/51.81.243.144/udp/4001/quic-v1/p2p/12D3KooWPRGH84dHpLedqFqK62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit","/ip4/45.130.104.233/udp/4001/quic-v1/webtransport/certhash/uEiB2C2u0560eYgPa5k7885SbR2qJKtvFPZudGMmgn9KsOw/certhash/uEiAoJUfsbCICrAVv_pokPKNI30bQUnaMM6TiKMRdAEakbQ/p2p/12D3KooWNaR6pKmLt93oi3YyfsSRSeLPHMK1utVNpU9rJEmKm5vW/p2p-circuit"]}],"Type":2}
ubuntu@pool-4:~$ curl -X POST http://127.0.0.1:5001/api/v0/routing/findpeer -H "Content-Type: application/json" -d '{"peer_id":"12D3K
ooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS"}'
argument "peerID" is required
ubuntu@pool-4:~$ curl -X POST http://127.0.0.1:9094/peers -H "Content-Type: application/json" -d '{"peer_id":"12D3KooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS"}'
{"code":500,"message":"routing: not found"}

We do not have any code that directly calls this, but hte issue was that when a new peer was added to the pool, ipfs cluster was not showing it as peers, so I think this is the underlying cause of htat

ehsan6sha commented 8 months ago

even when the underlying ipfs is connected it throws the smae error:

ubuntu@pool-4:~$ curl -X POST "http://127.0.0.1:5001/api/v0/swarm/connect?arg=/ip4/51.81.243.144/tcp/4001/p2p/12D3KooWPRGH84dHpLedqFq
K62m42zcdPV8fCsRStSYJCwZdTeaj/p2p-circuit/p2p/12D3KooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS"
{"Strings":["connect 12D3KooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS success"]}
ubuntu@pool-4:~$ curl -X POST http://127.0.0.1:9094/peers -H "Content-Type: application/json" -d '{"peer_id":"12D3KooWScK4y7q6JdCSCNE3RLAwHkzpf1i2o6uiYs4aaFBwYZmS"}'
{"code":500,"message":"routing: not found"}
ehsan6sha commented 8 months ago

I did a test and it seems isue is in bootstraping the ipfs-cluster

2024-03-19T12:04:04.564-0400    ERROR   cluster ipfs-cluster/cluster.go:1049    failed to dial: failed to dial 12D3KooWFfj9VawA9KFeectbkWpmM2hhpfpeLewfmX8YBPQmHrm3: all dials failed
  * [/ip4/34.29.196.54/tcp/9096] failed to negotiate security protocol: read tcp4 172.22.102.163:9096->34.29.196.54:9096: read: connection reset by peer
2024-03-19T12:04:04.564-0400    ERROR   service ipfs-cluster-service/daemon.go:264      bootstrap to /dns4/1.pools.functionyard.fula.network/tcp/9096/p2p/12D3KooWFfj9VawA9KFeectbkWpmM2hhpfpeLewfmX8YBPQmHrm3 failed: failed to dial: failed to dial 12D3KooWFfj9VawA9KFeectbkWpmM2hhpfpeLewfmX8YBPQmHrm3: all dials failed
  * [/ip4/34.29.196.54/tcp/9096] failed to negotiate security protocol: read tcp4 172.22.102.163:9096->34.29.196.54:9096: read: connection reset by peer