Just-Some-Bots / MusicBot

:musical_note: The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)
https://just-some-bots.github.io/MusicBot/
MIT License
3.14k stars 2.36k forks source link

Bot will not rejoin voice channel if idle for too long #783

Closed ghost closed 6 years ago

ghost commented 7 years ago

I have AutoSummon disabled and have the bot set to auto-join my server's music voice channel. If the bot goes without playing music for too long, it will leave the voice channel. It responds to commands as expected and can be restarted, but it will not rejoin the voice channel even if users join, there are songs in the queue, or someone adds a song to the queue. I get this error.

future: <Task finished coro=<MusicPlayer.websocket_check() done, defined at /home/discord/MusicBot/musicbot/player.py:280> exception=TimeoutError()>
Traceback (most recent call last):
  File "/home/discord/MusicBot/musicbot/player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/home/discord/MusicBot/musicbot/player.py", line 291, in websocket_check
    await self.bot.reconnect_voice_client(self.voice_client.channel.server)
  File "/home/discord/MusicBot/musicbot/bot.py", line 310, in reconnect_voice_client
    new_vc = await self.get_voice_client(vc.channel)
  File "/home/discord/MusicBot/musicbot/bot.py", line 237, in get_voice_client
    s_id_data = await asyncio.wait_for(s_id, timeout=10, loop=self.loop)
  File "/usr/local/lib/python3.5/asyncio/tasks.py", line 396, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 4014, reason = Disconnected..

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.5/site-packages/discord/voice_client.py", line 272, in poll_voice_ws
    yield from self.ws.poll_event()
  File "/usr/local/lib/python3.5/site-packages/discord/gateway.py", line 607, in poll_event
    raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 4014, reason = Disconnected..
[Debug] Voice websocket is CLOSED, reconnecting
thomashagg commented 7 years ago

I'm having this issue as well. Using Ubuntu now because I experienced the issue in Windows first and I decided to switch OS, but it doesn't fix it.

Kedakai commented 7 years ago

I've experienced this issue too. But if this happens, i summon the bot manually.

Scavar commented 7 years ago

I have this same exact error, it wasn't happening at first and I don't recall doing anything or changing anything and it started to happen. Waiting for it to happen again and I'll copy the error just in case it's different or has more information. Also, doing the summon command doesn't work for me like it does for Kedakai.

KingGold171 commented 7 years ago

AutoSummon only works for forcing the bot to join its owner (if in a voice channel on bot startup)

As for your TimeourError that can be caused by your internet connection, and you you have already started a restart tends to solve it (untill next time)

I believe the review branch does improve this but is still susectable to similer issues.

Please note use of the Review Banch is at your own risk - as it - and with little to no help offered.

Scavar commented 7 years ago

As you can see I got mine repeating a few times. If it's somehow tied to my internet connection and not on the bots end I have zero idea what to do about that. I do not have any other sort of connection issue and I run a couple of other bots and a few servers that none have shown any similar issues or any sort of connection issue. As for Musicbot itself, it stays in the discord servers it's only that it disconnects from voice and will not reconnect to voice without restarting the bot, as even doing a summon command does not resolve it. I might just have to not use the autoplay function and allow my users to call him in whenever they want instead.


Task exception was never retrieved
future: <Task finished coro=<VoiceClient.poll_voice_ws() done, defined at C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py:265> exception=ConnectionClosed('WebSocket connection is closed: code = 1006, no reason.',)>
Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\gateway.py", line 604, in poll_event
    msg = yield from asyncio.wait_for(self.recv(), timeout=30.0, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 392, in wait_for
    return fut.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 298, in recv
    raise ConnectionClosed(self.close_code, self.close_reason)
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py", line 272, in poll_voice_ws
    yield from self.ws.poll_event()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\gateway.py", line 607, in poll_event
    raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.
[Debug] Voice websocket is CLOSED, reconnecting
Error disconnecting during reconnect
Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 302, in reconnect_voice_client
    await vc.disconnect()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py", line 293, in disconnect
    yield from self.ws.close()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 241, in close
    self.worker_task, self.timeout, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 392, in wait_for
    return fut.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 413, in run
    msg = yield from self.read_message()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 435, in read_message
    frame = yield from self.read_data_frame(max_size=self.max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 490, in read_data_frame
    frame = yield from self.read_frame(max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 525, in read_frame
    self.reader.readexactly, is_masked, max_size=max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\framing.py", line 80, in read_frame
    data = yield from reader(2)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 670, in readexactly
    block = yield from self.read(n)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 627, in read
    yield from self._wait_for_data('read')
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 457, in _wait_for_data
    yield from self._waiter
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 296, in _wakeup
    future.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\selector_events.py", line 669, in _read_ready
    data = self._sock.recv(self.max_size)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Task exception was never retrieved
future: <Task finished coro=<VoiceClient.poll_voice_ws() done, defined at C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py:265> exception=ConnectionClosed('WebSocket connection is closed: code = 1006, no reason.',)>
Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\gateway.py", line 604, in poll_event
    msg = yield from asyncio.wait_for(self.recv(), timeout=30.0, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 392, in wait_for
    return fut.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 298, in recv
    raise ConnectionClosed(self.close_code, self.close_reason)
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py", line 272, in poll_voice_ws
    yield from self.ws.poll_event()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\gateway.py", line 607, in poll_event
    raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.
[Debug] Voice websocket is CLOSED, reconnecting
Error disconnecting during reconnect
Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 302, in reconnect_voice_client
    await vc.disconnect()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py", line 293, in disconnect
    yield from self.ws.close()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 241, in close
    self.worker_task, self.timeout, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 392, in wait_for
    return fut.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 413, in run
    msg = yield from self.read_message()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 435, in read_message
    frame = yield from self.read_data_frame(max_size=self.max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 490, in read_data_frame
    frame = yield from self.read_frame(max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 525, in read_frame
    self.reader.readexactly, is_masked, max_size=max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\framing.py", line 80, in read_frame
    data = yield from reader(2)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 670, in readexactly
    block = yield from self.read(n)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 627, in read
    yield from self._wait_for_data('read')
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 457, in _wait_for_data
    yield from self._waiter
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 296, in _wakeup
    future.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\selector_events.py", line 669, in _read_ready
    data = self._sock.recv(self.max_size)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Task exception was never retrieved
future: <Task finished coro=<VoiceClient.poll_voice_ws() done, defined at C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py:265> exception=ConnectionClosed('WebSocket connection is closed: code = 1006, no reason.',)>
Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\gateway.py", line 604, in poll_event
    msg = yield from asyncio.wait_for(self.recv(), timeout=30.0, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 392, in wait_for
    return fut.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 298, in recv
    raise ConnectionClosed(self.close_code, self.close_reason)
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py", line 272, in poll_voice_ws
    yield from self.ws.poll_event()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\gateway.py", line 607, in poll_event
    raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 1006, no reason.
[Debug] Voice websocket is CLOSED, reconnecting
Error disconnecting during reconnect
Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 302, in reconnect_voice_client
    await vc.disconnect()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\voice_client.py", line 293, in disconnect
    yield from self.ws.close()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 241, in close
    self.worker_task, self.timeout, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 392, in wait_for
    return fut.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 241, in _step
    result = coro.throw(exc)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 413, in run
    msg = yield from self.read_message()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 435, in read_message
    frame = yield from self.read_data_frame(max_size=self.max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 490, in read_data_frame
    frame = yield from self.read_frame(max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\protocol.py", line 525, in read_frame
    self.reader.readexactly, is_masked, max_size=max_size)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\site-packages\websockets\framing.py", line 80, in read_frame
    data = yield from reader(2)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 670, in readexactly
    block = yield from self.read(n)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 627, in read
    yield from self._wait_for_data('read')
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\streams.py", line 457, in _wait_for_data
    yield from self._waiter
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 296, in _wakeup
    future.result()
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\selector_events.py", line 669, in _read_ready
    data = self._sock.recv(self.max_size)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
Task exception was never retrieved
future: <Task finished coro=<MusicPlayer.websocket_check() done, defined at C:\Users\scava\MusicBot\musicbot\player.py:280> exception=TimeoutError()>
Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 291, in websocket_check
    await self.bot.reconnect_voice_client(self.voice_client.channel.server)
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 310, in reconnect_voice_client
    new_vc = await self.get_voice_client(vc.channel)
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 238, in get_voice_client
    voice_data = await asyncio.wait_for(_voice_data, timeout=10, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 396, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
Task exception was never retrieved
future: <Task finished coro=<MusicPlayer.websocket_check() done, defined at C:\Users\scava\MusicBot\musicbot\player.py:280> exception=TimeoutError()>
Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 291, in websocket_check
    await self.bot.reconnect_voice_client(self.voice_client.channel.server)
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 310, in reconnect_voice_client
    new_vc = await self.get_voice_client(vc.channel)
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 238, in get_voice_client
    voice_data = await asyncio.wait_for(_voice_data, timeout=10, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 396, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
Task exception was never retrieved
future: <Task finished coro=<MusicPlayer.websocket_check() done, defined at C:\Users\scava\MusicBot\musicbot\player.py:280> exception=TimeoutError()>
Traceback (most recent call last):
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 287, in websocket_check
    assert self.voice_client.ws.open
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "C:\Users\scava\MusicBot\musicbot\player.py", line 291, in websocket_check
    await self.bot.reconnect_voice_client(self.voice_client.channel.server)
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 310, in reconnect_voice_client
    new_vc = await self.get_voice_client(vc.channel)
  File "C:\Users\scava\MusicBot\musicbot\bot.py", line 238, in get_voice_client
    voice_data = await asyncio.wait_for(_voice_data, timeout=10, loop=self.loop)
  File "C:\Users\scava\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py", line 396, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
ghost commented 7 years ago

@KingGold171 The recent commits on the review branch are not named very descriptively, do you happen to know which commit(s) tries to fix this issue?

ghost commented 7 years ago

Summoning the bot doesn't work when this happens. I have to restart the bot for it to return to the channel.

Scavar commented 7 years ago

@MegaNarwhal Yes, the exact same thing occurs to me. I have unlimited bandwidth so I am currently attempting to have autoplaylist on without autopause, to see if while it is playing music nonstop it won't drop out of voice.

Scavar commented 7 years ago

Seems like even with autoplay and not paused it still dies eventually, same exact error message.

ghost commented 7 years ago

When using the version from the review branch, I got this error:

future: <Task finished coro=<VoiceClient.poll_voice_ws() done, defined at /usr/lib/python3.5/site-packages/discord/voice_client.py:265> exception=ConnectionClosed('WebSocket connection is closed: code = 4015, reason = Voice server crashed..',)>
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/discord/gateway.py", line 614, in poll_event
    msg = yield from asyncio.wait_for(self.recv(), timeout=30.0, loop=self.loop)
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 392, in wait_for
    return fut.result()
  File "/usr/lib64/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/lib/python3.5/site-packages/websockets/protocol.py", line 298, in recv
    raise ConnectionClosed(self.close_code, self.close_reason)
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 4015, reason = Voice server crashed..

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/lib/python3.5/site-packages/discord/voice_client.py", line 272, in poll_voice_ws
    yield from self.ws.poll_event()
  File "/usr/lib/python3.5/site-packages/discord/gateway.py", line 617, in poll_event
    raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 4015, reason = Voice server crashed..

Like before, $summon didn't work and I had to use $restart.

jayktaylor commented 7 years ago

discord.errors.ConnectionClosed: WebSocket connection is closed: code = 4015, reason = Voice server crashed.. This is an issue on Discord's end.

ghost commented 7 years ago

@jaydenkieran I understand, but the bot should be able to reconnect automatically after being disconnected from its voice channel. At this point, it can't even be manually summoned after a disconnection despite saying that it is joining the proper voice channel in the logs.

roest01 commented 7 years ago

yeah the bot should restore himself if the connection drops. My bot is running in a docker container. Quite often in the morning i have to rebuild or restart the container because the bot crashed.

Task finished coro=<MusicPlayer.websocket_check() done, defined at /musicBot/musicbot/player.py:280> exception=TimeoutError()

31.7.2017 08:18:46 The above exception was the direct cause of the following exception:
31.7.2017 08:18:46
31.7.2017 08:18:46 Traceback (most recent call last):
31.7.2017 08:18:46  File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
31.7.2017 08:18:46    result = coro.send(None)
31.7.2017 08:18:46  File "/usr/local/lib/python3.5/dist-packages/discord/voice_client.py", line 272, in poll_voice_ws
31.7.2017 08:18:46    yield from self.ws.poll_event()
31.7.2017 08:18:46  File "/usr/local/lib/python3.5/dist-packages/discord/gateway.py", line 607, in poll_event
31.7.2017 08:18:46    raise ConnectionClosed(e) from e
31.7.2017 08:18:46 discord.errors.ConnectionClosed: WebSocket connection is closed: code = 4014, reason = Disconnected..

The bot's still running but not summon anymore:

31.7.2017 10:59:55[Command] [removedID]/roest ($summon)
31.7.2017 10:59:55 Will not join channel "lobby 🏠", no permission to speak.
31.7.2017 11:00:02[Command] [removedID]/roest ($summon)
31.7.2017 11:00:29[Command] [removedID]/roest ($summon)
31.7.2017 11:00:38[Command] [removedID]/roest ($summon)

is this repository still maintained ?

MedicOP commented 7 years ago

Any fix for this?

chuushi commented 7 years ago

It's still an ongoing issue. I've just resorted to keeping the bot in an auto-restart-on-crash loop and allowing users to try restarting or shutting down the bot to bring it back.

jayktaylor commented 6 years ago

Recent updates to the bot may have helped counter this. Make sure to update the bot and dependencies. If you still have issues, let us know.