question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

aioice.stun.TransactionFailed: STUN transaction failed (403 - Forbidden IP)

See original GitHub issue

Hello, Would like to check if anyone has seen this problem before. I only have turn server added in aioice.Connection: connection = aioice.Connection(ice_controlling=True, turn_server=turn_1, turn_username=turn_user, turn_password=turn_password, turn_ssl=True, use_ipv6=False)

When I call ‘await connection.gather_candidates()’, I can see that ICE candidates are correctly gathered including the one for relay. Something like the following: [Candidate(cc5d96d7acaef3049243dc2dc49075a0 1 udp 2130706431 1xx.9x.xx.14x 50402 typ host), Candidate(52c97f4be0896b28eb84deed0b0dca3a 1 udp 16777215 1x.2xx.2x.x3 10008 typ relay raddr 1xx.9x.xx.14x rport 42750)]

But when relay candidate is used (after calling await connection.connect()), I got the following error:

[2021-02-23 09:32:57 -0000] [ERROR] Signaling Engine - Task exception was never retrieved
future: <Task finished name='Task-34' coro=<TurnClientMixin.send_data() done, defined at /usr/local/lib/python3.8/site-packages/aioice/turn.py:241> exception=TransactionFailed(Message(message_method=Method.CHANNEL_BIND, message_class=Class.ERROR, transaction_id=b'\x07\xfb\xc4\xb6\xa4|\x0b\xc8\x18\xa1\x08P'))>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 251, in send_data
    await self.channel_bind(channel, addr)
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 85, in channel_bind
    await self.request_with_retry(request)
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 213, in request_with_retry
    response, addr = await self.request(request)
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 200, in request
    return await transaction.run()
  File "/usr/local/lib/python3.8/site-packages/aioice/stun.py", line 299, in run
    return await self.__future
aioice.stun.TransactionFailed: STUN transaction failed (403 - Forbidden IP)

If I restart again and try to gather candidates one more time, additional error presents:

[2021-02-23 09:23:01 -0000] [ERROR] Signaling Engine - Task exception was never retrieved
future: <Task finished name='Task-38' coro=<TurnClientMixin.send_data() done, defined at /usr/local/lib/python3.8/site-packages/aioice/turn.py:241> exception=TransactionFailed(Message(message_method=Method.CHANNEL_BIND, message_class=Class.ERROR, transaction_id=b"\xa2\x1b'm\xcc\xbeS#i\x07\x05\xc3"))>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 251, in send_data
    await self.channel_bind(channel, addr)
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 85, in channel_bind
    await self.request_with_retry(request)
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 213, in request_with_retry
    response, addr = await self.request(request)
  File "/usr/local/lib/python3.8/site-packages/aioice/turn.py", line 200, in request
    return await transaction.run()
  File "/usr/local/lib/python3.8/site-packages/aioice/stun.py", line 299, in run
    return await self.__future
aioice.stun.TransactionFailed: STUN transaction failed (400 - You cannot use the same channel number with different peer)

Not sure why the IP is considered forbidden and why the same channel number is picked. If anyone knows what is happening behind and scene, could you please help?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
demostaniscommented, Aug 28, 2021

I’m currently facing the same issue. I have no control over the TURN/STUN servers, so I can’t know if it comes from coturn too. How did you manage to solve it? Thanks

0reactions
moritz157commented, Oct 24, 2021

@hankhongyi I’m experiencing a similar issue at the moment. Do you remember how you fixed it? That would really help me and probably @demostanis too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

coturn turn server error CREATE_PERMISSION 403
I was setting only public dns for external-ip in turnserver.conf . I set it as public-ip/private-ip and it worked. something like below:.
Read more >
DTLS handshake timeout with turn/tcp, but connection ...
TransactionFailed : STUN transaction failed (403 - Forbidden IP) but as it works ... this error I think it's not this reason which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found