Skip to content
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

IPNS could not resolve name through Gateway #9927

Closed
3 tasks done
Tracked by #9911
Man-Jain opened this issue Jun 9, 2023 · 7 comments · Fixed by #10020
Closed
3 tasks done
Tracked by #9911

IPNS could not resolve name through Gateway #9927

Man-Jain opened this issue Jun 9, 2023 · 7 comments · Fixed by #10020
Assignees
Labels
effort/days Estimated to take multiple days, but less than a week exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up topic/ipns Topic ipns

Comments

@Man-Jain
Copy link

Man-Jain commented Jun 9, 2023

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.

@Man-Jain Man-Jain added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jun 9, 2023
@lidel
Copy link
Member

lidel commented Jun 12, 2023

@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?

@lidel lidel added the need/author-input Needs input from the original author label Jun 12, 2023
@Man-Jain
Copy link
Author

Man-Jain commented Jun 12, 2023

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
Copy link
Contributor

Jorropo commented Jun 12, 2023

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. ipfs/boxo@1226276
  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
Copy link
Member

hacdias commented Jun 13, 2023

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

@hacdias hacdias self-assigned this Jun 13, 2023
@hacdias hacdias moved this to 🥞 Todo in IPFS Shipyard Team Jun 13, 2023
@Jorropo
Copy link
Contributor

Jorropo commented Jun 30, 2023

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.

@Jorropo Jorropo added exp/expert Having worked on the specific codebase is important P1 High: Likely tackled by core team if no one steps up P0 Critical: Tackled by core team ASAP and removed need/triage Needs initial labeling and prioritization need/author-input Needs input from the original author P1 High: Likely tackled by core team if no one steps up labels Jun 30, 2023
@lidel lidel changed the title IPNS could not resolve name through Gateway - Deployed on Kubernetes IPNS could not resolve name through Gateway Jul 3, 2023
@lidel lidel added topic/ipns Topic ipns P1 High: Likely tackled by core team if no one steps up effort/days Estimated to take multiple days, but less than a week and removed P0 Critical: Tackled by core team ASAP labels Jul 3, 2023
@lidel
Copy link
Member

lidel commented Jul 3, 2023

Triage notes:

  • P0→P1 since IPNS works, just slower than it could
  • We will most likely park this until @hacdias is back from vacation (unless someone else has bandwidth to debug and propose fix)

@BigLep BigLep moved this from 🥞 Todo to 🏃‍♀️ In Progress in IPFS Shipyard Team Jul 6, 2023
@BigLep BigLep assigned Jorropo and unassigned hacdias Jul 6, 2023
@BigLep
Copy link
Contributor

BigLep commented Jul 6, 2023

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.

Jorropo added a commit that referenced this issue Jul 19, 2023
That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

Fixes: #9927
@Jorropo Jorropo moved this from 🏃‍♀️ In Progress to 🔎 In Review in IPFS Shipyard Team Jul 19, 2023
Jorropo added a commit that referenced this issue Jul 19, 2023
That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

This also include other error handling bug fixes inside `go-libp2p-routing-helpers`.

Fixes: #9927
Jorropo added a commit that referenced this issue Jul 19, 2023
That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

This also include other error handling bug fixes inside `go-libp2p-routing-helpers`.

Fixes: #9927
Jorropo added a commit that referenced this issue Jul 19, 2023
That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

This also include other error handling bug fixes inside `go-libp2p-routing-helpers`.

Fixes: #9927
@BigLep BigLep mentioned this issue Jul 20, 2023
Jorropo added a commit that referenced this issue Jul 25, 2023
That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

This also include other error handling bug fixes inside `go-libp2p-routing-helpers`.

Fixes: #9927
Jorropo added a commit that referenced this issue Jul 25, 2023
* fix: mark ipns pubsub router DoNotWaitForSearchValue

That means if the DHT has finished searching and no one responded over pubsub *yet*, we will not spend 1 minute searching for no reason.

This also include other error handling bug fixes inside `go-libp2p-routing-helpers`.

Fixes: #9927

* routing: bring back the old IPNS behaviour

Stop making this configurable let everything race like it used to do.
@github-project-automation github-project-automation bot moved this from 🔎 In Review to 🎉 Done in IPFS Shipyard Team Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to take multiple days, but less than a week exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up topic/ipns Topic ipns
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants