COTURN problem after update from 2.20 to 2.21

Hi,
my current project worked well with with standard configuration of OpenVidu 2.20. - with just a small change. I used my web-server (with OpenVidu application) with public IP and domain in front of the internet - and the OpenVidu with just a local IP. To achieve this, I did the following:

  • add my public domain as COTURN_IP to env file
  • use nginx on my public server to redirect API, websocket and COTURN requests to the OpenVidu server with local IP

All worked good - until the update to OpenVidu 2.21. - then the COTURN hangs on “incoming packet BINDING processed, success” and I can’t see any video.

COTRUNs Log (replace MY_PUBLIC_IP):


2022-04-26T07:48:24.267289093Z 157: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:47:54.308343505Z 127: : session 002000000000000001: new, realm=<openvidu>, username=<OGELN6>, lifetime=600,
2022-04-26T07:47:54.308366567Z 127: : session 002000000000000001: new, realm=<openvidu>, username=<OGELN6>, lifetime=600,
2022-04-26T07:47:54.308375646Z 127: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet ALLOCATE processed, success,
2022-04-26T07:47:54.308384603Z 127: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet ALLOCATE processed, success,
2022-04-26T07:48:04.152811699Z 137: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:04.152887447Z 137: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:04.153025247Z 137: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:04.153063104Z 137: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:14.202868180Z 147: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:14.202938145Z 147: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:14.202950495Z 147: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:14.202944995Z 147: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:24.262965306Z 157: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:24.263005878Z 157: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:24.267263782Z 157: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:34.312470466Z 167: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:34.312420325Z 167: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:34.312483158Z 167: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:44.362669663Z 177: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:44.362731817Z 177: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:44.362620181Z 177: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:34.312492585Z 167: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:44.362909340Z 177: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:54.422716481Z 187: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:54.422755263Z 187: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:54.422761715Z 187: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:48:54.422767237Z 187: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:04.483139921Z 197: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:04.483198693Z 197: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:04.483205730Z 197: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:04.483360295Z 197: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:14.543914987Z 207: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:14.543964122Z 207: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:14.543975078Z 207: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:14.543983639Z 207: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:24.587700764Z 217: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:24.587660795Z 217: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:24.587707824Z 217: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:34.651229212Z 227: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:24.587713236Z 217: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:34.651266227Z 227: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:34.651291003Z 227: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:34.651296561Z 227: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:44.697815944Z 237: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:44.707465942Z 237: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:44.697851393Z 237: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:44.707485890Z 237: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:54.765776863Z 247: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:54.765783188Z 247: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:54.765738534Z 247: : session 002000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:49:54.765788292Z 247: : session 001000000000000001: realm <openvidu> user <OGELN6>: incoming packet BINDING processed, success,
2022-04-26T07:56:54.269596050Z 667: : session 000000000000000001: realm <openvidu> user <OGELN6>: incoming packet message processed, error 438: Wrong nonce,
2022-04-26T07:56:54.269644403Z 667: : session 000000000000000001: realm <openvidu> user <OGELN6>: incoming packet message processed, error 438: Wrong nonce,
2022-04-26T07:56:54.312233162Z 667: : session 000000000000000001: realm <openvidu> user <OGELN6>: incoming packet REFRESH processed, error 437: Invalid allocation,
2022-04-26T07:56:54.312266673Z 667: : session 000000000000000001: realm <openvidu> user <OGELN6>: incoming packet REFRESH processed, error 437: Invalid allocation,
2022-04-26T07:56:54.312272707Z 667: : session 000000000000000001: realm <openvidu> user <OGELN6>: incoming packet message processed, error 437: Invalid allocation,
2022-04-26T07:56:54.312278049Z 667: : session 000000000000000001: realm <openvidu> user <OGELN6>: incoming packet message processed, error 437: Invalid allocation,
2022-04-26T07:56:54.353318305Z 667: : session 002000000000000002: realm <openvidu> user <OGELN6>: incoming packet message processed, error 438: Wrong nonce,
2022-04-26T07:56:54.353353090Z 667: : session 002000000000000002: realm <openvidu> user <OGELN6>: incoming packet message processed, error 438: Wrong nonce,
2022-04-26T07:56:54.396255826Z 667: : session 002000000000000002: realm <openvidu> user <OGELN6>: incoming packet REFRESH processed, error 437: Invalid allocation,
2022-04-26T07:56:54.396289928Z 667: : session 002000000000000002: realm <openvidu> user <OGELN6>: incoming packet REFRESH processed, error 437: Invalid allocation,
2022-04-26T07:56:54.396312338Z 667: : session 002000000000000002: realm <openvidu> user <OGELN6>: incoming packet message processed, error 437: Invalid allocation,
2022-04-26T07:56:54.396317867Z 667: : session 002000000000000002: realm <openvidu> user <OGELN6>: incoming packet message processed, error 437: Invalid allocation,
2022-04-26T07:57:54.216454068Z 727: : session 001000000000000001: usage: realm=<openvidu>, username=<OGELN6>, rp=15, rb=384, sp=15, sb=1572,
2022-04-26T07:57:54.216492836Z 727: : session 001000000000000001: usage: realm=<openvidu>, username=<OGELN6>, rp=15, rb=384, sp=15, sb=1572,
2022-04-26T07:57:54.216499348Z 727: : session 001000000000000001: peer usage: realm=<openvidu>, username=<OGELN6>, rp=3, rb=264, sp=0, sb=0,
2022-04-26T07:57:54.216504724Z 727: : session 001000000000000001: peer usage: realm=<openvidu>, username=<OGELN6>, rp=3, rb=264, sp=0, sb=0,
2022-04-26T07:57:54.216684364Z 727: : session 001000000000000001: closed (2nd stage), user <OGELN6> realm <openvidu> origin <>, local 10.1.70.10:3478, remote MY_PUBLIC_IP:36342, reason: allocation timeout,
2022-04-26T07:57:54.216696952Z 727: : session 001000000000000001: closed (2nd stage), user <OGELN6> realm <openvidu> origin <>, local 10.1.70.10:3478, remote MY_PUBLIC_IP:36342, reason: allocation timeout,
2022-04-26T07:57:54.216702815Z 727: : session 001000000000000001: delete: realm=<openvidu>, username=<OGELN6>,
2022-04-26T07:57:54.216707954Z 727: : session 001000000000000001: delete: realm=<openvidu>, username=<OGELN6>

