Discord.Net icon indicating copy to clipboard operation
Discord.Net copied to clipboard

[Bug]: Continous Spam of ANE in JSON serialization

Open nikita-petko opened this issue 5 months ago • 1 comments

Check The Docs

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

Verify Issue Source

  • [x] I verified the issue was caused by Discord.Net.

Check your intents

  • [x] I double checked that I have the required intents.

Description

I run a bot that is in 33k+ guilds, in recent months (from 22nd of April), I have been seeing a major increase in spam of a specific ArgumentNullException:

Image Here you can see that over the course of these months, I have received over 648 exceptions of this nature, with one peak day yielding over 96 identical exceptions.

Version

Current: 3.17.4, Former: 3.15.3 -> Update recently came but did not mitigate issue

Working Version

No response

Logs

v3.17.4:

[2025-05-13T04:48:43.8162Z][10.105.11.9][dev8][discord][ERROR] Source = Shard #5, Message = Serializer Error, Exception = System.ArgumentNullException: Value cannot be null. (Parameter 'target')
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target)
   at Discord.Net.Converters.MessageComponentConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Discord.Net.Converters.ArrayConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Discord.Net.Converters.OptionalConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)

3.15.3:

[2025-05-12T16:51:34.3214Z][10.113.6.7][jf8-dev23][discord][ERROR] Source = Shard #23, Message = Serializer Error, Exception = System.ArgumentNullException: Value cannot be null. (Parameter 'target')
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Populate(JsonReader reader, Object target)
   at Discord.Net.Converters.MessageComponentConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Discord.Net.Converters.ArrayConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Discord.Net.Converters.OptionalConverter`1.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)

Sample

This error is transient in nature, and I am unsure of how to force it to occur.

Packages

N/A

Environment

  • OS: Windows + Alpine Linux
  • Arch: x64
  • SDK: .NET SDK 8.0.303

nikita-petko avatar May 13 '25 10:05 nikita-petko