question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DAP eventually fails to reconnect

See original GitHub issue

Hello! I have a minor issue I’d like to report: after several hours left unattended, DAP can fail to stay connected to a voice channel. When this happens, selecting a different voice channel & back didn’t seem to work, or at least not fully: the bot account was in the channel, but audio didn’t go through until a full program restart.

Errors log:

Disconnected from voice... Reconnecting in 1.18s.
Traceback (most recent call last):
  File "discord\voice_client.py", line 383, in poll_voice_ws
  File "discord\gateway.py", line 889, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1006
Attempting a reconnect in 0.61s
Traceback (most recent call last):
  File "discord\client.py", line 551, in connect
  File "discord\gateway.py", line 578, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1000
Attempting a reconnect in 1.14s
Traceback (most recent call last):
  File "discord\client.py", line 551, in connect
  File "discord\gateway.py", line 578, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1000
Attempting a reconnect in 0.87s
Traceback (most recent call last):
  File "discord\client.py", line 551, in connect
  File "discord\gateway.py", line 578, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1000
Disconnected from voice... Reconnecting in 0.41s.
Traceback (most recent call last):
  File "discord\voice_client.py", line 383, in poll_voice_ws
  File "discord\gateway.py", line 889, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 1001

I believe part of this failure to auto-reconnect may be witnessed by manually changing a server’s voice region while connected; the “jump” in sessions can then result in these slightly different errors:

Disconnected from voice... Reconnecting in 1.27s.
Traceback (most recent call last):
  File "discord\voice_client.py", line 383, in poll_voice_ws
  File "discord\gateway.py", line 889, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4000
Exception in voice thread Thread-20
Traceback (most recent call last):
  File "discord\player.py", line 598, in run
  File "discord\player.py", line 591, in _do_run
  File "discord\voice_client.py", line 598, in send_audio_packet
TypeError: str, bytes or bytearray expected, not NoneType
Disconnected from voice... Reconnecting in 1.77s.
Traceback (most recent call last):
  File "discord\voice_client.py", line 383, in poll_voice_ws
  File "discord\gateway.py", line 889, in poll_event
discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4000

In this specific case, selecting a different voice channel & back worked.

Again, this probably isn’t a very important issue as I reckon this program is mainly aimed at active usage, but if you wanted to look into improving its long-term resiliency, I’d be happy to help try out fixes or improvements.

Cheers! (and by the way, the new UI looks great 😃)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
QiCuiHubcommented, Oct 8, 2020

The 2.0 exe should have timestamps for errors now. For verbose logging, you’ll have to launch the program from CMD or PowerShell with .\dap.exe --verbose, and it will create a discord.log in the same dir.

0reactions
Amerisuncommented, Feb 16, 2021

I had the same problem this past weekend when running a game, you can see attached all the exceptions that happened. It kept disconnecting quite often, but my internet service provider really sucks so they drop packets now and again. So if this is a persistent connection type thing, might need to write a catch around this and just reconnect automatically because people with bad internet (or using this during peak times on their cable modems when the rest of the neighborhood is using up all the bandwidth) will have the same issues.

https://pastebin.com/HqVhSbhd

Might be only way to test this out, is to disconnect your development machine from the internet while being connected, then connect it up again a few seconds later… since that’s what happens to me, my ISP drops the internet every now and then for just like 3 pings. I keep a dos window open with ping -t google.com and I will drop at least 3 packets every 5 minutes or 10 minutes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DAP error while reading DP-Ctrl-Stat register on MbientLab ...
I'm trying to connect to an MbientLab MetaMotionR device (actually a Nordic nRF52382) with SWD to flash and eventually for RTT.
Read more >
DLink 2590 radio reset
Clients eventually reconnect (usually must be told to disconnect and then reconnect) and then things seem normal for a while -- at least...
Read more >
Error on Unable to access the DAP on CCSv6 - TI E2E
I am programming my CC2650 custom made board. I have a connector to connect the other custom board to my main CC2650 board....
Read more >
AnyConnect connection attempt has failed - Cisco Community
Solved: Hi all, I'm very new in AnyConnect and I'm doing something wrong. If I navigate to https://myIP I can successfully log into...
Read more >
D-Link Wifi Extender N300 Range Wall Signal Booster ...
D-Link - Access Point Repeater D-Link DAP-1325 N300 ... this unit just stopped working and unable to reconnect to my router, after only...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found