If I just switch back from “image: openvidu/openvidu-server:2.21.0” to “image: openvidu/openvidu-server:2.20.0” in the docker-compose.yml (keeping coturn 6.0.0 etc.), everything is working again.

What can cause this problem?

(Yes I know - I would now be able to install and configure an external COTURN on my public application server - but I really like the dynamic authentication system of the OpenVidu default solution and want to keep it!)

Hello @DiStefano8472

(Yes I know - I would now be able to install and configure an external COTURN on my public application server - but I really like the dynamic authentication system of the OpenVidu default solution and want to keep it!)

Don’t worry about this. We are allowing more flexible TURN/STUN configurations but we still support the coturn deployment which is deployed next to OpenVidu and dynamic authentication. And we don’t want to stop using it.

Regarding your issue, what makes you think that the issue is Coturn?

Did you upgrade following official instructions? I would try to use in COTURN_IP, instead of your domain name, your public IP, and check if it works.

Also, if you set COTURN_IP=auto-ipv4, the public IP is autodiscovered.

Hi cruizba,
my problem is still alive - but I have new knowledge about the problem. Maybe we can bring it to a solution.

  • I am using OpenVidu 2.22.0 with your external COTURN
  • Web-App (with browser API) connecting to Web-App works fine!
  • COTURN (if I user external connection) works also fine

I only have problems with our Android-App:

  • internal network (no COTURN needed)
  • connecting from Android-App to Web-App
  • Websocket works fine, I see participants, I can send chat messages
  • BUT video/audio does not work on both sides!
  • browser API gives me a noStreamPlayingEventExceptionTimeout warning
  • OpenVidu server gives the following error [INFO] 2022-07-14 08:55:29,172 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t55] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [IceComponentStateChange]: → endpoint: str_CAM_UnyI_con_XmIiCTRQiD (publisher) | state: FAILED | componentId: 2 | streamId: 1 | timestamp: 1657788929171

I found no errors in code or on server, so I compiled your android demo app:

  • OpenVidu android demo app works fine - with video and audio - even from external location

But my android app has been working all the time - it stopped working with upgrade from 2.19 to 2.20 - so I did the following:

  • change the openvidu image in docker-compose.yml back to 2.20.0
  • put the code blocks with customIceServers and sdkVersion back to comment

And viola - my android app is sending and receiving video again.
What can cause this strange behaviour?
(What else change from 2.20 to 2.21 can cause this problem?)

I got it - now it works as expected - from internal and even from external networks!

My android developer missed to apply this commit in our android app code:

I am wondering - why has it worked until OpenVidu 2.20.0 - and no more with versions above?
Have you an explanation?