ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.17k stars 618 forks source link

[server crash issue] - Data channel doesn't parse curly braces, server throws error 500 on WebRTCClient.parseMessage #4736

Open fedezubo opened 1 year ago

fedezubo commented 1 year ago

Short description

When sending data in the data channel, if a viewer connects to the stream and the data channel contains a JSON structure or curly braces in general the server crashes and throws a 500 error on WebRTCClient.parseMessage

Environment

Steps to reproduce

  1. Go to your index.html and start publishing a stream
  2. Go to player.html and subscribe to the stream previously published
  3. From the broadcaster send a message using the data channel that looks like this {"text":"Hello"}

Expected behavior

The message should be sent

Actual behavior

The server crashes and spits out a 500 error

Logs

2023-01-06 15:22:38,409 [https-jsse-nio2-0.0.0.0-5443-exec-11] ERROR o.a.c.c.C.[.[.0.0.0.[.[jersey-serlvet] - Servlet.service() for servlet [jersey-serlvet] in context with path [/WebRTCAppEE] threw exception [java.lang.NullPointerException] with root cause java.lang.NullPointerException: null at io.antmedia.enterprise.webrtc.WebRTCClient.parseMessage(WebRTCClient.java:2174) at io.antmedia.enterprise.webrtc.WebRTCClient.sendMessageViaDataChannel(WebRTCClient.java:2159) at io.antmedia.enterprise.webrtc.DataChannelRouter.playerMessageReceived(DataChannelRouter.java:72)

We have opened a ticket with the enterprise support team but I think it's worth putting it out there for others to be aware of

mustafaboleken commented 1 year ago

Hi @fedezubo

Thank you very much for reporting this issue. We already fixed it on 2.5.2, you can upgrade and test it.

Screenshot 2023-01-07 at 16 33 50
fedezubo commented 1 year ago

Thanks for the update.

If you want to forward to the enterprise team that the 2.5.1 version is still available to download from your enterprise download page... They might want to take that down.

Will look forward to the release that sorts out the stuttering on ios16. Or does 2.5.3 already include the fix that we spoke about on email?

mekya commented 1 year ago

Hi @fedezubo ,

There is a fix for the stuttering video in 2.5.3. On the other hand, I'm not sure if it's the same problem. The resolved problem is about stuttering the video when there is a scaling in the gpu.

Let us synch internally and move this task to the backlog to discuss internal meeting.

fedezubo commented 1 year ago

Hi @fedezubo ,

There is a fix for the stuttering video in 2.5.3. On the other hand, I'm not sure if it's the same problem.

The resolved problem is about stuttering the video when there is a scaling in the gpu.

Let us synch internally and move this task to the backlog to discuss internal meeting.

Hey there, with GPU scaling you mean GPU scaling on the server where the video is getting broadcasted from? Or GPU scaling on the client where the video is being played?

Let me know!

mekya commented 1 year ago

I mean the scaling the size of the video in the GPU on the server side.