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

bug: KuboClient not returning multiaddrs in FIND_PEER event #1985

Closed
p-shahi opened this issue Aug 22, 2023 · 10 comments
Closed

bug: KuboClient not returning multiaddrs in FIND_PEER event #1985

p-shahi opened this issue Aug 22, 2023 · 10 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization P0 Critical: Tackled by core team ASAP

Comments

@p-shahi
Copy link
Member

p-shahi commented Aug 22, 2023

          @p-shahi I tried upgrading to the latest but now I get this error. Seemingly finding the peer no longer works

Screenshot 2023-08-16 at 5 44 05 PM
swarm connecting the peer does work

Originally posted by @TheGreatAlgo in #1951 (comment)

UPDATE

the JS RPC Kubo client is currently is returning a successful FIND_PEER event despite not having any diall-able addresses, which leads the delegated-peer-routing findPeer method to throw a ERR_NOT_FOUND

Blocked by ipfs/js-kubo-rpc-client#176

@p-shahi p-shahi added the need/triage Needs initial labeling and prioritization label Aug 22, 2023
@p-shahi
Copy link
Member Author

p-shahi commented Aug 22, 2023

@maschad mind investigating this?

@maschad maschad self-assigned this Aug 22, 2023
@maschad maschad moved this to 🛠️ Todo in js-libp2p Aug 22, 2023
@maschad maschad moved this from 🛠️ Todo to 🏃‍♀️In Progress in js-libp2p Aug 23, 2023
@maschad maschad moved this from 🏃‍♀️In Progress to 🧱Blocked in js-libp2p Aug 24, 2023
@maschad maschad moved this from 🧱Blocked to 🏃‍♀️In Progress in js-libp2p Aug 26, 2023
@p-shahi p-shahi added the P0 Critical: Tackled by core team ASAP label Aug 30, 2023
@maschad maschad moved this from 🏃‍♀️In Progress to 🧱Blocked in js-libp2p Sep 3, 2023
@AustinFoss
Copy link

I'm not sure this is a problem anymore. I remember having this same thing a few weeks (maybe a little over a month ago and thought it was something about the kadDHT's client mode not working properly. I now can successfully call findPeer() from a browser node with:

      dht: kadDHT({
          clientMode: true
      })

libp2p version 0.46.6

@maschad
Copy link
Member

maschad commented Sep 4, 2023

Thanks for that feedback @AustinFoss but the description may have been a bit misleading, this issue actually is within the context of using delegated-peer-routing which relies on the JS RPC Kubo client to find peer's on a node's behalf. I've updated the description to reflect this.

For more details you can see ipfs/js-kubo-rpc-client#176

@maschad maschad changed the title bug: findPeer not working in v0.46.5 (unhandled runtime error) bug: KuboClient not returning multiaddrs in FIND_PEER event Sep 4, 2023
@maschad maschad added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization and removed need/triage Needs initial labeling and prioritization labels Sep 4, 2023
@SgtPooki
Copy link
Member

SgtPooki commented Sep 5, 2023

related to ipfs/kubo#10117

@p-shahi
Copy link
Member Author

p-shahi commented Sep 7, 2023

Are we reliant on the new Kubo RC to resolve this issue?

@aschmahmann
Copy link
Collaborator

AFAICT the issue here isn't that some functionality is bugged in kubo that's preventing js-libp2p from dialing peers just that kubo was returning effectively "yes I found the peer ... oh but no addresses" rather than "no I didn't find the peer".

You can be defensive in js-kubo-rpc-client or js-libp2p-delegated-peer-routing to turn a no address response into an error.

I suspect the user that filed this bug wants kubo to return their peer's address and let them dial it in js-libp2p though, and if that's not happening then something else is going wrong (e.g. the target node isn't a DHT client, etc.).

@maschad
Copy link
Member

maschad commented Sep 7, 2023

You can be defensive in js-kubo-rpc-client or js-libp2p-delegated-peer-routing to turn a no address response into an error.

So that's currently the case in delegated peer routing which js-libp2p was propagating here as the NOT_FOUND error.

I suspect the user that filed this bug wants kubo to return their peer's address and let them dial it in js-libp2p though, and if that's not happening then something else is going wrong (e.g. the target node isn't a DHT client, etc.).

Yup you are spot on, it was the DHT client being disabled, thanks @aschmahmann

@maschad maschad closed this as completed Sep 7, 2023
@github-project-automation github-project-automation bot moved this from 🧱Blocked to 🎉Done in js-libp2p Sep 7, 2023
@p-shahi
Copy link
Member Author

p-shahi commented Sep 7, 2023

@maschad I saw you closed this issue - I know you had a local setup to reproduce the original issue - were you able to apply @AustinFoss 's suggestion and get it working?

@maschad
Copy link
Member

maschad commented Sep 7, 2023

@maschad I saw you closed this issue - I know you had a local setup to reproduce the original issue - were you able to apply @AustinFoss 's suggestion and get it working?

That's correct, once clientMode was enabled I was able to retrieve the peerInfo via the findPeer method, you can see the example here

@p-shahi
Copy link
Member Author

p-shahi commented Sep 7, 2023

Cool

Thanks for the explanation as well @aschmahmann 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization P0 Critical: Tackled by core team ASAP
Projects
Archived in project
Development

No branches or pull requests

5 participants