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

Rate limit unmarchal error #659

kubastick opened this issue Jun 10, 2019 · 5 comments

Rate limit unmarchal error #659

kubastick opened this issue Jun 10, 2019 · 5 comments


Copy link

@kubastick kubastick commented Jun 10, 2019

After few weeks of running our bots without issues, we encountered this issue which caused us to be rate-limited by cloudflare:

[DG0] restapi.go:149:RequestWithLockedBucket() rate limit unmarchal error, invalid character '<' looking for beginning of value
Copy link

@bwmarrin bwmarrin commented Jul 30, 2019

@kubastick have you gotten more of these?

From that bit of error information, it looks like somehow you got malformed json which could be a discord bug, cloudflare bug, a network issue, etc..

Just wondering if this is a consistently reoccurring issue or a one off glitch?

Copy link

@ErikMcClure ErikMcClure commented Aug 18, 2019

This has just started happening to me. Even worse, it only seems to happen when I run it off of my main server, it doesn't happen when i run it off my desktop, which means it's likely some sort of cloudflare bug that's happening on a per-ip basis.

I was trying to extract the exact value being passed to the response (since a < looked suspiciously like an HTML page being served by a broken cloudflare endpoint) but the issue vanished right after I recompiled with additional debugging enabled. If I catch the issue again I will try to dump the exact HTML being returned, but this seems like it could be a recurring bug either by discord or cloudflare.

Copy link

@riking riking commented Nov 17, 2019

FYI, I'm carrying a patch to treat these as a 2500ms ratelimit delay.

Copy link

@mistahj67 mistahj67 commented Nov 21, 2019

@bwmarrin I started seeing these once I hit global rate limits. Prior to them I did not see any issues.

Copy link

@ErikMcClure ErikMcClure commented Mar 9, 2020

Whenever cloudflare blows up, discordgo starts getting HTML responses from cloudflare for all requests, which looks like this:

Failed to send message:  HTTP 400 Bad Request, <html>
<head><title>400 Bad Request</title></head>
<center><h1>400 Bad Request</h1></center>

This means every single part of the API starts returning invalid JSON and blows up all sorts of stuff. This is where the bug mentioned here comes from, and can be the cause of any related bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

5 participants