Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow auto reconnect causes commands to time out #2970

Open
3 tasks done
gepbird opened this issue Jul 27, 2024 · 0 comments
Open
3 tasks done

Slow auto reconnect causes commands to time out #2970

gepbird opened this issue Jul 27, 2024 · 0 comments
Labels

Comments

@gepbird
Copy link
Contributor

gepbird commented Jul 27, 2024

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

After leaving the bot running for a while, Discord.NET says it disconnected and is connecting, but it only connects after someone interacts with the bot. Since connecting takes a while, slash commands usually time out. Is there a way to keep the bot connected?

Version

3.15.3

Working Version

N/A

Logs

Jul 27 00:29:53 raspi-doboz moe[3641296]: [2024-07-27 00:29:53.696] [Info] [DNet] Connecting
Jul 27 00:29:54 raspi-doboz moe[3641296]: [2024-07-27 00:29:54.994] [Info] [DNet] Resumed previous session
Jul 27 00:29:54 raspi-doboz moe[3641296]: [2024-07-27 00:29:54.994] [Info] [DNet] Connected
Jul 27 01:34:33 raspi-doboz moe[3641296]: [2024-07-27 01:34:33.465] [Warning] [DNet]  Discord.WebSocket.GatewayReconnectException: Server requested a reconnect
Jul 27 01:34:33 raspi-doboz moe[3641296]:    at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
Jul 27 01:34:33 raspi-doboz moe[3641296]: [2024-07-27 01:34:33.466] [Info] [DNet] Disconnecting
Jul 27 01:34:33 raspi-doboz moe[3641296]: [2024-07-27 01:34:33.484] [Info] [DNet] Disconnected
Jul 27 01:34:34 raspi-doboz moe[3641296]: [2024-07-27 01:34:34.485] [Info] [DNet] Connecting
Jul 27 01:34:35 raspi-doboz moe[3641296]: [2024-07-27 01:34:35.554] [Info] [DNet] Resumed previous session
Jul 27 01:34:35 raspi-doboz moe[3641296]: [2024-07-27 01:34:35.554] [Info] [DNet] Connected
Jul 27 04:23:25 raspi-doboz moe[3641296]: [2024-07-27 04:23:25.911] [Warning] [DNet]  Discord.WebSocket.GatewayReconnectException: Server requested a reconnect
Jul 27 04:23:25 raspi-doboz moe[3641296]:    at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
Jul 27 04:23:25 raspi-doboz moe[3641296]: [2024-07-27 04:23:25.939] [Info] [DNet] Disconnecting
Jul 27 04:23:25 raspi-doboz moe[3641296]: [2024-07-27 04:23:25.943] [Info] [DNet] Disconnected
Jul 27 04:23:26 raspi-doboz moe[3641296]: [2024-07-27 04:23:26.944] [Info] [DNet] Connecting
Jul 27 04:23:28 raspi-doboz moe[3641296]: [2024-07-27 04:23:28.058] [Info] [DNet] Resumed previous session
Jul 27 04:23:28 raspi-doboz moe[3641296]: [2024-07-27 04:23:28.058] [Info] [DNet] Connected
Jul 27 06:48:22 raspi-doboz moe[3641296]: [2024-07-27 06:48:22.741] [Warning] [DNet]  Discord.WebSocket.GatewayReconnectException: Server requested a reconnect
Jul 27 06:48:22 raspi-doboz moe[3641296]:    at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
Jul 27 06:48:22 raspi-doboz moe[3641296]: [2024-07-27 06:48:22.742] [Info] [DNet] Disconnecting
Jul 27 06:48:22 raspi-doboz moe[3641296]: [2024-07-27 06:48:22.745] [Info] [DNet] Disconnected
Jul 27 06:48:23 raspi-doboz moe[3641296]: [2024-07-27 06:48:23.746] [Info] [DNet] Connecting
Jul 27 06:48:24 raspi-doboz moe[3641296]: [2024-07-27 06:48:24.796] [Info] [DNet] Resumed previous session
Jul 27 06:48:24 raspi-doboz moe[3641296]: [2024-07-27 06:48:24.796] [Info] [DNet] Connected
Jul 27 08:53:46 raspi-doboz moe[3641296]: [2024-07-27 08:53:45.999] [Warning] [DNet]  System.Net.WebSockets.WebSocketException (0x80004005): WebSocket connection was closed
Jul 27 08:53:46 raspi-doboz moe[3641296]:  ---> System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at System.Net.WebSockets.ManagedWebSocket.ThrowEOFUnexpected()
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken)
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory`1 payloadBuffer, CancellationToken cancellationToken)
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
Jul 27 08:53:46 raspi-doboz moe[3641296]: --- End of stack trace from previous location ---
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at Discord.Net.WebSockets.DefaultWebSocketClient.RunAsync(CancellationToken cancelToken)
Jul 27 08:53:46 raspi-doboz moe[3641296]:    at Discord.ConnectionManager.<>c__DisplayClass29_0.<<StartAsync>b__0>d.MoveNext()
Jul 27 08:53:46 raspi-doboz moe[3641296]: [2024-07-27 08:53:46.000] [Info] [DNet] Disconnecting
Jul 27 08:53:46 raspi-doboz moe[3641296]: [2024-07-27 08:53:46.001] [Info] [DNet] Disconnected
Jul 27 08:53:47 raspi-doboz moe[3641296]: [2024-07-27 08:53:47.000] [Info] [DNet] Connecting
Jul 27 08:53:48 raspi-doboz moe[3641296]: [2024-07-27 08:53:48.344] [Info] [DNet] Resumed previous session
Jul 27 08:53:48 raspi-doboz moe[3641296]: [2024-07-27 08:53:48.344] [Info] [DNet] Connected
Jul 27 10:14:47 raspi-doboz moe[3641296]: [2024-07-27 10:14:47.041] [Info] [Bár#36092] ymstnt executed slash command /levels
Jul 27 10:14:49 raspi-doboz moe[3641296]: [2024-07-27 10:14:49.953] [Warning] [DNet] A SlashCommandExecuted handler has thrown an unhandled exception. System.TimeoutException: Cannot respond to an interaction after 3 seconds!
Jul 27 10:14:49 raspi-doboz moe[3641296]:    at Discord.WebSocket.SocketCommandBase.RespondAsync(String text, Embed[] embeds, Boolean isTTS, Boolean ephemeral, AllowedMentions allowedMentions, MessageComponent components, Embed embed, RequestOptions options, PollProperties poll)
Jul 27 10:14:49 raspi-doboz moe[3641296]:    at Moe.Commands.LevelsCommand.Handle(SocketSlashCommand cmd) in /build/xmc8ydynq1gascql4lvcx9cmh53264c0-source/Commands/LevelsCommand.cs:line 33
Jul 27 10:14:49 raspi-doboz moe[3641296]:    at Program.<>c__DisplayClass0_1.<<<Main>$>b__1>d.MoveNext() in /build/xmc8ydynq1gascql4lvcx9cmh53264c0-source/Program.cs:line 110
Jul 27 10:14:49 raspi-doboz moe[3641296]: --- End of stack trace from previous location ---
Jul 27 10:14:49 raspi-doboz moe[3641296]:    at Discord.EventExtensions.InvokeAsync[T](AsyncEvent`1 eventHandler, T arg)
Jul 27 10:14:49 raspi-doboz moe[3641296]:    at Discord.WebSocket.DiscordSocketClient.TimeoutWrap(String name, Func`1 action)
Jul 27 10:14:52 raspi-doboz moe[3641296]: [2024-07-27 10:14:52.581] [Info] [Bár#36092] ymstnt executed slash command /levels
Jul 27 10:14:55 raspi-doboz moe[3641296]: [2024-07-27 10:14:55.526] [Warning] [DNet] A SlashCommandExecuted handler is blocking the gateway task.

Sample

Hello world slash command

Packages

No other Discord.NET packages.

Environment

  • OS: NixOS on a Raspberry Pi 4
  • Architecture: aarch64
  • .NET SDK: 8
@gepbird gepbird added the bug label Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant