acidhue
(Olly)
August 16, 2022, 5:46pm
1
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?
ibc
(Iñaki Baz Castillo)
August 16, 2022, 5:48pm
2
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.
acidhue
(Olly)
August 16, 2022, 5:54pm
3
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?
ibc
(Iñaki Baz Castillo)
August 16, 2022, 6:33pm
4
Please read the documentation in the website.
acidhue
(Olly)
August 16, 2022, 6:37pm
5
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();