Open Bug 1672145 Opened 5 years ago Updated 1 year ago

Internal Error when gathering ICE candidates on localhost using Geckodriver

Categories

(Core :: WebRTC: Networking, defect, P3)

Firefox 81
defect

Tracking

()

UNCONFIRMED

People

(Reporter: daginge, Unassigned)

Details

Attachments

(3 files)

Attached file firefoxbug.zip

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36

Steps to reproduce:

I tried to create an end-to-end test for our WebRTC application, and discovered that if I enable the option media.navigator.streams.fake as well as host my application on localhost, ICE gathering fails with an Internal Error.

I have a reproducible case using the WebRTC samples for a basic loopback peer to peer connection, which is expected to work. See attached. It also contains instructions in the README for how to reproduce. I will copy here for simplicity:

  1. Open a terminal and run npm ci, this ensures you get the exact versions in the package-lock.json file
  2. Run npm start
  3. Observe that an instance of Firefox is opened, and the page navigates to localhost:8000. The source of the code is in ./app
  4. Click the "Start" button, observe a fake stream being added and shown in the local video frame
  5. Click "Call". Observe that no connection is made
  6. Navigate to about:webrtc and check out the connection logs. See that there is an Internal error in the UDPSocketParent. (See expected results)

I have also tried enabling media.peerconnection.ice.loopback after talking to fippo to no avail.

Actual results:

The call did not succeed. about:webrtc reports:

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:

UDP socket error:Internal error at /builds/worker/checkouts/gecko/dom/network/UDPSocketParent.cpp:248 this=0x111f39800

