ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
15.99k stars 3k forks source link

IPNS could not resolve name through Gateway #9927

Closed Man-Jain closed 1 year ago

Man-Jain commented 1 year ago

Checklist

Installation method

ipfs-desktop

Version

0.20.0

Config

{
"API": {
    "HTTPHeaders": {}
  },
  "Addresses": {
    "API": "/ip4/0.0.0.0/tcp/5001",
    "Announce": [],
    "AppendAnnounce": [
      "/ip4/52.22.234.98/tcp/30001",
      "/ip4/52.22.234.98/udp/30001/quic",
      "/ip4/52.22.234.98/udp/30001/quic-v1",
      "/ip4/52.22.234.98/udp/30001/quic-v1/webtransport",
      "/ip4/52.22.234.98/tcp/4001",
      "/ip4/52.22.234.98/udp/4001/quic",
      "/ip4/52.22.234.98/udp/4001/quic-v1",
      "/ip4/52.22.234.98/udp/4001/quic-v1/webtransport"
    ],
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "NoAnnounce": [
      "/ip4/10.0.0.0/ipcidr/8",
      "/ip4/100.64.0.0/ipcidr/10",
      "/ip4/169.254.0.0/ipcidr/16",
      "/ip4/172.16.0.0/ipcidr/12",
      "/ip4/192.0.0.0/ipcidr/24",
      "/ip4/192.0.2.0/ipcidr/24",
      "/ip4/192.168.0.0/ipcidr/16",
      "/ip4/198.18.0.0/ipcidr/15",
      "/ip4/198.51.100.0/ipcidr/24",
      "/ip4/203.0.113.0/ipcidr/24",
      "/ip4/240.0.0.0/ipcidr/4",
      "/ip6/100::/ipcidr/64",
      "/ip6/2001:2::/ipcidr/48",
      "/ip6/2001:db8::/ipcidr/32",
      "/ip6/fc00::/ipcidr/7",
      "/ip6/fe80::/ipcidr/10"
    ],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic",
      "/ip4/0.0.0.0/udp/4001/quic-v1",
      "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
      "/ip6/::/udp/4001/quic",
      "/ip6/::/udp/4001/quic-v1",
      "/ip6/::/udp/4001/quic-v1/webtransport"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 1048576,
    "GCPeriod": "12h",
    "HashOnRead": false,
    "Spec": {
      "child": {
        "path": "badgerds",
        "syncWrites": false,
        "truncate": true,
        "type": "badgerds"
      },
      "prefix": "badger.datastore",
      "type": "measure"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "100GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": false
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": true,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "OptimisticProvide": false,
    "OptimisticProvideJobsPoolSize": 0,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": {
      "dweb.link": {
        "NoDNSLink": false,
        "Paths": [
          "/ipfs",
          "/ipns"
        ],
        "UseSubdomains": true
      }
    },
    "RootRedirect": ""
  },
  "Identity": {
    "PeerID": "somepeeIddd",
    "PrivKey": "somekey"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 512,
    "UsePubsub": true
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": true,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": null
  },
  "Pinning": {
    "RemoteServices": {}
  },
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {},
  "ResourceMgr": {
    "Limits": {
      "System": {
        "ConnsInbound": 1024
      }
    }
  },
  "Routing": {
    "Methods": null,
    "Routers": null
  },
  "Swarm": {
    "AddrFilters": [
      "/ip4/10.0.0.0/ipcidr/8",
      "/ip4/100.64.0.0/ipcidr/10",
      "/ip4/169.254.0.0/ipcidr/16",
      "/ip4/172.16.0.0/ipcidr/12",
      "/ip4/192.0.0.0/ipcidr/24",
      "/ip4/192.0.2.0/ipcidr/24",
      "/ip4/192.168.0.0/ipcidr/16",
      "/ip4/198.18.0.0/ipcidr/15",
      "/ip4/198.51.100.0/ipcidr/24",
      "/ip4/203.0.113.0/ipcidr/24",
      "/ip4/240.0.0.0/ipcidr/4",
      "/ip6/100::/ipcidr/64",
      "/ip6/2001:2::/ipcidr/48",
      "/ip6/2001:db8::/ipcidr/32",
      "/ip6/fc00::/ipcidr/7",
      "/ip6/fe80::/ipcidr/10"
    ],
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 1000,
      "LowWater": 250
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {
      "Limits": {}
    },
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Description

I have an ipfs gateway running on a kuberentes, all ports exposed and appendAddress has the ip and random port(4001) of the ipfs gateway node, usePubsub is true and on running ipfs name resolve & through ipfs.io i’m able to resolve IPNS hash.

But I have not been able to resolve IPNS hash through the gateway on port 8080.

I keep getting the error could not resolve name.

lidel commented 1 year ago

@Man-Jain are you failing to resolve on the same machine that published the record that works fine on ipfs.io, or a different one?

Man-Jain commented 1 year ago

Yes, failing to resolve on the same machine from which the record was published. It's also not able to resolve any other IPNS record not published from that node.

Jorropo commented 1 year ago

There are two bugs here:

  1. Your IPNS entries should be cached by your own node. There were a bug that happend during some refactor but I reverted the problematic commit. https://github.com/ipfs/boxo/commit/1226276e8e71a0f5ba0b424797ec6841ca09d123
  2. Even if cache fail you should be able to reach on the network to fetch the record you posted yourself.

So I tested this behaviour (fetching my own record), I can see my own node is reaching out to the DHT Capture d’écran du 2023-06-12 17-57-18 which means at least self-caching is broken. However it loads for me (resolved with the DHT).

hacdias commented 1 year ago

I will likely look (and possibly cleanup) boxo/namesys when working on ipfs/boxo#329, so I can take this one.

Jorropo commented 1 year ago

I found out 3 bugs that prevents IPNS from working quickly right now. They make it always wait 1 minute before resolving any IPNS record, even if you get the first record in 10ms and DHT quorum in 200ms. https://filecoinproject.slack.com/archives/C04M8232QRW/p1688125350678669?thread_ts=1688118049.947789&cid=C04M8232QRW

The DHT quorum is between 200~400ms for me, this is the expected IPNS resolution speed and would be if we were not artificially slowing it down.

lidel commented 1 year ago

Triage notes:

BigLep commented 1 year ago

2023-07-06 conversation: in addition to doing the fix and test, we need to create metrics and have it show up in Thunderdome. @lidel will create the followup issue for splitting out metrics between dnslink and ipns and making sure it shows up in Thunderdome.