Skip to content

Voice connections fail with close code 4017: DAVE E2EE protocol required #1718

@cpike5

Description

@cpike5

Summary

As of March 2-3, 2026, Discord began enforcing the DAVE protocol (Discord Audio/Video End-to-End Encryption) for all non-stage voice calls. The bot can no longer join voice channels — Discord's voice gateway rejects the WebSocket connection with close code 4017.

Symptoms

  • Bot briefly appears to join the voice channel on the Discord client side, then disconnects moments later
  • All voice features are broken: soundboard, TTS, VOX
  • The dashboard shows join attempts timing out

Error Logs

[Discord.NET] Connecting
[Discord.NET] null
System.Net.WebSockets.WebSocketException (0x80004005): WebSocket connection was closed
 ---> Discord.Net.WebSocketClosedException: The server sent close 4017: "E2EE/DAVE protocol required"
   at Discord.Net.WebSockets.DefaultWebSocketClient.RunAsync(CancellationToken cancelToken)
   at Discord.Audio.AudioClient.OnConnectingAsync()
   ...
[Discord.NET] Disconnecting
[Discord.NET] Disconnected

Error joining voice channel {channelId} in guild {guildId}
System.TimeoutException: The operation has timed out.
   at Discord.WebSocket.SocketGuild.ConnectAudioAsync(...)
   at DiscordBot.Bot.Services.AudioService.JoinChannelAsync(...) in AudioService.cs:line 96

Root Cause

  • Discord enforcement: Discord now requires all voice clients to implement the DAVE protocol (E2EE for audio/video). Connections without DAVE support are rejected with close code 4017. See Discord's announcement.
  • Current version: The bot uses Discord.Net 3.19.0-beta.1, which does not include libdave/DAVE support.
  • Fix available: Discord.Net 3.19.0 (stable, released 2026-03-03) adds libdave support (PR #3241).

Affected Components

  • AudioService.JoinChannelAsync() — voice connection establishment
  • PlaybackService — all audio playback (soundboard, TTS, VOX)
  • AudioController — REST API endpoints for voice operations
  • VoiceAutoLeaveService — cannot function without active connections
  • Docker image — may need updated native libraries for libdave

Fix

  1. Update Discord.Net from 3.19.0-beta.13.19.0 in DiscordBot.Bot.csproj
  2. Verify libdave native dependencies are available in the Docker runtime image (may need additional system packages)
  3. Check if any API changes in the stable release require code updates
  4. Rebuild and redeploy the Docker image

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions