coturn / coturn

coturn TURN server project
Other
11.14k stars 2k forks source link

Cannot bind TLS/TCP listener socket to addr | Coturn is not starting #1178

Open Govind10g opened 1 year ago

Govind10g commented 1 year ago

Hi All,

In my config file - I'm using my ec2 instance public IP as a listening-ip=MyEc2PublicIP and listening-port=3478.

While starting coturn, I m getting below error.

0: : Cannot bind DTLS/UDP listener socket to addr MyEc2PublicIP:3478 0: : Trying to bind DTLS/UDP listener socket to addr MyEc2PublicIP:3478, again... 0: : Trying to bind fd 18 to MyEc2PublicIP:3478: errno=99 0: : Cannot bind TLS/TCP listener socket to addr MyEc2PublicIP:3478 0: : Trying to bind TLS/TCP listener socket to addr MyEc2PublicIP:3478, again... 0: : Trying to bind fd 17 to MyEc2PublicIP:3478: errno=99 0: : Cannot bind TLS/TCP listener socket to addr MyEc2PublicIP>3478 0: : Trying to bind TLS/TCP listener socket to addr MyEc2PublicIP:34798 again... 0: : Trying to bind fd 16 to MyEc2PublicIP:3478: errno=99 0: : Cannot bind DTLS/UDP listener socket to addr MyEc2PublicIP:3478

@eakraly @misi - Any idea on this type of error.

Govind10g commented 1 year ago

Hi @eakraly,

Any input on this would be really helpful.

Govind10g commented 1 year ago

Syslog below :-

Mar 29 11:01:09 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind fd 18 to : errno=99 Mar 29 11:01:09 ip-10-78-48-97 turnserver[72953]: 0: : Cannot bind TLS/TCP listener socket to addr MyEc2PublicIp:3478 Mar 29 11:01:09 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind TLS/TCP listener socket to addr MyEc2PublicIp:3478, again... Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind fd 16 to : errno=99 Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Cannot bind DTLS/UDP listener socket to addr MyEc2PublicIp:3478 Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind DTLS/UDP listener socket to addr MyEc2PublicIp:3478, again... Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind fd 17 to : errno=99 Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Cannot bind TLS/TCP listener socket to addr MyEc2PublicIp:3478 Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind TLS/TCP listener socket to addr MyEc2PublicIp:3478, again... Mar 29 11:01:10 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind fd 18 to : errno=99

Note - I replaced public ip with name MyEc2PublicIp

Govind10g commented 1 year ago

Okay So I further dig into this issue and found that in my ip addr command output no public Ip are showing or you can say visible to application.

So in that case, Can we comment "listening-ip" in configuration file to use local ip address of ec2 instance ? Is that config fine for production ready turn server ?

eakraly commented 1 year ago

Hi @Govind10g ! I think you already answered yourself - error 99 in bind is EADDRNOTAVAIL. Which means MyEc2PublicIp is not actually available on any of the interfaces

Govind10g commented 1 year ago

Can we comment "listening-ip" in configuration file to use local ip address of ec2 instance ? Is that config fine for production ready turn server ?

eakraly commented 1 year ago

@Govind10g

Can we comment "listening-ip" in configuration file to use local ip address of ec2 instance ? You can. But I would do it as a debug step.

Is that config fine for production ready turn server ? I do not know. My suggestion is to review address ranges and block all internal IP ranges to prevent routing INTO your private network

Govind10g commented 1 year ago

Hi @eakraly ,

The problem here is I m running coturn in EC2 instance which has public IP address associated with it but not showing in ifconfig. Hence when I m using it in coturn application getting above error :-

Mar 29 11:01:09 ip-10-78-48-97 turnserver[72953]: 0: : Trying to bind fd 18 to MyEc2PublicIp:3478: errno=99 Mar 29 11:01:09 ip-10-78-48-97 turnserver[72953]: 0: : Cannot bind TLS/TCP listener socket to addr MyEc2PublicIp:3478

So In that case, I can't use public IP in coturn application hence I commented it as below :-

Listener IP address of relay server. Multiple listeners can be specified.

If no IP(s) specified in the config file or in the command line options,

then all IPv4 and IPv6 system IPs will be used for listening.

listening-ip=

Is that fine ?

Govind10g commented 1 year ago

I saw one suggestion mentioned by you in another thread - mentioned below

If I run coturn without argument I can see the below log ( listening-ip= ) :- It is showing 0.0.0.0, Is that means we need to provide 0.0.0.0 in listening-ip ?

0: : IPv4. DTLS/UDP listener opened on: 0.0.0.0:3478
0: : IPv4. DTLS/UDP listener opened on: 0.0.0.0:443
0: : Total General servers: 2
0: : SQLite DB connection success: /var/lib/coturn/turndb
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (auth thread): epoll (with changelist)
0: : IO method (admin thread): epoll (with changelist)
0: : IPv4. TLS/TCP listener opened on : 0.0.0.0:3478
0: : IPv4. TLS/TCP listener opened on : 0.0.0.0:3478
0: : IPv4. TLS/TCP listener opened on : 0.0.0.0:443
0: : IPv4. TLS/TCP listener opened on : 0.0.0.0:443
eakraly commented 1 year ago

It is showing 0.0.0.0, Is that means we need to provide 0.0.0.0 in listening-ip ?

0.0.0.0 is not an IP address you can use - I suppose something is not well with the EC2 setup you are trying to use?

vipcxj commented 1 year ago

same issue, any news?

18910949204 commented 9 months ago

same problem

AlanBy commented 5 months ago

try to use your private ip on listening-ip