# Producer randomly freezing throwing error to console

**URL:** <https://mediasoup.discourse.group/t/producer-randomly-freezing-throwing-error-to-console/4576>\
**Category:** Off Topic\
**Created:** [September 17, 2022, 6:40pm UTC](https://mediasoup.discourse.group/t/producer-randomly-freezing-throwing-error-to-console/4576 "2022-09-17T18:40:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeffMan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jeffman/32/1369_2.png) [@JeffMan](https://mediasoup.discourse.group/u/JeffMan)\
**Post date:** [September 17, 2022, 6:40pm UTC](https://mediasoup.discourse.group/t/producer-randomly-freezing-throwing-error-to-console/4576/1 "2022-09-17T18:40:44Z")

</div>

Hi, When sending a video stream to the mediasoup-server then consuming by a different client periodically the video stream will freeze for a few frames then continue.  
This occurs at any resolution and framerate, seems to occur more on higher resolutions+framerate  
Everything is on the same local network.

Image of error on producer console:

 ![image](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/2X/a/ab7b2e0464626b210ab5faecde7cfeae6b52495e.png)

---

<div class="post-metadata">

**Author:** ![BronzedBroth](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@BronzedBroth](https://mediasoup.discourse.group/u/BronzedBroth)\
**Post date:** [September 17, 2022, 8:32pm UTC](https://mediasoup.discourse.group/t/producer-randomly-freezing-throwing-error-to-console/4576/2 "2022-09-17T20:32:06Z")

</div>

ICE state is failing most likely for client and you may need to restart it automatically or offer an option manually.

I would say why you see this error is that your keep-alive mechanism stays active longer than this re-attempt/failure.

So all in all try restarting ICE if you’re keeping user state alive.

---

<div class="post-metadata">

**Author:** ![JeffMan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jeffman/32/1369_2.png) [@JeffMan](https://mediasoup.discourse.group/u/JeffMan)\
**Post date:** [September 18, 2022, 5:38pm UTC](https://mediasoup.discourse.group/t/producer-randomly-freezing-throwing-error-to-console/4576/3 "2022-09-18T17:38:50Z")

</div>

The connected is still active and sending packets, randomly a few packets will fail to send causing the stream to freeze and drop some frames.

---

<div class="post-metadata">

**Author:** ![BronzedBroth](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@BronzedBroth](https://mediasoup.discourse.group/u/BronzedBroth)\
**Post date:** [September 18, 2022, 9:36pm UTC](https://mediasoup.discourse.group/t/producer-randomly-freezing-throwing-error-to-console/4576/4 "2022-09-18T21:36:47Z")

</div>

That’s not normal. In Production I only see this issue when bitrate can’t be met and I must lessen the load temporarily. You can try TCP strictly and a keyframe of 2-4 seconds see if that helps any. (This is assuming you’re not peaking in CPU usage at all).
