Discordchatexporter: Object must implement IConvertible

Created on 27 May 2019  路  8Comments  路  Source: Tyrrrz/DiscordChatExporter

I get this when I'm trying to export on the latest DiscordChatExporter. v2.11 works fine, and I haven't tried v2.12 (want me to try that?)

System.InvalidCastException: Object must implement IConvertible. at System.Convert.ChangeType (System.Object value, System.Type conversionType, System.IFormatProvider provider) [0x00040] in <547b0ab402754bd3aef2dcb174312979>:0 at Newtonsoft.Json.Linq.Extensions.Convert[T,U] (T token) [0x000f7] in <836484b0267d488c8d30f28b57efebd9>:0 at Newtonsoft.Json.Linq.Extensions.Value[T,U] (System.Collections.Generic.IEnumerable`1[T] value) [0x0000b] in <836484b0267d488c8d30f28b57efebd9>:0 at Newtonsoft.Json.Linq.Extensions.Value[U] (System.Collections.Generic.IEnumerable`1[T] value) [0x00000] in <836484b0267d488c8d30f28b57efebd9>:0 at DiscordChatExporter.Core.Services.DataService.ParseMessage (Newtonsoft.Json.Linq.JToken json) [0x0005e] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at System.Linq.Enumerable+SelectIListIterator`2[TSource,TResult].ToArray () [0x00034] in <b60891ff58b84768b0eb02623fa7037e>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <b60891ff58b84768b0eb02623fa7037e>:0 at System.Linq.Enumerable+ReverseIterator`1[TSource].ToArray () [0x00000] in <b60891ff58b84768b0eb02623fa7037e>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <b60891ff58b84768b0eb02623fa7037e>:0 at DiscordChatExporter.Core.Services.DataService.GetChannelMessagesAsync (DiscordChatExporter.Core.Models.AuthToken token, System.String channelId, System.Nullable`1[T] after, System.Nullable`1[T] before, System.IProgress`1[T] progress) [0x00242] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at DiscordChatExporter.Core.Services.DataService.GetChatLogAsync (DiscordChatExporter.Core.Models.AuthToken token, DiscordChatExporter.Core.Models.Guild guild, DiscordChatExporter.Core.Models.Channel channel, System.Nullable`1[T] after, System.Nullable`1[T] before, System.IProgress`1[T] progress) [0x00092] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at DiscordChatExporter.Core.Services.DataService.GetChatLogAsync (DiscordChatExporter.Core.Models.AuthToken token, DiscordChatExporter.Core.Models.Channel channel, System.Nullable`1[T] after, System.Nullable`1[T] before, System.IProgress`1[T] progress) [0x00124] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at DiscordChatExporter.Cli.Verbs.ExportGuildVerb.ExecuteAsync () [0x0026d] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 at DiscordChatExporter.Cli.Verbs.Verb`1[TOptions].Execute () [0x0000c] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 at DiscordChatExporter.Cli.Program+<>c.<Main>b__1_2 (DiscordChatExporter.Cli.Verbs.Options.ExportGuildOptions o) [0x00006] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 at CommandLine.ParserResultExtensions.WithParsed[T] (CommandLine.ParserResult`1[T] result, System.Action`1[T] action) [0x0001e] in <5f6458f0234f43a48c09047109c24684>:0 at DiscordChatExporter.Cli.Program.Main (System.String[] args) [0x000be] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Object must implement IConvertible. at System.Convert.ChangeType (System.Object value, System.Type conversionType, System.IFormatProvider provider) [0x00040] in <547b0ab402754bd3aef2dcb174312979>:0 at Newtonsoft.Json.Linq.Extensions.Convert[T,U] (T token) [0x000f7] in <836484b0267d488c8d30f28b57efebd9>:0 at Newtonsoft.Json.Linq.Extensions.Value[T,U] (System.Collections.Generic.IEnumerable`1[T] value) [0x0000b] in <836484b0267d488c8d30f28b57efebd9>:0 at Newtonsoft.Json.Linq.Extensions.Value[U] (System.Collections.Generic.IEnumerable`1[T] value) [0x00000] in <836484b0267d488c8d30f28b57efebd9>:0 at DiscordChatExporter.Core.Services.DataService.ParseMessage (Newtonsoft.Json.Linq.JToken json) [0x0005e] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at System.Linq.Enumerable+SelectIListIterator`2[TSource,TResult].ToArray () [0x00034] in <b60891ff58b84768b0eb02623fa7037e>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <b60891ff58b84768b0eb02623fa7037e>:0 at System.Linq.Enumerable+ReverseIterator`1[TSource].ToArray () [0x00000] in <b60891ff58b84768b0eb02623fa7037e>:0 at System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <b60891ff58b84768b0eb02623fa7037e>:0 at DiscordChatExporter.Core.Services.DataService.GetChannelMessagesAsync (DiscordChatExporter.Core.Models.AuthToken token, System.String channelId, System.Nullable`1[T] after, System.Nullable`1[T] before, System.IProgress`1[T] progress) [0x00242] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at DiscordChatExporter.Core.Services.DataService.GetChatLogAsync (DiscordChatExporter.Core.Models.AuthToken token, DiscordChatExporter.Core.Models.Guild guild, DiscordChatExporter.Core.Models.Channel channel, System.Nullable`1[T] after, System.Nullable`1[T] before, System.IProgress`1[T] progress) [0x00092] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at DiscordChatExporter.Core.Services.DataService.GetChatLogAsync (DiscordChatExporter.Core.Models.AuthToken token, DiscordChatExporter.Core.Models.Channel channel, System.Nullable`1[T] after, System.Nullable`1[T] before, System.IProgress`1[T] progress) [0x00124] in <1d93fd4dbfd44cd3acdeb1c16c4d5480>:0 at DiscordChatExporter.Cli.Verbs.ExportGuildVerb.ExecuteAsync () [0x0026d] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 at DiscordChatExporter.Cli.Verbs.Verb`1[TOptions].Execute () [0x0000c] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 at DiscordChatExporter.Cli.Program+<>c.<Main>b__1_2 (DiscordChatExporter.Cli.Verbs.Options.ExportGuildOptions o) [0x00006] in <6dfa2ba2126d46298313c8cf9214f6cc>:0 at CommandLine.ParserResultExtensions.WithParsed[T] (CommandLine.ParserResult`1[T] result, System.Action`1[T] action) [0x0001e] in <5f6458f0234f43a48c09047109c24684>:0 at DiscordChatExporter.Cli.Program.Main (System.String[] args) [0x000be] in <6dfa2ba2126d46298313c8cf9214f6cc>:0

bug cannot reproduce

Most helpful comment

To replicate I tried downloading 2 channels on a discord server. For the first channel the messages pops up early on, and on the 2nd channel, this error pops up when the bar is 3/4 through. Both channels have 100K+ messages.

Edit (I'm using the latest version): I downloaded the 2 channels with only messages in 2019 and they were successful. Both have about 60K messages each.

All 8 comments

Interesting. Please do try 2.12 to help me narrow down the issue. Are you sure it's actually version-specific and not just different channels or something?

Sorry, I kept forgetting about this.

It still happens on 2.12.

Same issue here

To replicate I tried downloading 2 channels on a discord server. For the first channel the messages pops up early on, and on the 2nd channel, this error pops up when the bar is 3/4 through. Both channels have 100K+ messages.

Edit (I'm using the latest version): I downloaded the 2 channels with only messages in 2019 and they were successful. Both have about 60K messages each.

I can't reproduce this, can any of you invite me to the guild where this happens?

I can't reproduce this, can any of you invite me to the guild where this happens?

https://discordapp.com/invite/h45wxnE try the channel #general

Looks like it breaks on this message, the content of which represents a valid JSON date.
image

I made a workaround but the underlying issue is the fact that JSON.net has a massive design oversight that the author doesn't see as such: https://github.com/JamesNK/Newtonsoft.Json/issues/862

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chibiusagi picture chibiusagi  路  4Comments

tyzoid picture tyzoid  路  3Comments

mdiller picture mdiller  路  3Comments

Yudi picture Yudi  路  3Comments

NerveCoordinator picture NerveCoordinator  路  3Comments