Open RaistGH opened 4 years ago
This is related to this discussion.
@j1elo , just mentioning you to take it into account and closing the issue.
This was probably caused by a regression introduced in libnice at some point after 0.1.16. We updated libnice for one of the 6.13.1 or 6.13.2 releases, and then immediately started receiving reports about File Descriptors being exhausted, and after some investigation were able to find the issue in libnice.
Opened a bug report: https://gitlab.freedesktop.org/libnice/libnice/-/issues/110 and this helped to get the problem resolved quickly. libnice fixed this issue for their release 0.1.17, and this is the version that ships with Kurento 6.14.0.
It seems like the issue is still ongoing but not that frequently. So we've not been able to catch it yet, but from time to time (few months) we need to restart KMS due to this. I couldn't have a close look to it until now, but definitely this is what is happening again, all ports being exhausted. Unfortunately I cannot reproduce it yet. We're using KMS 6.16, but I guess this was the same in 6.14, we just didn't notice it fast enough. Do you have any suggestion to log what's happening so I can inspect and/or paste here the log whenever it happens again?
This bug is already fixed in version 6.14, but as per the release notes, I think it has passed unnoticed. I'd like to report it here in order to keep in mind to avoid it happens again in future releases and for people facing the same issue.
Issue description
After some time working, and (apparently) randomly, the TURN connection stops working and no more connections can be established. The browser shows the error message
ICE failed, add a TURN server and see about:webrtc for more details
orICE failed, your TURN server appears to be broken, see about:webrtc for more details
. Restarting TURN server doesn't solve the issue. Only restarting KMS works. Then again, after some time the issue appears.How to reproduce?
This is happening in KMS 6.13.1 and 6.13.2 but it's not happening in 6.13.0 and 6.14.0 Instructions using Docker container
In order to confirm the issue:
docker exec -it <CONTAINER_NAME> /bin/bash
apt-get update && apt-get install net-tools
turnutils_uclient -v -p 3478 -u <TURN_USER> -w <TURN_PASS> 172.17.0.1
will result in an errorcoturn error 508 (Cannot create socket)
Expected & current behavior
KMS should release the ports used for every relay connection once the connection is stopped. However it doesn't, blocking allocation of further ports for next connections.
(Optional) Possible solution
Upgrade KMS to version 6.14.0 or downgrade to version 6.13.0
INFO about Kurento Media Server
INFO about your environment
Using Docker version Using Recorder Endpoint Using TURN server (coturn) in the same server as the KMS container