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.

Socket Error & Weird Issue

See original GitHub issue

Good day,

So lately i’ve been having a bizarre error. Basically when the bot is already started and i try to invite it on a new server no commands work on it. On the other side if the bot was already present when i started the code then everything works. The only solution i found was restarting the bot so everything starts working again.

Digging around with the debug i found the following:

[2022-04-14 02:33:55 +03:00] [108 /WebSocketRec] [Error] Socket handler suppressed an exception
System.InvalidOperationException: Nullable object must have a value.
   at System.Nullable`1.get_Value()
   at DSharpPlus.DiscordClient.UpdateUser(DiscordUser usr, Nullable`1 guildId, DiscordGuild guild, TransportMember mbr)
   at DSharpPlus.DiscordClient.UpdateMessage(DiscordMessage message, TransportUser author, DiscordGuild guild, TransportMember member)
   at DSharpPlus.DiscordClient.PopulateMessageReactionsAndCache(DiscordMessage message, TransportUser author, TransportMember member)
   at DSharpPlus.DiscordClient.OnMessageCreateEventAsync(DiscordMessage message, TransportUser author, TransportMember member, TransportUser referenceAuthor, TransportMember referenceMember)
   at DSharpPlus.DiscordClient.HandleDispatchAsync(GatewayPayload payload)
   at DSharpPlus.DiscordClient.HandleSocketMessageAsync(String data)
   at DSharpPlus.DiscordClient.<InternalConnectAsync>g__SocketOnMessage|391_1(IWebSocketClient sender, SocketMessageEventArgs e)

Since this is a very big issue i think its sort of urgent. I use Windows 10, Visual Studio 2019 with .NET 5.0. My NUGET packages are all updated except for entity framework core and entity framework core design which give an error when updating (i guess because they need .NET 6.0). Otherwise everything is updated. To be noted that this error is somewhat new, 3/4 weeks more or less, because before that it was working and no modifications were applied to the bot’s settings or similar before and after it started to show these errors. Any help is welcome thank you very much!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Liviu50commented, Apr 14, 2022

Understandable, i will take note of that thank you. i heard discord was breaking stuff yeah but i did not expect it to go so much against a wall.

1reaction
Liviu50commented, Apr 14, 2022

Thank you for the extremely fast help and assistance! I am just glad i fixed the problem and now i know to use the nightly ones, i did not know that i had to use those…so i kept to the stable ones. Thank you once again for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strange socket problems
After this error occurs the server goes dead and no new clients can connect until I physically quit the server program and start...
Read more >
Odd Message
The socket error often indicates the problem is on that computer, and it might need a reboot if you're getting other strange errors...
Read more >
Unknown Socket Error · Issue #4861 · carla-simulator/carla
I have a very weird issue going on with Carla. I am running a reinforcement learning agent with CARLA and after a certain...
Read more >
Weird socket bug, 'Error #2031: Socket Error'
I'm putting together an application which opens a connection to a server, sends a chunk of binary data and then closes the connection....
Read more >
Unknown socket error : r/dotnet
First thing that comes to mind: improper use of HttpClient. Don't new them up, don't dispose them.
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