Ghost Connections

Hello, I’m having problems with ghost connections.
Some connections are getting connected in sessions endlessly without posting anything, not even audio or video.

I have tracked the issue and found that they mostly happen with the default browser on samsung smartphones, the Samsung Internet Browser and rarely on Safari on iPhone devices.

Link to install Samsung Browser

To reproduce the error, just connect 2 people in a room, one using one of the browsers mentioned above, and with the 2 people talking, you close the browser, don’t minimize it, close it.

After closing the browser, the session will keep the ghost connection infinitely connected.

OpenVidu Log from when i closed the Samsung Internet Browser

[INFO] 2023-07-05 15:27:43,274 [https-jsse-nio-0.0.0.0-443-exec-1] io.openvidu.server.rest.SessionRestController - REST API: GET /openvidu/api/sessions

[INFO] 2023-07-05 15:27:46,881 [SessionHandler-dkiqdrdr0ka70e53tjc8u59foi-e66-t0] io.openvidu.server.core.SessionEventsHandler - Video data of participant con_D4dusLBOMd was initialized. height:420, width:320, isVideoActive: true, isAudioActive: true

[INFO] 2023-07-05 15:27:46,979 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: str_CAM_Irjv_con_D4dusLBOMd (publisher) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1688585266978

[INFO] 2023-07-05 15:27:47,012 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowOutStateChanged] -> endpoint: str_CAM_Irjv_con_D4dusLBOMd (publisher) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1688585267011

[INFO] 2023-07-05 15:27:47,263 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: con_HS7EFXTKCt_str_CAM_Irjv_con_D4dusLBOMd (subscriber) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1688585267262

[INFO] 2023-07-05 15:27:47,426 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: con_IioqIMylnT_str_CAM_Irjv_con_D4dusLBOMd (subscriber) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1688585267426

[ERROR] 2023-07-05 15:27:47,933 [https-jsse-nio-0.0.0.0-443-exec-8] io.openvidu.server.rpc.RpcHandler - Transport exception for WebSocket session: dkiqdrdr0ka70e53tjc8u59foi - Exception: Unable to unwrap data, invalid status [CLOSED]

[INFO] 2023-07-05 15:27:48,276 [https-jsse-nio-0.0.0.0-443-exec-6] io.openvidu.server.rest.SessionRestController - REST API: GET /openvidu/api/sessions

[INFO] 2023-07-05 15:27:50,980 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: str_CAM_Irjv_con_D4dusLBOMd (publisher) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1688585270979

[INFO] 2023-07-05 15:27:51,000 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowOutStateChanged] -> endpoint: str_CAM_Irjv_con_D4dusLBOMd (publisher) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1688585270999

[INFO] 2023-07-05 15:27:51,264 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: con_HS7EFXTKCt_str_CAM_Irjv_con_D4dusLBOMd (subscriber) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1688585271264

[INFO] 2023-07-05 15:27:51,428 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t181] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: con_IioqIMylnT_str_CAM_Irjv_con_D4dusLBOMd (subscriber) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1688585271427

[INFO] 2023-07-05 15:27:53,275 [https-jsse-nio-0.0.0.0-443-exec-5] io.openvidu.server.rest.SessionRestController - REST API: GET /openvidu/api/sessions

[INFO] 2023-07-05 15:27:57,934 [jsonrpcTaskScheduler-1] io.openvidu.server.rpc.RpcHandler - After connection closed for WebSocket session: dkiqdrdr0ka70e53tjc8u59foi - Status: Unable to unwrap data, invalid status [CLOSED]

Apparently OpenVidu notices that the connection has been lost, however, it does not notify the event endpoint that this has happened and I cannot find a way to drop this connection because it is just like a normal connection.

No exception happens on the frontend where the videoconference is taking place, however if someone enters the room after the ghost connection is already there, OpenVidu will show the following exception.

I am using openvidu/openvidu-server:2.28.0
This is my container configuration

