Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection using relay fails after successful connection #146

Open
jopicornell opened this issue Jul 6, 2020 · 9 comments
Open

Connection using relay fails after successful connection #146

jopicornell opened this issue Jul 6, 2020 · 9 comments

Comments

@jopicornell
Copy link

Your environment.

  • Version: turn v2.0.3 / stun v0.3.5
  • Browser: Chromium Version 83.0.4103.116
  • Other Information:
    Our logs show this on the browser:
signalStateChange:  have-remote-offer
instrument.js:110 signalStateChange:  stable
instrument.js:110 connectionStateChange:  connecting
instrument.js:110 connectionStateChange:  connected
instrument.js:110 connectionStateChange:  failed
instrument.js:110 negotiationNeeded 
--- Reconnecting ---
instrument.js:110 signalStateChange:  have-remote-offer
instrument.js:110 signalStateChange:  stable
instrument.js:110 connectionStateChange:  connecting
instrument.js:110 connectionStateChange:  connected

I log every message I receive. What seems to happen from the server is that when a refresh message, there's some kind of error allocating. This is what the server is logging on a TCP connection:

DEBU[0981] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): ChannelBind success response l=24 attrs=1 id=TFZoV3NHRkJIcXpU 
DEBU[0981] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): CreatePermission request l=96 attrs=5 id=TFZoV3NHRkJIcXpU 
DEBU[0981] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): ChannelBind success response l=24 attrs=1 id=dFFGdElHOUJLOW92 
DEBU[0981] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): CreatePermission request l=96 attrs=5 id=dFFGdElHOUJLOW92 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): Refresh success response l=32 attrs=2 id=WVduUXdVcXhtSVd4 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51433): Refresh request l=92 attrs=5 id=WVduUXdVcXhtSVd4 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): Refresh success response l=32 attrs=2 id=V0p0c2xBV0RDbEt1 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46488): Refresh request l=92 attrs=5 id=V0p0c2xBV0RDbEt1 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate error response l=56 attrs=3 id=TGYvMFZ5aFpsdDFN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate request l=8 attrs=1 id=TGYvMFZ5aFpsdDFN 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate success response l=56 attrs=4 id=bitUS044dk83cmxP 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Allocate request l=92 attrs=5 id=bitUS044dk83cmxP 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate error response l=56 attrs=3 id=Wmw3SUFGdXRnbk8r 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate request l=8 attrs=1 id=Wmw3SUFGdXRnbk8r 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate success response l=56 attrs=4 id=OWM0dnRJVzFxenEx 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Allocate request l=92 attrs=5 id=OWM0dnRJVzFxenEx 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=112 attrs=2 id=RHZxS2l5cjZ3TXVL 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=116 attrs=2 id=WVZ0NXZkY21Vemhm 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Data indication l=116 attrs=2 id=Ad91szQt5kuQgWF1 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=80 attrs=2 id=c2lRcEJlL1prRDVH 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=80 attrs=2 id=pEaoNTgebydwgljZ 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=112 attrs=2 id=VVZUQUlmWENzVm9X 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=112 attrs=2 id=vEoPdBlJqaDuErDM 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=116 attrs=2 id=Y0JlZnlDVHp5c1ZX 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Data indication l=116 attrs=2 id=IUhIvSplvCpwzsz6 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=80 attrs=2 id=ZUp1cTBMWlBwdDA1 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=80 attrs=2 id=MDoKjmrv9V4YRkhQ 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=80 attrs=2 id=bXY3SGd5dElaNFlL 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Data indication l=80 attrs=2 id=QVPp6Y1when1gXNqGTAE 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=RFZiaVg5OE5UVDU2 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind request l=104 attrs=6 id=RFZiaVg5OE5UVDU2 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): Send indication l=172 attrs=2 id=dWRxQnByditBSkxy 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Data indication l=172 attrs=2 id=S5d5IZOE1QOM2fdI 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=SkpZb3VkUGR6enpl 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): Send indication l=636 attrs=2 id=eXEzNGtrb2ZzQkhz 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0989] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0989] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0990] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0990] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0990] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0990] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0991] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0991] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0991] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0991] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0993] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0993] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0993] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[0993] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[0997] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[0997] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[0997] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[1005] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[1005] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[1005] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[1005] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 
DEBU[1013] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): ChannelBind success response l=24 attrs=1 id=OFk5cEh1akREVFJN 
DEBU[1013] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:46850): CreatePermission request l=96 attrs=5 id=OFk5cEh1akREVFJN 
DEBU[1013] Sending STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): ChannelBind success response l=24 attrs=1 id=cHFmK2R5YXBiM3NU 
DEBU[1013] Received STUN Message via TCP (192.168.1.128:3478->185.227.212.57:51690): CreatePermission request l=96 attrs=5 id=cHFmK2R5YXBiM3NU 

This is a log when UDP connection fails:

DEBU[0051] Inbound STUN(id=uVlsoYNtlIzL) from 185.227.212.57:51652: Binding request l=0 attrs=0 id=dVZsc29ZTnRsSXpM+ 
DEBU[0051] Outbound STUN (id=uVlsoYNtlIzL) from 185.227.212.57:51652: Binding success response l=20 attrs=2 id=dVZsc29ZTnRsSXpM+ 
DEBU[0051] Inbound STUN(id=FEw8d00PB3Ym) from 185.227.212.57:51652: Allocate request l=8 attrs=1 id=RkV3OGQwMFBCM1lt+ 
DEBU[0051] Outbound STUN (id=FEw8d00PB3Ym) from 185.227.212.57:51652: Allocate error response l=56 attrs=3 id=RkV3OGQwMFBCM1lt+ 
DEBU[0051] Inbound STUN(id=oeVFnXfekCrD) from 185.227.212.57:51652: Allocate request l=92 attrs=5 id=b2VWRm5YZmVrQ3JE+ 
DEBU[0051] Outbound STUN (id=oeVFnXfekCrD) from 185.227.212.57:51652: Allocate success response l=56 attrs=4 id=b2VWRm5YZmVrQ3JE+ 
DEBU[0051] Inbound STUN(id=EcjQgYhRDzJl) from 185.227.212.57:47649: Binding request l=0 attrs=0 id=RWNqUWdZaFJEekps+ 
DEBU[0051] Outbound STUN (id=EcjQgYhRDzJl) from 185.227.212.57:47649: Binding success response l=20 attrs=2 id=RWNqUWdZaFJEekps+ 
DEBU[0051] Inbound STUN(id=F04yH+qh6jG8) from 185.227.212.57:47649: Allocate request l=8 attrs=1 id=RjA0eUgrcWg2akc4+ 
DEBU[0051] Outbound STUN (id=F04yH+qh6jG8) from 185.227.212.57:47649: Allocate error response l=56 attrs=3 id=RjA0eUgrcWg2akc4+ 
DEBU[0051] Inbound STUN(id=XgS2Y51kO3n+) from 185.227.212.57:47649: Allocate request l=92 attrs=5 id=WGdTMlk1MWtPM24r+ 
DEBU[0051] Outbound STUN (id=XgS2Y51kO3n+) from 185.227.212.57:47649: Allocate success response l=56 attrs=4 id=WGdTMlk1MWtPM24r+ 
DEBU[0051] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0051] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0051] Inbound STUN(id=IPgYTone+b23) from 185.227.212.57:47649: Send indication l=112 attrs=2 id=SVBnWVRvbmUrYjIz+ 
DEBU[0051] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0051] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0051] Inbound STUN(id=ys97jfnaU+hf) from 185.227.212.57:51652: Send indication l=116 attrs=2 id=eXM5N2pmbmFVK2hm+ 
DEBU[0051] Outbound STUN (id=b�_M�6�h�) from 185.227.212.57:47649: Data indication l=116 attrs=2 id=YuJfD00Pkjb3aByb+ 
DEBU[0051] Inbound STUN(id=3tcTxRZqbjAW) from 185.227.212.57:47649: Send indication l=80 attrs=2 id=M3RjVHhSWnFiakFX+ 
DEBU[0051] Outbound STUN (id=���|���V}��) from 185.227.212.57:51652: Data indication l=80 attrs=2 id=t/aHfLOQ9FZ9vxGY+ 
DEBU[0051] Inbound STUN(id=zmhbdu1fcGJo) from 185.227.212.57:47649: Send indication l=112 attrs=2 id=em1oYmR1MWZjR0pv+ 
DEBU[0051] Outbound STUN (id=�+KcM�4�5D�) from 185.227.212.57:51652: Data indication l=112 attrs=2 id=jStLY02ZNI01RKQF+ 
DEBU[0051] Inbound STUN(id=v/V9D2Qoyk/I) from 185.227.212.57:51652: Send indication l=80 attrs=2 id=di9WOUQyUW95ay9J+ 
DEBU[0051] Outbound STUN (id=�ðMDv���!) from 185.227.212.57:47649: Data indication l=80 attrs=2 id=q8OwBU1Edo7N1xch+ 
DEBU[0051] Inbound STUN(id=WxJC9dUZLg5V) from 185.227.212.57:47649: ChannelBind request l=104 attrs=6 id=V3hKQzlkVVpMZzVW+ 
DEBU[0051] Outbound STUN (id=WxJC9dUZLg5V) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=V3hKQzlkVVpMZzVW+ 
DEBU[0051] Inbound STUN(id=EwWwMJDXi6yi) from 185.227.212.57:47649: Send indication l=172 attrs=2 id=RXdXd01KRFhpNnlp+ 
DEBU[0051] Outbound STUN (id=�+l�����4�yR) from 185.227.212.57:51652: Data indication l=172 attrs=2 id=5ytsh5nz/dI07XlS+ 
DEBU[0051] Inbound STUN(id=rMpdM29F0KSJ) from 185.227.212.57:51652: Send indication l=116 attrs=2 id=ck1wZE0yOUYwS1NK+ 
DEBU[0051] Outbound STUN (id=�`���l>��3) from 185.227.212.57:51652: Data indication l=80 attrs=2 id=GNhgf/71HGw+0sMz+ 
DEBU[0051] Inbound STUN(id=J/A22OfBKP6T) from 185.227.212.57:51652: ChannelBind request l=104 attrs=6 id=Si9BMjJPZkJLUDZU+ 
DEBU[0051] Outbound STUN (id=J/A22OfBKP6T) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=Si9BMjJPZkJLUDZU+ 
DEBU[0051] Inbound STUN(id=3x+lY40MEH6l) from 185.227.212.57:51652: Send indication l=636 attrs=2 id=M3grbFk0ME1FSDZs+ 
DEBU[0052] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0052] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0052] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0052] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0052] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0053] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0053] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0053] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0053] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0055] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0055] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0055] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0055] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0059] Inbound STUN(id=uRMYszEvmS1G) from 185.227.212.57:47649: CreatePermission request l=96 attrs=5 id=dVJNWXN6RXZtUzFH+ 
DEBU[0059] Outbound STUN (id=uRMYszEvmS1G) from 185.227.212.57:47649: ChannelBind success response l=24 attrs=1 id=dVJNWXN6RXZtUzFH+ 
DEBU[0059] Inbound STUN(id=P2u1e0HWv+r1) from 185.227.212.57:51652: CreatePermission request l=96 attrs=5 id=UDJ1MWUwSFd2K3Ix+ 
DEBU[0059] Outbound STUN (id=P2u1e0HWv+r1) from 185.227.212.57:51652: ChannelBind success response l=24 attrs=1 id=UDJ1MWUwSFd2K3Ix+ 

Additionally, I've done these other things to discard something with my connection or other unrelated issues:

  • I tested with iceTransportPolicy: 'all' and it works perfectly well
  • I tested on the same local network
  • I tested on different networks (All, the server and the two peers)
  • I tested deploying it to a GCE instance
  • The code is barely the simple example in Github, only adding TCP listeners
  • I tried another free turn (http://numb.viagenie.ca/) with iceTransportPolicy: 'relay' and it works perfectly well.

What did you do?

Simply grab the example, and run it:

	udpListener, err := net.ListenPacket("udp4", fmt.Sprintf("0.0.0.0:%d", 3478))
	if err != nil {
		log.Panicf("Failed to create TURN server listener: %s", err)
	}
	tcpListener, err := net.Listen("tcp4", fmt.Sprintf("0.0.0.0:%d", 3478))
	if err != nil {
		log.Panicf("Failed to create TURN server listener: %s", err)
	}
	s, err := turn.NewServer(turn.ServerConfig{
		Realm: "kydemy",
		// Set AuthHandler callback
		// This is called everytime a user tries to authenticate with the TURN server
		// Return the key for that user, or false when no user is found
		AuthHandler: func(username string, realm string, srcAddr net.Addr) ([]byte, bool) {
			return turn.GenerateAuthKey("test", "test", "test"), true
		},
		 PacketConnConfigs: []turn.PacketConnConfig{
			{
				PacketConn: &models.UdpPacketConn{PacketConn: udpListener},
				RelayAddressGenerator: &turn.RelayAddressGeneratorStatic{
					RelayAddress: net.ParseIP(TurnConfiguration.PublicIP),
					Address:      "0.0.0.0",
				},
			},
		},
		ListenerConfigs: []turn.ListenerConfig{
			{
				Listener: &models.TcpListener{Listener: tcpListener},
				RelayAddressGenerator: &turn.RelayAddressGeneratorStatic{
					RelayAddress: net.ParseIP(TurnConfiguration.PublicIP),
					Address:      "0.0.0.0",
				},
			},
		},
	})

Then you do a webRTC connection using this RTCPeerConfiguration:

const peerConnection = new RTCPeerConnection({ 
    IceServers: [{
          urls: 'turn:myturn.test:3478?transport=udp',
          username: 'kydemy',
          credential: 'kydemy'
    }],
    iceTransportPolicy: 'relay' 
})

What did you expect?

The connection to be stable using a relay transport policy.

What happened?

The connection keeps failing consistently, every 20/40 seconds. pion/turn doesn't log any error, but in the debug logs for each connection, it shows some allocating errors. The browser only shows the "failed" state, giving no extra information.

@barkhasikka
Copy link

I am facing the same issue. Any solution for this?

@maickonn
Copy link

maickonn commented Oct 2, 2020

Same issue here too.
I've tried on Windows and Linux.

@bshimc
Copy link

bshimc commented Oct 7, 2020

We're seeing the following

turn INFO: 2020/10/06 23:40:15 No Permission or Channel exists for 127.0.0.1:59188 on allocation 127.0.0.1:52020

@gmbad
Copy link

gmbad commented Oct 26, 2020

The same problem here...

Tks

@gmbad
Copy link

gmbad commented Oct 27, 2020

Sean, can you help us?

Thanks

@Sean-Der
Copy link
Member

Sean-Der commented Oct 29, 2020

Hey @jopicornell

Sorry for the delay, been dragged away by some other stuff. I am not able to reproduce this. Any idea what I am doing wrong?

  • I tried locally and on GCE
    • On the GCE instance I allowed all UDP and TCP ingress/egress
  • I have tested
    • TCP TURN <-> Server Reflexive
    • UDP TURN <-> Server Refexive
    • UDP TURN <-> UDP TURN
  • I am running 5702772
  • I run this for ~5 minutes and then assume it is a good run

I used this Javascript

      let configuration = {
        iceTransportPolicy: 'relay',
        iceServers: [
          {
            urls: "turn:SERVER?transport=udp",
            username: "foo",
            credential: "bar",
          },
        ],
      }

      let offerer = new RTCPeerConnection(configuration);
      let answerer = new RTCPeerConnection(configuration);

      offerer.onicecandidate = e => e.candidate != null ? answerer.addIceCandidate(e.candidate) : null;
      answerer.onicecandidate = e => e.candidate != null ? offerer.addIceCandidate(e.candidate) : null;

      offerer.oniceconnectionstatechange = e => console.log(offerer.iceConnectionState)
      answerer.oniceconnectionstatechange = e => console.log(answerer.iceConnectionState)

      let dc = offerer.createDataChannel('foo')

      let i = 0
      setInterval(() => {
        dc.send(i++)
      }, 1000)

      answerer.ondatachannel = e => (e.channel.onmessage = e => console.log(e.data))

      offerer.createOffer().then(offer => {
        offerer.setLocalDescription(offer)
        answerer.setRemoteDescription(offer)
        return answerer.createAnswer()
      }).then(answer => {
        answerer.setLocalDescription(answer)
        offerer.setRemoteDescription(answer)
      })

@bshimc
Copy link

bshimc commented Oct 29, 2020

For us the situation triggers when there are a lot of concurrent peerconnections. It doesn't seem (directly) tied to message qps.

@mehrvarz
Copy link

I see 3 allocations being created for a turn session. Same client ip, 3 different port numbers. Server address is always 0.0.0.0:3478.

What is odd: all AddPermission() calls seem to go to one allocation only. The many "No Permission or Channel exists" messages occur in relation to the other (empty) allocations. Is this normal?

I am using turn v2.0.5 and web browsers as webrtc clients only.

@mehrvarz
Copy link

What is odd: all AddPermission() calls seem to go to one allocation only. The many "No Permission or Channel exists" messages occur in relation to the other (empty) allocations. Is this normal?

These "No Permission or Channel exists" messages were caused by an issue in my client software.
Fixed now. Apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants