ICE failed on DigitalOcean servers

462 views
Skip to first unread message

Sayan Bhattacharya

unread,
Apr 6, 2021, 6:00:31 AM4/6/21
to meetecho-janus
We are always getting 'ICE failed' from the 'hangup' event on the client side and on the server we are getting an error ' ICE failed for component 1 in stream'. Everything is working locally but not on the server.

We are using canyanio/janus-gateway-docker Janus docker image and running it on DigitalOcean with Nginx proxy.

nginx.conf -
location /rtc {
}

And with janus.jcfg - https://pastebin.com/jTp6iZi8

We have tried the various solutions like setting the nat_1_1 to our server's public IP and setting up STUN servers correctly on the client end as well as the server end but still getting the same error.

We have tried to use the Admin API also to get some insight and there also the ICE state fails after sometime and streams and SDP sections become empty. Any ideas what we are doing wrong?

Mirko Brankovic

unread,
Apr 6, 2021, 6:31:45 AM4/6/21
to meetecho-janus
You have to make sure you are docker natting the udp port range that is set in janus.jcfg:media section and that those ports are open on DigitalOcean firewall, open to piblic

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/0f5c72fc-6204-4fc8-b1db-ed869457feb7n%40googlegroups.com.

Sayan Bhattacharya

unread,
Apr 6, 2021, 7:56:50 AM4/6/21
to meetecho-janus
Hi, thanks for the quick reply but that doesn't seem to work either I have allowed port 20000-40000/udp, the mentioned RTP ports in the janus.jcfg:media . By the way, we are not using RTP in our project, we are just using the video room plugin but the video is not being published properly due to ICE failure. Any other suggestions?

Mirko Brankovic

unread,
Apr 7, 2021, 3:25:07 AM4/7/21
to meetecho-janus
Well, Videoroom is a relay of A/V streams and stream is a continuous flow of RTP packets most of the time over UDP protocol, so you must be using RTP :)

Make sure you expose those ports from you docker file, like:
EXPOSE 20000-40000/udp



--
Regards,
Mirko

Sayan Bhattacharya

unread,
Apr 7, 2021, 3:48:39 AM4/7/21
to meetecho-janus
Thanks, Mirko. 
I get it now, why the RTP ports are important.

Actually yesterday we were able to make it work when we ran the docker container with "network_mode: host" and as I mentioned earlier I had already opened the firewall ports.

Just curious if we didn't use "network_mode: host", EXPOSE the docker ports, and allowed the ports in the firewall also, do we have to put the IP of our docker host in the nat_1_1_mapping of the janus.jcfg to make it work?

We were just curious about it, again thanks for the help.

Lorenzo Miniero

unread,
Apr 7, 2021, 3:52:49 AM4/7/21
to meetecho-janus
If you're using docker, you may want to watch this talk by Alessandro: http://januscon.it/2019/talk.php?t=docker

L.

Mirko Brankovic

unread,
Apr 7, 2021, 4:31:27 AM4/7/21
to meetecho-janus
webrtc uses RTP protocol for delivering media packets, so it is quite important.
nat_1_1 setting is for sure important since that is how janus will construct ICE candidates (potential RTP endpoints), and deliver it to clients (so they won't be 127.0.0.1:30000, but your_public_ip:30000, cause only that is reachable for clients).

I don't know about this Host mode of docker, I guess it is just different iptables FORWARD chain rules :D



--
Regards,
Mirko
Reply all
Reply to author
Forward
0 new messages