ICE(PC:1603192415299233 (id=4294967299 url=http://localhost:8000/)): failed to find default addresses

getifaddrs error e = 1

UDP socket error:Internal error at /builds/worker/checkouts/gecko/dom/network/UDPSocketParent.cpp:248 this=0x111f39800

ICE(PC:1603192415301092 (id=4294967299 url=http://localhost:8000/)): failed to find default addresses

getifaddrs error e = 1

ICE(PC:1603192415301092 (id=4294967299 url=http://localhost:8000/)): peer (PC:1603192415301092 (id=4294967299 url=http://localhost:8000/):default) has no stream matching stream PC:1603192415301092 (id=4294967299 url=http://localhost:8000/) transport-id=transport_0 - b250cb26:ca4ec7b0f566a2aaf4b1e062f03b0458

ICE(PC:1603192415299233 (id=4294967299 url=http://localhost:8000/)): peer (PC:1603192415299233 (id=4294967299 url=http://localhost:8000/):default) has no stream matching stream PC:1603192415299233 (id=4294967299 url=http://localhost:8000/) transport-id=transport_0 - 3c9d1753:e62bb42ab019ad3fdb785f8569330855

ICE(PC:1603192415299233 (id=4294967299 url=http://localhost:8000/)): peer (PC:1603192415299233 (id=4294967299 url=http://localhost:8000/):default) has no stream matching stream PC:1603192415299233 (id=4294967299 url=http://localhost:8000/) transport-id=transport_1 - 3c9d1753:e62bb42ab019ad3fdb785f8569330855
+++++++ END ++++++++

Expected results:

The call should succeed

drno/bwc: I suspected this is caused by the "return just a candidate for the default route discovered from where the page is fetched" behaviour. And the default route can't be discovered when fetching the page from loopback.

Flags: needinfo?(drno)

So there's an EPERM error, on a getifaddrs call, which should not be affected by the particulars of your scenario:

https://searchfox.org/mozilla-central/rev/61728de8273c04fe2417c475fc0637e8b79210d7/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-bsd.c#70

I am not sure why this would happen; can you check to see if that logging (getifaddrs error e = 1) also shows up on a webrtc connection that does work?

Secondly, the line numbers for the failure in UDPSocketParent don't line up with nightly; can you reproduce this failure on Nightly please, and attach about:webrtc?

Flags: needinfo?(daginge)

Slightly different error in 84.0a1 (2020-10-22):

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:
PR_Connect failed: -5927
ICE(PC:1603372151108415 (id=2147483649 url=http://localhost:8000/)): failed to find default addresses
PR_Connect failed: -5927
ICE(PC:1603372151108415 (id=2147483649 url=http://localhost:8000/)): failed to find default addresses
PR_Connect failed: -5927
ICE(PC:1603372151113079 (id=2147483649 url=http://localhost:8000/)): failed to find default addresses
PR_Connect failed: -5927
ICE(PC:1603372151113079 (id=2147483649 url=http://localhost:8000/)): failed to find default addresses
ICE(PC:1603372151113079 (id=2147483649 url=http://localhost:8000/)): peer (PC:1603372151113079 (id=2147483649 url=http://localhost:8000/):default) has no stream matching stream PC:1603372151113079 (id=2147483649 url=http://localhost:8000/) transport-id=transport_0 - 888d6bd8:da892e93bb7947d7ac5e7dcb9ee96d4e
ICE(PC:1603372151108415 (id=2147483649 url=http://localhost:8000/)): peer (PC:1603372151108415 (id=2147483649 url=http://localhost:8000/):default) has no stream matching stream PC:1603372151108415 (id=2147483649 url=http://localhost:8000/) transport-id=transport_0 - 93f905e8:6331508fc790d2ee2dcc02088bf00cb6
ICE(PC:1603372151108415 (id=2147483649 url=http://localhost:8000/)): peer (PC:1603372151108415 (id=2147483649 url=http://localhost:8000/):default) has no stream matching stream PC:1603372151108415 (id=2147483649 url=http://localhost:8000/) transport-id=transport_1 - 93f905e8:6331508fc790d2ee2dcc02088bf00cb6
+++++++ END ++++++++
Flags: needinfo?(daginge)
Here's

(Sorry for the spam, I don't like that the line attachement thingy, autosubmits...)

Anyway, added two working logs now for the same example. It only breaks if localhost and fake stream basically.

Not a super high priority because this is localhost only.

Severity: -- → S3
Priority: -- → P3
PR_Connect failed: -5927

So this is PR_HOST_UNREACHABLE_ERROR. Given that you are using a fake stream, I'm guessing that you have not requested capture permissions in your scenario. You also only see the failure when connecting to the page via loopback. In this combination of circumstances, we attempt to determine the interface to be used by looking up 8.8.8.8 in the routing table (or, 2001:4860:4860::8888 if loading from IPv6), by using the so-called "connected UDP trick". For some reason, this routing table lookup is failing.

I have used the media.navigator.permission.disabled flag to disable the permission prompt. However, having that on or off doesn't change things. Understand that it's not high priority, tests run for us on CI, so this is just because some of our devs prefer using Firefox, I guess we can develop the e2e tests locally with Chrome for now until this is resolved.

Yeah, that pref isn't going to help you. Have you tried setting media.peerconnection.ice.loopback to true?

(In reply to Byron Campen [:bwc] from comment #10)

Yeah, that pref isn't going to help you. Have you tried setting media.peerconnection.ice.loopback to true?

I'm not the original report, but I'm encountering the same issue as well (FF 82.0.2).
Toggling media.peerconnection.ice.loopback seems to have no impact.

(generic/ERR) UDP socket error:Internal error at /builds/worker/checkouts/gecko/dom/network/UDPSocketParent.cpp:247 this=00000215581C4800

(ice/ERR) ICE(PC:1604751062828000 (id=6442450955 url=http://localhost:8081/?disableGlobalContextMenu=1&loader-abort=1&connect_default=1&connect_): failed to find default addresses

(generic/ERR) UDP socket error:Internal error at /builds/worker/checkouts/gecko/dom/network/UDPSocketParent.cpp:247 this=00000215581C6C00

(ice/ERR) ICE(PC:1604751062828000 (id=6442450955 url=http://localhost:8081/?disableGlobalContextMenu=1&loader-abort=1&connect_default=1&connect_): failed to find default addresses

(ice/WARNING) ICE(PC:1604751062828000 (id=6442450955 url=http://localhost:8081/?disableGlobalContextMenu=1&loader-abort=1&connect_default=1&connect_): peer (PC:1604751062828000 (id=6442450955 url=http://localhost:8081/?disableGlobalContextMenu=1&loader-abort=1&connect_default=1&connect_:default) has no stream matching stream PC:1604751062828000 (id=6442450955 url=http://localhost:8081/?disableGlobalContextMenu=1&loader-abort=1&connect_default=1&connect_ transport-id=transport_0 - d8875ee9:79e94465ced9b7e5e7b22dd25638e793

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → WebRTC: Networking
Product: Firefox → Core

The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.

Priority: P3 → --
Flags: needinfo?(drno)
Priority: -- → P3

Confirming on Firefox 129.0; setting media.peerconnection.ice.loopback doesn't help, either.

This would be hugely helpful for web development work.

(In reply to James E. A. (any) [:codegeek98] from comment #14)

Confirming on Firefox 129.0; setting media.peerconnection.ice.loopback doesn't help, either.

This would be hugely helpful for web development work.

On Firefox 126.0.1, setting media.peerconnection.ice.loopback to true worked.
What happened to this opt.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: