Firefox: ICE failed, add a STUN server and see about:webrtc for more details

that question but with logs! :slight_smile: Here’s my logs and stuff:

/builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): failed to create passive TCP host candidate: 3

/builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): failed to create passive TCP host candidate: 3

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) has no stream matching stream PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) no streams with non-empty check lists

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) no streams with pre-answer requests

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) no checks to start

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:61489/UDP)

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:54069/TCP) active

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:58835/UDP)

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:60103/TCP) active

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): All candidates initialized

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356)): peer (PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default) Trickle grace period is over; marking every component with only failed pairs as failed.

ICE-PEER(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default)/STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/COMP(1): All pairs are failed, and grace period has elapsed. Marking component as failed.

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60): state dump

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60): Local component 1 - dumping candidates

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/CAND(0FZ1): host(IP4:192.168.1.197:61489/UDP)

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/CAND(2ZWa): host(IP4:192.168.1.197:54069/TCP) active

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60): Local component 2 - dumping candidates

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/CAND(KVk2): host(IP4:192.168.1.197:58835/UDP)

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/CAND(xIvw): host(IP4:192.168.1.197:60103/TCP) active

ICE-PEER(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default)/STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60): state dump

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60): Remote component 1 in state 3 - dumping candidates

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/CAND(eCBy): candidate:udpcandidate 1 udp 1076558079 127.0.0.1 46086 typ host

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60)/CAND(1nJ4): candidate:tcpcandidate 1 tcp 1076302079 127.0.0.1 48396 typ host tcptype passive

ICE(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356))/ICE-STREAM(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356) transport-id=transport_0 - 0b67225e:912153499397fd7e69b065e2432aee60): Remote component 2 in state 0 - dumping candidates

ICE-PEER(PC:1586986833320905 (id=38654705668 url=http://localhost:3000/join/126224356):default): all checks completed success=0 fail=1

+++++++ END ++++++++
1 Like

If ICE does not connect it may be due to network problems, lack of UDP or wrongly configured server, etc. If it works in Chrome (does it?) it may be because Chrome supports ICE over TCP and Firefox doesn’t).

But well, you did not provide that info.

Seems to work in chrome (or at least I don’t get an error).

I have UDP and TCP enabled. I even tried disabling TCP and only using UDP.

It’s running on localhost so there shouldn’t be any network issues.

I can provide any logs or more information needed including server config. What do you need?

Does “localhost” mean that mediasoup v3 is listening in 127.0.0.1 UDP?

Yes. 192.168.1.197 is the internal IP of the computer I am working on. So 192.168.1.197 and 127.0.0.1 (localhost) both point to the same machine,

Yes, it seems so according to the logs. No, browsers do not connect ICE to 127.0.0.1 UDP, but Chrome connects to 127.0.0.1 TCP, and there is TCP in your logs, so Chrome works.

Don’t make mediasoup listen in 127.0.0.1.

1 Like

I am confused, why can’t I use 127.0.0.1 for ICE? If not, what should I set it to? My internal address, 192.168.1.197?

I changed to 192.168.1.197 (my internal address) for the following setting and it worked.

webRtcTransportOptions:
                {
                    listenIps:
                        [
                            {
                                ip: process.env.MEDIASOUP_LISTEN_IP || '192.168.1.197',
                                announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP
                            }
                        ],

(In production I will set with environment variable).

Thanks!

Is there a reason that Firefox doens’t allow ice as 127.0.0.1?

1 Like

For future readers here’s the log of the successful connection:

/builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): failed to create passive TCP host candidate: 3

/builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): failed to create passive TCP host candidate: 3

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) has no stream matching stream PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) no streams with non-empty check lists

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) no streams with pre-answer requests

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) no checks to start

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:56663/UDP)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/CAND-PAIR(vWZ/): setting pair to state FROZEN: vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464))/CAND-PAIR(vWZ/): Pairing candidate IP4:192.168.1.197:56663/UDP (7e7f00ff):IP4:192.168.1.197:47974/UDP (402af8ff) priority=4623781745794089471 (402af8fffcfe01ff)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/ICE-STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512): Starting check timer for stream.

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/CAND-PAIR(vWZ/): setting pair to state WAITING: vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/CAND-PAIR(vWZ/): setting pair to state IN_PROGRESS: vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) is now checking

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:63343/TCP) active

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/CAND-PAIR(WCfV): setting pair to state FROZEN: WCfV|IP4:192.168.1.197:63343/TCP|IP4:192.168.1.197:41004/TCP(host(IP4:192.168.1.197:63343/TCP) active|candidate:tcpcandidate 1 tcp 1076302079 192.168.1.197 41004 typ host tcptype passive)

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464))/CAND-PAIR(WCfV): Pairing candidate IP4:192.168.1.197:63343/TCP (7d7fc0ff):IP4:192.168.1.197:41004/TCP (402710ff) priority=4622682234132857343 (402710fffaff81ff)

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:55952/UDP)

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): peer (PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default) pairing local trickle ICE candidate host(IP4:192.168.1.197:60180/TCP) active

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464)): All candidates initialized

STUN-CLIENT(vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)): Received response; processing

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/CAND-PAIR(vWZ/): setting pair to state SUCCEEDED: vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512)/COMP(1)/CAND-PAIR(vWZ/): nominated pair is vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512)/COMP(1)/CAND-PAIR(vWZ/): cancelling all pairs but vWZ/|IP4:192.168.1.197:56663/UDP|IP4:192.168.1.197:47974/UDP(host(IP4:192.168.1.197:56663/UDP)|candidate:udpcandidate 1 udp 1076558079 192.168.1.197 47974 typ host)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512)/COMP(1)/CAND-PAIR(WCfV): cancelling FROZEN/WAITING pair WCfV|IP4:192.168.1.197:63343/TCP|IP4:192.168.1.197:41004/TCP(host(IP4:192.168.1.197:63343/TCP) active|candidate:tcpcandidate 1 tcp 1076302079 192.168.1.197 41004 typ host tcptype passive) because CAND-PAIR(vWZ/) was nominated.

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/CAND-PAIR(WCfV): setting pair to state CANCELLED: WCfV|IP4:192.168.1.197:63343/TCP|IP4:192.168.1.197:41004/TCP(host(IP4:192.168.1.197:63343/TCP) active|candidate:tcpcandidate 1 tcp 1076302079 192.168.1.197 41004 typ host tcptype passive)

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default)/ICE-STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512): all active components have nominated candidate pairs

ICE-PEER(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464):default): all checks completed success=1 fail=0

STUN-CLIENT(consent): Received response; processing

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464))/STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512)/COMP(1): Consent refreshed

STUN-CLIENT(consent): Received response; processing

ICE(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464))/STREAM(PC:1587002737327695 (id=32212254738 url=http://localhost:3000/join/614642464) transport-id=transport_0 - d27938ec:3977e90b8a77f24ea815742b37f06512)/COMP(1): Consent refreshed

+++++++ END ++++++++

Neither Chrome allows ICE connecting to 127.0.0.1 UDP (but allows TCP).

I cannot give support about Firefox internals/policies.

1 Like

It has actually nothing to do with UDP. The problem is entirely with the ICE candidates: Firefox simply does not offer any loopback addresses by default, this feature is hidden under the media.peerconnection.ice.loopback pref. Change it to true, and listenIps: { ip: 127.0.0.1, announcedIp: null } configuration will start working pretty well, even with UDP connection.
See this bug for details: https://bugzilla.mozilla.org/show_bug.cgi?id=1659672

3 Likes