# Automatically stream destroyed and media server disconnect

**URL:** <https://openvidu.discourse.group/t/automatically-stream-destroyed-and-media-server-disconnect/1360>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [July 3, 2020, 1:53pm UTC](https://openvidu.discourse.group/t/automatically-stream-destroyed-and-media-server-disconnect/1360 "2020-07-03T13:53:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohit.roy](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@rohit.roy](https://openvidu.discourse.group/u/rohit.roy)\
**Post date:** [July 3, 2020, 1:53pm UTC](https://openvidu.discourse.group/t/automatically-stream-destroyed-and-media-server-disconnect/1360/1 "2020-07-03T13:53:13Z")

</div>

Hi,  
I’m continuing to work on getting OpenVidu CE in my local dev environment. I am using the latest latest version of Openvidu. I am able to connect my Publisher and Subscriber perfectly but after some regular interval (approx 10-15 minutes) stream get disconnected automatically.

When i checked the browser console i found below message

- streamDestroyed reason “mediaServerDisconnect”
- Event ‘streamDestroyed’ triggered by ‘Publisher’ StreamEvent

**surprisingly** there was no Browser Reload, no Force disconnect and no Openvidu server restart at my end…then i checked the openVidu log and found message like “Running non active sessions garbage collector” and the setting was **`OPENVIDU_SESSIONS_GARBAGE_INTERVAL`** - “900” seconds.  
I tried to reduce the time from 15 mints to 2 mints and rechecked the whole scenario and found “StreamDestroyed reason mediaServerDisconnect” is happening at every 2-3 minutes.

I am not sure why it’s behaving like this despite i have 1 Publisher and 1 Subscriber **[It means given session is an Active session]**. Please help how this garbage collector of non active/active sessions runs. Am i missing something in setting or code?

**Few more information**  
O.S - Ubuntu 18.04  
App+Openvidu CE - On same local machine  
Publisher - Chrome  
Subscriber - Chrome Incognito

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [July 8, 2020, 9:12am UTC](https://openvidu.discourse.group/t/automatically-stream-destroyed-and-media-server-disconnect/1360/2 "2020-07-08T09:12:11Z")

</div>

Hello @rohit.roy

can you share your OpenVidu server logs with us? It seems a bug in OpenVidu.
