Mediasoup library throws error while router.createWebRtcTransport

My example application that I cloned from GitHub - Dirvann/mediasoup-sfu-webrtc-video-rooms: A simple video conferencing example using the mediasoup works fine on my localhost. I tried to deploy it on the ubuntu 20.04 server and it throws the error below:
Error: [method:router.createWebRtcTransport]
at Channel._processMessage
The message in _processMessage is the following: {“error”:“Error”, “id”:2, “reason”:" [method:router.createWebRtcTransport]"}
This error occurs when I am trying to join the room.
I already changed announcedIp to public IP of my Instance and added firewall rules for 3016 (tcp and udp) and 10000:10100/udp
Please help

Isn’t there a more specific worker error? It should be.

No. I can see an error in browser console:

Join error: [method:router.createWebRtcTransport]

, this error is in RoomClient.js: 92:

async join(name, room_id) {
      .request('join', {
        async function (e) {
          console.log('Joined to room', e)
          const data = await this.socket.request('getRouterRtpCapabilities')
          let device = await this.loadDevice(data)
          this.device = device
          await this.initTransports(device)
      .catch((err) => {
        console.log('Join error:', err)

and error in the console:

Object that you can see is my log of init parameters

This is not a browse/client side issue but a server side issue due to wrong binding IPs. Please check logs in mediasoup server side. There is complete docs in the mediasoup website about how to enable them.

Yes, you are right, I found logs
It writes that no more available ports.
I killed the process that used ports 10000-10100, start application again and this error still exists
Should I increase number of ports?

Does the connection ever get made? That IP reveals only three ports 80,443,22 exposed and accepting requests. Not sure about client errors, but I’d throw one at you for that! :wink:

I have increased the port range and all works fine, thanks!