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”]