js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

WebRTC: E2E test does not work on Firefox

Open marcus-pousette opened this issue 2 years ago • 4 comments

  • Version:

0.46.9

  • Platform:

MacBook-Pro-3.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 20:59:28 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6000 arm64

  • Subsystem:

WebRTC

Severity:

Medium

Description:

I am running a simple WebRTC E2E test with Playwright

The test does the following

  1. Create two browser contexts (A,B) with one protocol handler that allows you to send data from one to the other.

  2. Start a relay.

  3. Connect A to relay to obtain reservation for WebRTC address

  4. Connect B to A using the circuit relay address.

  5. Shutdown relay and make sure data still can be sent between the browser sessions

Test works on Chrome and Safari, but fails on Firefox.

I have also tested all the steps in a real browser sessions and the results are identical. Below is the log from running the E2E test by opening the browser sessions manually and reading the logs:


WebRTC: ICE failed, add a STUN server and see about:webrtc for more details
Uncaught (in promise) Error: RTCPeerConnection was closed
    <anonymous> util.ts:54
[util.ts:54:23](http://localhost:5211/node_modules/@libp2p/webrtc/src/private-to-private/util.ts)
Error: RTCPeerConnection was closed
    <anonymous> util.ts:54
[App.tsx:88:12](http://localhost:5211/src/App.tsx)
Error: RTCPeerConnection was closed
    <anonymous> util.ts:54
[App.tsx:88:12](http://localhost:5211/src/App.tsx)
FINALLY 2 [App.tsx:91:12](http://localhost:5211/src/App.tsx)
Uncaught (in promise) CodeError: Timed out while trying to connect
    CodeError errors.ts:29
    onabort handler.ts:32
[errors.ts:29:4](http://localhost:5211/node_modules/@libp2p/interface/src/errors.ts)
    onabort handler.ts:32
---------- about:webrtc ----------------
    +++++++ BEGIN (process id 4863) ++++++++

insert 'ice' (registry) succeeded: ice

insert 'ice.pref' (registry) succeeded: ice.pref

insert 'ice.pref.type' (registry) succeeded: ice.pref.type

insert 'ice.pref.type.srv_rflx' (UCHAR) succeeded: 0x64

insert 'ice.pref.type.peer_rflx' (UCHAR) succeeded: 0x6e

insert 'ice.pref.type.host' (UCHAR) succeeded: 0x7e

insert 'ice.pref.type.relayed' (UCHAR) succeeded: 0x05

insert 'ice.pref.type.srv_rflx_tcp' (UCHAR) succeeded: 0x63

insert 'ice.pref.type.peer_rflx_tcp' (UCHAR) succeeded: 0x6d

insert 'ice.pref.type.host_tcp' (UCHAR) succeeded: 0x7d

insert 'ice.pref.type.relayed_tcp' (UCHAR) succeeded: 0x00

insert 'stun' (registry) succeeded: stun

insert 'stun.client' (registry) succeeded: stun.client

insert 'stun.client.maximum_transmits' (UINT4) succeeded: 7

insert 'ice.trickle_grace_period' (UINT4) succeeded: 5000

insert 'ice.tcp' (registry) succeeded: ice.tcp

insert 'ice.tcp.so_sock_count' (INT4) succeeded: 0

insert 'ice.tcp.listen_backlog' (INT4) succeeded: 10

insert 'ice.tcp.disable' (char) succeeded: \000

insert 'ice.forced_interface_name' (string) succeeded:

insert 'ice.udp' (registry) succeeded: ice.udp

insert 'ice.udp.use_nr_resolver' (char) succeeded: \001

PR_Connect failed: -5927

ICE(PC:{4d0ab538-4cbd-4c35-9c70-ca51462f1db2} 1694542998315079 (id=8589934593 url=http://localhost:5211/?relay=/ip4/127.0.0.1/tcp/8002/ws/p2p/12D3KooWPh7DwBH2xELDuyCZxExaXhaBexhskBPYUJCKvjb9fkwq/p2p-circuit/webrtc/p2p/12D3KooWLtdq1gcveQp3si7y88UEcwgEdaKxh4pXRjRV): failed to find default addresses

PR_Connect failed: -5927

ICE(PC:{4d0ab538-4cbd-4c35-9c70-ca51462f1db2} 1694542998315079 (id=8589934593 url=http://localhost:5211/?relay=/ip4/127.0.0.1/tcp/8002/ws/p2p/12D3KooWPh7DwBH2xELDuyCZxExaXhaBexhskBPYUJCKvjb9fkwq/p2p-circuit/webrtc/p2p/12D3KooWLtdq1gcveQp3si7y88UEcwgEdaKxh4pXRjRV): failed to find default addresses

PR_Connect failed: -5927

ICE(PC:{201e486a-a4b5-4a5f-8fdb-230c96f2e3d9} 1694542998305108 (id=6442450946 url=http://localhost:5211/?relay=/ip4/127.0.0.1/tcp/8002/ws/p2p/12D3KooWPh7DwBH2xELDuyCZxExaXhaBexhskBPYUJCKvjb9fkwq)): failed to find default addresses

PR_Connect failed: -5927

ICE(PC:{201e486a-a4b5-4a5f-8fdb-230c96f2e3d9} 1694542998305108 (id=6442450946 url=http://localhost:5211/?relay=/ip4/127.0.0.1/tcp/8002/ws/p2p/12D3KooWPh7DwBH2xELDuyCZxExaXhaBexhskBPYUJCKvjb9fkwq)): failed to find default addresses

+++++++ END (process id 4863) ++++++++
    
  

marcus-pousette avatar Sep 12 '23 18:09 marcus-pousette

Main issue from the logs is

failed to find default addresses

marcus-pousette avatar Sep 12 '23 18:09 marcus-pousette

We are currently undergoing a big refactor of webRTC https://github.com/libp2p/js-libp2p/pull/2073 we will revisit once that is merged.

maschad avatar Oct 02 '23 23:10 maschad

@marcus-pousette is this still an issue?

maschad avatar May 14 '24 02:05 maschad

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

github-actions[bot] avatar May 21 '24 00:05 github-actions[bot]

This issue was closed because it is missing author input.

github-actions[bot] avatar May 28 '24 00:05 github-actions[bot]