OPENVIDU_WEBHOOK_EVENTS=[“sessionCreated”, “sessionDestroyed”, “participantJoined”, “participantLeft”, “webrtcConnectionCreated”, “webrtcConnectionDestroyed”, “recordingStatusChanged”, “filterEventDispatched”, “signalSent”, “nodeCrashed”, “nodeRecovered”, “mediaNodeStatusChanged”,“autoscaling”,“HANodeRegistered”,“HANodeDeregistered”]

I forgot to mention, i am using angular with
“openvidu-browser”: “^2.28.0”,

When you reload the session, are ghost participants still there?

We are working for a solution in 2.29.0

Regards.

Yes, ghost connections stay connected infinitely.

The two ways to remove the ghost connection are:

  • Removing the participant from the session by calling the “forceDisconnect” method from a connection with the MODERATOR role

  • Restart the OpenVidu server

Hi again, i tested this with the openvidu/openvidu-server: 2.29.0-nightly-20230716 and the bug still happens.

OpenVidu Logs:

[ERROR] 2023-07-17 14:44:13,123 [https-jsse-nio-0.0.0.0-443-exec-4] io.openvidu.server.rpc.RpcHandler - Transport exception for WebSocket session: q8lbu84rp94p5eibchqimium0i - Exception: Unable to unwrap data, invalid status [CLOSED]

[INFO] 2023-07-17 14:44:15,279 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t16] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: str_CAM_MghE_con_XjHmwQajqh (publisher) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1689619455277

[INFO] 2023-07-17 14:44:15,279 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: str_CAM_MghE_con_XjHmwQajqh (publisher) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1689619455277

[INFO] 2023-07-17 14:44:15,316 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowOutStateChanged] -> endpoint: str_CAM_MghE_con_XjHmwQajqh (publisher) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1689619455315

[INFO] 2023-07-17 14:44:15,351 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowOutStateChanged] -> endpoint: str_CAM_MghE_con_XjHmwQajqh (publisher) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1689619455351

[INFO] 2023-07-17 14:44:15,381 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: con_FNQBKVEt1t_str_CAM_MghE_con_XjHmwQajqh (subscriber) | state: NOT_FLOWING | pad: default | mediaType: AUDIO | timestamp: 1689619455381

[INFO] 2023-07-17 14:44:15,393 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaFlowInStateChanged] -> endpoint: con_FNQBKVEt1t_str_CAM_MghE_con_XjHmwQajqh (subscriber) | state: NOT_FLOWING | pad: default | mediaType: VIDEO | timestamp: 1689619455393

[INFO] 2023-07-17 14:44:23,124 [jsonrpcTaskScheduler-1] io.openvidu.server.rpc.RpcHandler - After connection closed for WebSocket session: q8lbu84rp94p5eibchqimium0i - Status: Unable to unwrap data, invalid status [CLOSED]

[INFO] 2023-07-17 14:44:35,378 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaStateChangedEvent]: -> endpoint: str_CAM_MghE_con_XjHmwQajqh (publisher) | oldState: CONNECTED | newState: DISCONNECTED | timestamp: 1689619475377

[INFO] 2023-07-17 14:44:37,788 [AbstractJsonRpcClientWebSocket-reqResEventExec-e2-t26] io.openvidu.server.kurento.core.KurentoParticipantEndpointConfig - KMS event [MediaStateChangedEvent]: -> endpoint: con_XjHmwQajqh_str_CAM_HrSS_con_FNQBKVEt1t (subscriber) | oldState: CONNECTED | newState: DISCONNECTED | timestamp: 1689619477787

I noticed you guys released version 2.29.0.
As soon as possible I will test this new version and check if the problem has been corrected and come back here to give feedback.

1 Like

The problem still persists in version 2.29

1 Like

I have the same problem on my site as well…I have planned to test this version soon…
I’ll keep an eye on this issue…