Tyrrrz / DiscordChatExporter

Exports Discord chat logs to a file
MIT License
7.48k stars 682 forks source link

400 Bad Request #1141

Closed goodbyepavlyi closed 11 months ago

goodbyepavlyi commented 11 months ago

Version

2.41.2

Flavor

CLI (Command-Line Interface)

Platform

Docker / Pop!_OS

Export format

JSON

Steps to reproduce

Image is: https://hub.docker.com/layers/tyrrrz/discordchatexporter/latest/images/sha256-761cf7902ad59c4309ffff2325e99f7cac834df5f1a625a47a726def616a4e74?context=explore Run this command docker run -v ".:/out" -it docker.io/tyrrrz/discordchatexporter:latest exportdm -t "DISCORD_TOKEN" -f "Json" --media True --reuse-media --fuck-russia

Details

The log is:

Fetching channels...
Exporting 38 channel(s)...

redacted ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  23%

ERROR
DiscordChatExporter.Core.Exceptions.DiscordChatExporterException: Request to 'channels/userid/messages?limit=100&after=852298373754781706' failed: bad request.
Response content: <html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>

  at DiscordChatExporter.Core.Discord.DiscordClient.GetJsonResponseAsync(String url, CancellationToken cancellationToken) in /build/DiscordChatExporter.Core/Discord/DiscordClient.cs:168
  at DiscordChatExporter.Core.Discord.DiscordClient.GetMessagesAsync(Snowflake channelId, Nullable`1 after, Nullable`1 before, IProgress`1 progress, CancellationToken cancellationToken)+MoveNext() in /build/DiscordChatExporter.Core/Discord/DiscordClient.cs:652
  at DiscordChatExporter.Core.Discord.DiscordClient.GetMessagesAsync(Snowflake channelId, Nullable`1 after, Nullable`1 before, IProgress`1 progress, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() 
  at DiscordChatExporter.Core.Exporting.ChannelExporter.ExportChannelAsync(ExportRequest request, IProgress`1 progress, CancellationToken cancellationToken) in /build/DiscordChatExporter.Core/Exporting/ChannelExporter.cs:82
  at DiscordChatExporter.Core.Exporting.ChannelExporter.ExportChannelAsync(ExportRequest request, IProgress`1 progress, CancellationToken cancellationToken) in /build/DiscordChatExporter.Core/Exporting/ChannelExporter.cs:82
  at DiscordChatExporter.Core.Exporting.ChannelExporter.ExportChannelAsync(ExportRequest request, IProgress`1 progress, CancellationToken cancellationToken) in /build/DiscordChatExporter.Core/Exporting/ChannelExporter.cs:82
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.<>c__DisplayClass63_2.<<ExportAsync>b__2>d.MoveNext() in /build/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs:228
  at DiscordChatExporter.Cli.Utils.Extensions.ConsoleExtensions.StartTaskAsync(ProgressContext context, String description, Func`2 performOperationAsync) in /build/DiscordChatExporter.Cli/Utils/Extensions/ConsoleExtensions.cs:54
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.<>c__DisplayClass63_1.<<ExportAsync>b__1>d.MoveNext() in /build/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs:202
  at System.Threading.Tasks.Parallel.<>c__50`1.<<ForEachAsync>b__50_0>d.MoveNext() 
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.<>c__DisplayClass63_0.<<ExportAsync>b__0>d.MoveNext() in /build/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs:191
  at Spectre.Console.Progress.<>c__DisplayClass27_0.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:98
  at Spectre.Console.Progress.<>c__DisplayClass28_0`1.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:133
  at Spectre.Console.Internal.DefaultExclusivityMode.RunAsync[T](Func`1 func) in /_/src/Spectre.Console/Internal/DefaultExclusivityMode.cs:40
  at Spectre.Console.Progress.StartAsync[T](Func`2 action) in /_/src/Spectre.Console/Live/Progress/Progress.cs:116
  at Spectre.Console.Progress.StartAsync(Func`2 action) in /_/src/Spectre.Console/Live/Progress/Progress.cs:96
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.ExportAsync(IConsole console, IReadOnlyList`1 channels) in /build/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs:181
  at DiscordChatExporter.Cli.Commands.ExportDirectMessagesCommand.ExecuteAsync(IConsole console) in /build/DiscordChatExporter.Cli/Commands/ExportDirectMessagesCommand.cs:25
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in /_/CliFx/CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

Checklist

Tyrrrz commented 11 months ago

That's the first time I'm seeing this error, but looks like a potential issue with Cloudflare on Discord's end maybe? Something similar happened a week ago.

goodbyepavlyi commented 11 months ago

I would think so that it's problem from Discord too but the weird thing is when I tried to run the GUI version on Windows 10 then there were no issues so my guess would be that the GUI either ignores the error or doesn't seem to run into it? If you would like to I could try to provide some more logs.

Tyrrrz commented 11 months ago

It can't ignore the error because it needs the data returned by that request. Also GUI and CLI share the same codebase, so they work virtually the same.

It seems there were intermittent outages on Discord yesterday so it's highly likely this was related: https://www.reddit.com/r/discordapp/comments/175kdzg/well_damn/