I’ve been spending a while trying to sort this problem out.
I’m running a mediasoup server in a Google Compute Engine Instance, in a Docker container using the Container Optimized OS
I can get the solution running fine locally, but when trying to open a webrtc connection between two browser sessions, in Firefox, I get an error:
WebRTC: ICE failed, add a STUN server and see about:webrtc for more details
In Chrome, in chrome://webrtc_internals, I see the following log events:
**transceiverModified**
Caused by: setLocalDescription
getTransceivers()[0]:{
mid:'0',
sender:{
track:null,
streams:[],
},
receiver:{
track:'09a93399-d488-4581-9633-bc1a8ff10c2a',
streams:[],
},
stopped:false,
direction:'recvonly',
currentDirection:'inactive',
}
**signalingstatechange**
stable
**setLocalDescriptionOnSuccess**
**iceconnectionstatechange**
disconnected
**iceconnectionstatechange (legacy)**
failed
connectionstatechange
failed
**close**
**connectionstatechange**
closed
The way I have things set up is:
- I bind a static external IP address to that compute engine instance’s network interface.
- For mediasoup, the
announceIp
is the static external ip address, and theip
is thePrimary Internal Ip
of the network interface. - I know this is very insecure, but to see if it is an issue if ports are being blocked, for the firewall, I open all ingress and egress ports for that instance. In particular, I create an
Ingress
rule which allows all tcp and udp ports, for ip ranges0.0.0.0/0
. I create anEgress
rule which allows all tcp and udp ports, for ip ranges0.0.0.0/0
. Once I have this problem figured out I’ll make more strict firewall rules. - Not sure if this matters (don’t think it does), but https websockettraffic, and correspondingly the incoming protoo websocket connection goes through an https load balancer, and different ip address before hitting the instance.
How would I go about debugging why the Ice connection fails? Has anyone else had success getting a mediasoup worker instance to work in a compute engine container and has tips to share?