-
Notifications
You must be signed in to change notification settings - Fork 341
Error when handling datagram #206
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
Comments
I have the same issue in CentOS Linux 7. |
I am also seeing "relay already allocated for 5-TUPLE". I am seeing this more often lately. Maybe it is related to newer Firefox releases? |
This log is showing the "already allocated for 5-TUPLE" issue. The client is FF 91 on Android. The server is running on Linux with Go 1.17. Comments below.
comments:
There are three such "fiveTuple" lines before the error (why?). turn.go:40: fiveTuple &{0 c.c.c.c:47289 0.0.0.0:3739} |
For comparsion, here a log without the 5-TUPLE issue. The client in this case is Chromium 91 on Ubuntu. There are again 3 calls to AuthHandler (is this expected?). But unlike in the FF 91 case above, you can see CreatePermission being called. There is also less activity before the first call to AuthHandler than in the previous log.
|
Hey @Sean-Der
Sorry, I am having difficulties getting on to Slack. In any case, there seems to be an issue with Pion Turn and newer Firefox releases. Would you be able to take a look at my logs and share a thought? If you can help me a bit I may be able to fix this and provide a patch. Using FF with Coturn does not appear to throw any errors. Nor does using Chromium with Pion Turn. But when using FF 91 (on Ubuntu and Android) with Pion Turn, I always see the "already allocated for 5-TUPLE" error. And in some cases the WebRTC service can then not be used or there is a seconds long delay (however, sometimes service does work despite the error msg). Crucial question is whether FF or Pion Turn needs fixing. Thank you. |
Think I found a solution. It involves swapping step 1 and 2 in the handleAllocateRequest() function of internal/server/turn.go. In other words, I check for 5-tuple before invoking authenticateRequest(). Please let me know if doing this is wrong for obvious reasons. This is the code I am using. It seems to work well with both browsers, including on Android. FF 91 still does this, but now it appears to be harmless and all sessions work without delay or abort. |
As RFC said, The server MUST require that the request be authenticated first. So there might be another reason for this. https://datatracker.ietf.org/doc/html/rfc5766#section-6.2
|
No, the word "MUST" relates to "be authenticated". It does not relate to the order of steps. Five things need to be done. RFC does not explicitly say that a specific order is required. Swapping step 1 and 2 seems to work well for me in practice and for 6 month now. Checking "is allocations in use" before doing "authenticateRequest()" also make full sense to me. With the modified order, no authentication takes place if the allocation is already in use. The original order was causing issues with some UA's. Not with all. The modified order works with all UA's. Can you please do a code analysis? |
We should follow the RFC's step to check these.
client's behavior like chrome is follow RFC, and nICEr not implement this.
RFC also has mentioned server could implement 'stateless stack approach' to process allocation retransmit, but pion not implement this. So the '5 tuple already exist' problem is caused by both ff and pion. I can reproduce it if I always drop first allocation response, and ff can't establish connection. Then I add the retransmit process, the problem is gone, ff works fine even allocation response is lost/dropped. I will create a PR tomorrow for this |
Wow. This is a fairly extensive patch. When do you think will a release tag become available? |
@mehrvarz Have another test case for packet lost, if all things working, will release today |
I am now testing v2.0.8. As before, I am seeing "No Permission or Channel exists..." log entries. About 4-6 per client connect, even for pure p2p (none-TURN) connections. These msgs come from /internal/allocation/allocation.go, very close to code you just looked at. Did you not notice them fill the log? Note: If something is wrong (say, turn auth fail), I see more of these msgs. But if everything is working right, I still get about 4-6 of these msgs. |
@cnderrauber I am not asking you to solve a problem. I am only asking if you have seen unexpected "No Permission or Channel exists..." log msgs. |
I think they are exist but not sure. |
Findings:
Just let me mute this log statement. Ed: I previously reported this issue. It sometimes goes away. But it keeps coming back. |
I setup a new pion server, put up for a few days (not even using it yet), and this error appears from no where. Seems like someone is sending random datagram to my server. |
I have the same problem when connecting from ios 15.0 |
Uh oh!
There was an error while loading. Please reload this page.
Your environment.
Windows Server 2019
Pion Turn server 2.0.2
What did you do?
I executed "turn-server-simple.exe" to create a Turn server for a WebRTC project Im developing
What did you expect?
To work ok. It does sometimes. Others it get an error.
What happened?
When haviong a videocall using WebRTC, the console throws a lots of errors. For example:
turn ERROR: 2021/03/09 09:47:34 error when handling datagram: failed to handle Refresh-request from 94.73.44.131:30866: no allocation found for 94.73.44.131:30866:0.0.0.0:3478
turn ERROR: 2021/03/09 09:47:34 error when handling datagram: failed to handle Refresh-request from 94.73.44.131:30858: no allocation found for 94.73.44.131:30858:0.0.0.0:3478
turn ERROR: 2021/03/09 09:47:34 error when handling datagram: failed to handle Refresh-request from 94.73.44.131:30860: no allocation found for 94.73.44.131:30860:0.0.0.0:3478
turn ERROR: 2021/03/09 09:52:12 error when handling datagram: failed to create stun message from packet: unexpected EOF: not enough bytes to read header
turn ERROR: 2021/03/09 09:52:12 error when handling datagram: failed to create stun message from packet: unexpected EOF: not enough bytes to read header
turn ERROR: 2021/03/09 09:52:25 error when handling datagram: failed to create stun message from packet: unexpected EOF: not enough bytes to read header
Others, I get:
turn ERROR: 2021/03/09 12:44:52 error when handling datagram: failed to handle Allocate-request from 176.83.80.192:7363: relay already allocated for 5-TUPLE
turn ERROR: 2021/03/09 12:44:52 error when handling datagram: failed to handle Allocate-request from 176.83.80.192:7543: relay already allocated for 5-TUPLE
turn ERROR: 2021/03/09 12:44:52 error when handling datagram: failed to handle Allocate-request from 176.83.80.192:7370: relay already allocated for 5-TUPLE
turn ERROR: 2021/03/09 12:44:52 error when handling datagram: failed to handle Allocate-request from 176.83.80.192:7381: relay already allocated for 5-TUPLE
Sometimes the videocall works ok althought the errors; sometimes not.
The text was updated successfully, but these errors were encountered: