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

Failure to establish circuit relay reservation from browser peer #207

Open
jjhbk opened this issue Dec 1, 2024 · 5 comments
Open

Failure to establish circuit relay reservation from browser peer #207

jjhbk opened this issue Dec 1, 2024 · 5 comments

Comments

@jjhbk
Copy link

jjhbk commented Dec 1, 2024

Screenshot 2024-12-01 055134

@2color
Copy link
Collaborator

2color commented Jan 7, 2025

Thanks for opening this issue.

This is basically due to the browser failing to get a circuit relay reservation. The reason this happens is that we only connect to a single app specific bootstrap node (12D3KooWFhXabKDwALpzqMbto94sB7rvmZ6M28hs9Y9xSopDKwQr) which is running the go-peer code.

We could fix this a number of ways:

  • Connect to DHT from the browser and do a random walk to find a random circuit relay. This will add a lot of noise, but reduce the risk of not finding a circuit relay reservation.
  • Increase the limits on the Go peer. This will likely just kick the can down the road. Provisioned resources tend to get quickly exhausted.

I recently increased the limits

resources := relayv2.DefaultResources()
resources.MaxReservations = 256
_, err = relayv2.New(h, relayv2.WithResources(resources))
if err != nil {
panic(err)
}
but since the go-peer joins the DHT, circuit relay reservations are reserved by random peers

@nopedawn
Copy link

I had a same issue, but using cargo run how do i fix this on rust ?

@2color 2color changed the title Error displayed for js-peer example Failure to establish circuit relay reservation Jan 21, 2025
@2color 2color changed the title Failure to establish circuit relay reservation Failure to establish circuit relay reservation from browser peer Jan 21, 2025
@2color
Copy link
Collaborator

2color commented Jan 21, 2025

I had a same issue, but using cargo run how do i fix this on rust ?

Please be more specific. Which node are you connecting to?

@acul71
Copy link

acul71 commented Jan 21, 2025

Didn't work in brave browser (trying 3-4 times in a row doing refresh) linux
console:

lockdown-install.js:1 Removing unpermitted intrinsics
delegated-ipfs.dev/routing/v1/peers/bafzaajaiaejcav3fwj35j27gor72ap5aqhiz44qmje4gcxvo5wogjmczwhk4xp7p:1 
        
        
       Failed to load resource: the server responded with a status of 404 ()
ctx.tsx:48 failed to start libp2p Error: Bootstrap requires a list of peer addresses
    at new hf (index.js:54:1)
    at cu.peerDiscovery (index.js:142:1)
    at libp2p.js:121:77
    at Array.forEach (<anonymous>)
    at new cc (libp2p.js:120:1)

Then it did work but I can see this in console:

lockdown-install.js:1 Removing unpermitted intrinsics
index.js:22 Uncaught (in promise) AbortError: The operation was aborted
    at i (index.js:22:1)
    at uz.closeWrite (abstract-stream.js:228:19)
    at uz.close (abstract-stream.js:187:1)
    at muxer.js:248:1
    at Array.map (<anonymous>)
    at uH.close (muxer.js:248:1)
    at co.close [as _close] (upgrader.js:427:1)
    at co.close (index.js:118:1)
    at pg (initiate-connection.js:148:1)
    at async pw.dial (transport.js:92:63)
i @ index.js:22
closeWrite @ abstract-stream.js:228
close @ abstract-stream.js:187
(anonymous) @ muxer.js:248
close @ muxer.js:248
close @ upgrader.js:427
close @ index.js:118
pg @ initiate-connection.js:148
index.js:22 Uncaught (in promise) AbortError: The operation was aborted
    at i (index.js:22:1)
    at dM.closeWrite (abstract-stream.js:228:19)
    at dM.close (abstract-stream.js:187:1)
    at t.close (stream-to-ma-conn.js:15:1)
    at co.close [as _close] (upgrader.js:429:1)
    at async co.close (index.js:118:1)
    at async pg (initiate-connection.js:148:1)
    at async pw.dial (transport.js:92:63)
    at async queue.add.peerId [as fn] (dial-queue.js:169:1)
    at async i (index.js:28:1)
i @ index.js:22
closeWrite @ abstract-stream.js:228
close @ abstract-stream.js:187
t.close @ stream-to-ma-conn.js:15
close @ upgrader.js:429
await in close
close @ index.js:118
pg @ initiate-connection.js:148
index.js:22 Uncaught (in promise) AbortError: The operation was aborted
    at i (index.js:22:1)
    at uz.closeWrite (abstract-stream.js:228:19)
    at uz.close (abstract-stream.js:187:1)
    at muxer.js:248:1
    at Array.map (<anonymous>)
    at uH.close (muxer.js:248:1)
    at co.close [as _close] (upgrader.js:427:1)
    at co.close (index.js:118:1)
    at pg (initiate-connection.js:148:1)
    at async pw.dial (transport.js:92:63)
i @ index.js:22
closeWrite @ abstract-stream.js:228
close @ abstract-stream.js:187
(anonymous) @ muxer.js:248
close @ muxer.js:248
close @ upgrader.js:427
close @ index.js:118
pg @ initiate-connection.js:148
await in pg
dial @ transport.js:92
await in dial
dial @ transport-manager.js:86
queue.add.peerId @ dial-queue.js:169
await in queue.add.peerId
run @ job.js:55
tryToStartAnother @ index.js:66
add @ index.js:100
dial @ dial-queue.js:137
openConnection @ index.js:286
dial @ libp2p.js:223
mD @ libp2p.ts:138
2index.js:22 Uncaught (in promise) AbortError: The operation was aborted
    at i (index.js:22:1)
    at dM.closeWrite (abstract-stream.js:228:19)
    at dM.close (abstract-stream.js:187:1)
    at t.close (stream-to-ma-conn.js:15:1)
    at co.close [as _close] (upgrader.js:429:1)
    at async co.close (index.js:118:1)
    at async pg (initiate-connection.js:148:1)
    at async pw.dial (transport.js:92:63)
    at async queue.add.peerId [as fn] (dial-queue.js:169:1)
    at async i (index.js:28:1)

Refreshing getting another error:

lockdown-install.js:1 Removing unpermitted intrinsics
Failed to establish a connection to https://147.28.186.157:9095/.well-known/libp2p-webtransport?type=noise: net::ERR_QUIC_PROTOCOL_ERROR.
ctx.tsx:48 failed to start libp2p NoValidAddressesError: Transport (@libp2p/circuit-relay-v2-transport) could not listen on any available address
    at l5.listen (transport-manager.js:193:1)
    at async l5.afterStart (transport-manager.js:50:1)
    at async components.js:24:1
    at async Promise.all (/index 0)
    at async Proxy._invokeStartableMethod (components.js:21:1)
    at async Proxy.afterStart (components.js:35:1)
    at async cc.start (libp2p.js:180:1)
    at async cu (index.js:53:1)
    at async mT (libp2p.ts:41:12)
    at async ctx.tsx:37:24
(anonymous) @ ctx.tsx:48
await in (anonymous)
(anonymous) @ ctx.tsx:51
uI @ react-dom.production.min.js:243
oU @ react-dom.production.min.js:285
o @ react-dom.production.min.js:281
x @ scheduler.production.min.js:13
T @ scheduler.production.min.js:14

@2color
Copy link
Collaborator

2color commented Jan 22, 2025

Thanks @acul71. That's helpful.

Failure to find addresses for app bootstrapper (go-peer)

delegated-ipfs.dev/routing/v1/peers/bafzaajaiaejcav3fwj35j27gor72ap5aqhiz44qmje4gcxvo5wogjmczwhk4xp7p:1
Failed to load resource: the server responded with a status of 404 ()

This is somewhat surprising. What's happening here is that the delegated routing endpoint (powered by someguy fails to resolve the peer. I have been able to reproduce this, but I'm still investigating why this is happening. Tracking issue: ipfs/someguy#99

3 known failure modes

There seem to be 3 failure modes that are relevant for this issue:

  • The browser failing to get a circuit relay reservation on the dedicated app bootstrapper (peer id bafzaajaiaejcav3fwj35j27gor72ap5aqhiz44qmje4gcxvo5wogjmczwhk4xp7p).
  • The browser failing to resolve the multiaddrs for the bootstrapper bafzaajaiaejcav3fwj35j27gor72ap5aqhiz44qmje4gcxvo5wogjmczwhk4xp7p, because of the delegated
  • Failure to connect to the bootstrapper, even before a circuit reservation. In this case, you would still see a circuit relay error in the UI: NoValidAddressesError: Transport (@libp2p/circuit-relay-v2-transport) could not listen on any available address

Other things to investigate (out of scope for this issue)

  • It seems that we sometimes get more than one webrtc-direct multiaddr with different certhashes, when only one is valid
  • We attempt to create a reservation on all of the returned multiaddrs for a given peer. This might result in more than one reservation per peer (not sure but needs to be checked)

Next steps

  • Given all of this, it would probably be best to join the Amino DHT and find a random relay.
  • We will still need to connect to the app bootstrapper (go-peer) for peer discovery pubsub events. But this should put less stress and reduce the chances of resource exhaustion on the app bootstrapper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants