When createWebRtcTransport, output invalid IP error


When createWebRtcTransport, output the following error

backend_1 | 2021-11-20T13:19:27.392Z mediasoup:Router createWebRtcTransport()
backend_1 | 2021-11-20T13:19:27.393Z mediasoup:Channel request() [method:router.createWebRtcTransport, id:2]
backend_1 | 2021-11-20T13:19:27.400Z mediasoup:ERROR:Channel [pid:29 Utils::IP::NormalizeIp() | throwing MediaSoupTypeError: invalid IP ‘“”’
backend_1 | 2021-11-20T13:19:27.414Z mediasoup:ERROR:Channel [pid:29 Worker::OnChannelRequest() | throwing MediaSoupTypeError: invalid IP ‘“”’ [method:router.createWebRtcTransport]
backend_1 | 2021-11-20T13:19:27.414Z mediasoup:WARN:Channel request failed [method:router.createWebRtcTransport, id:2]: [method:router.createWebRtcTransport]
backend_1 | TypeError: [method:router.createWebRtcTransport]
backend_1 | at Channel.processMessage (/app/node_modules/mediasoup/node/lib/Channel.js:192:37)
backend_1 | at Socket. (/app/node_modules/mediasoup/node/lib/Channel.js:69:34)
backend_1 | at Socket.emit (events.js:400:28)
backend_1 | at addChunk (internal/streams/readable.js:293:12)
backend_1 | at readableAddChunk (internal/streams/readable.js:267:9)
backend_1 | at Socket.Readable.push (internal/streams/readable.js:206:10)
backend_1 | at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

Mediasoup is running on aws ec2 using docker(network mode is host).
I tried following iistenIps, but not working.

ip: “”,
announcedIp: “[ec2 public ip]”,

ip: “”,
announcedIp: “[ec2 public ip]”,

Is there something wrong with the setting?

Did you set IP in quotes inside of the other quotes?

No, I set IP like “”. I didn’t use a single quotation.

It looks like the worker receives the address as a string with quotes, either curled or simple. I.e. the quotes are duplicated somewhere.

See the error log. You are indeed passing a quoted string.

Sorry, I was wrong.

I had set ip and announcedIp in environment variables, but I had set them as follows.

ip: process.env.MEDIASOUP_LISTEN_IP,
announcedIp: process.env.MEDIASOUP_ANNOUNCED_IP

MEDIASOUP_LISTEN_IP=“[ec2 public ip]”

It means I set IP in quotes inside of the other quotes. I resolve by removing quote of environment variables. Thank you very much for reminding me.