Error: uv_udp_bind() failed [transport:udp, ip:'35.190.192.36', port:50000]: address not available [method:worker.createWebRtcServer]

Deploying a MediaSoup server via Docker on Google Cloud Compute engine the uv_udp_bind always fails.

The firewall is set to open all ports and IP address ranges.

Tried both Debian and Ubuntu container optimized boot images.

Running with command
docker run -it -e “GCP_PROJECT=bap-prod-352014” -e “GOOGLE_CLOUD_PROJECT=bap-prod-352014” -e “MEDIA_SERVER=true” --net host -t Google Cloud console

Running locally seems to be fine.

Any ideas?

The documentation is clear about this. Use an IP in which the computer can bind rather than the external one. The FAQ also explains this.

Thanks IBC. I’m fairly new to binding IPs and what they are. The media-soup config has no documentation in TypeScript, it just says “ip” under “listenInfos” which I assumed was public external IP addresses.

So I’m to use the internal one, or something like 127.0.0.1?

:slight_smile:

Please read the documentation in the website.

For anyone who is stuck, as the documentation doesn’t really help for GCloud deployments

You can do the following in node

const gcpMetadata = require("gcp-metadata");
const ipLocal = require("ip");

// For "announced ip" fields in config
process.env.SERVER_PUBLIC_IP = await gcpMetadata.instance("network-interfaces/0/access-configs/0/external-ip");

// For normal "ip" fields in config
process.env.SERVER_INTERNAL_IP = ipLocal.address();