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

Random silence and messages floods #57

Closed
butlerx opened this issue Nov 9, 2020 · 13 comments
Closed

Random silence and messages floods #57

butlerx opened this issue Nov 9, 2020 · 13 comments

Comments

@butlerx
Copy link
Contributor

butlerx commented Nov 9, 2020

Having run the bridge on a relatively active IRC and discord channel for over multiple weeks weve expereicned random silence where messages from dicord will appear in IRC but not the other way, then after 10 min or so messages will flood in random order into discord
On one occasion the messages have flooded to a second discord channel than the one they were sent in following a user sending a message in that channel from irc

@qaisjp
Copy link
Owner

qaisjp commented Nov 9, 2020

yeah I've been experiencing that too... as well as a few others

my theories

  1. discord has changed rate limiting to be less generous and this is affecting go-discord-irc, OR
  2. discord is having infrastructure issues

when was the last time you had the issue?

@butlerx
Copy link
Contributor Author

butlerx commented Nov 9, 2020

Ive had it multiple times today, 2 of which with messages to the wrong channel ( they have been having issues). Ill need to review some logs to see if i can see how often it occures prior too today.

We've a theory that its rate limit as one of our users managed to cause it by reacting 19 time to a discord message in a minute

@qaisjp
Copy link
Owner

qaisjp commented Nov 9, 2020

Ill need to review some logs to see if i can see how often it occures prior too today.

let me know how it goes. at some point i'll need to add some extra logging so that there's some output when the rate limit is hit. (at the moment all rate limiting is handled by the library, we don't do any rate limiting)

@butlerx
Copy link
Contributor Author

butlerx commented Nov 11, 2020

This occurred again today long hour gap in messages, no-log events to correspond to it as far as I can see, messages were sent to 3 channels that were talked in but the wrong channels received the wrong messages

@qaisjp
Copy link
Owner

qaisjp commented Nov 11, 2020

Next time it happens, can you go into Server Settings -> Integrations -> Webhooks and then click "New Webhook".

Does the "New Webhook" button popup with an "Internal Server Error" message?

If it does: get open the Developer Tools browser pane, hop to the Network tab, and click the "New Webhook" button. Inspect the request that failed. Does the response include some rate limit information? Yesterday I saw this

If it doesn't pop up with an "Internal Server Error" message, then maybe it's not a server-wide ratelimit. (I saw something like this yesterday)

@qaisjp
Copy link
Owner

qaisjp commented Nov 13, 2020

I have a random silence issue right now and can reproduce this. I think we should contact discord. I think they may have introduced some sort of maximum webhook edits per time period :(

image

Request headers

image

Request payload

{"name":"Captain Hook"}

Response body

{
  "code": 20029, 
  "global": false, 
  "message": "The write action you are performing on the server has hit the write rate limit.", 
  "retry_after": 699.464
}

@qaisjp
Copy link
Owner

qaisjp commented Nov 13, 2020

I've sent a support request with this message:

Hello,

I develop a bot that edits webhooks to point to different channels fairly frequently. This bot has been functioning fine for the past four years.

Recently we've noticed that new webhook creations or webhook edits are not functioning.

When these aren't working, I also see an "Internal Server Error" message when clicking on "New Webhook" on the regular server Integrations interface.

The network request suggests that there has been a new guild-wide rate limit introduced for the number of webhook updates that can be made.

Please can I be pointed to documentation on what these new rate limits are, and how I can work around the issue? Thanks!

More context is at #57

https://support.discord.com/hc/en-us/requests/9958995 (not that others will be able to visit this link)

@qaisjp
Copy link
Owner

qaisjp commented Nov 13, 2020

Sadly, the response was essentially:

We don't provide API support.

The rate limiting docs say to follow the headers. We won't tell you what the rate limits are.

Go ask in the discord-api Discord server.

image

@qaisjp
Copy link
Owner

qaisjp commented Nov 14, 2020

Tomorrow I will update the bot to create a webhook per channel. See 42wim/matterbridge#1255 (comment) for more information.

@Rapman4
Copy link

Rapman4 commented Nov 18, 2020

Hi always the same problem for me after a while it crashes because discord forbids us webhooks

@qaisjp
Copy link
Owner

qaisjp commented Nov 19, 2020

Sorry, been a bit busy with work. I started writing the update last weekend, I'll try and get this fixed this week.

42wim added a commit to 42wim/matterbridge that referenced this issue Nov 22, 2020
See #1255 and
qaisjp/go-discord-irc#57

Webhook edits gets ratelimited which cause other problems with
matterbridge. Disabling for now.
42wim added a commit to 42wim/matterbridge that referenced this issue Nov 22, 2020
See #1255 and
qaisjp/go-discord-irc#57

Webhook edits gets ratelimited which cause other problems with
matterbridge. Disabling for now.
42wim added a commit to 42wim/matterbridge that referenced this issue Nov 22, 2020
See #1255 and
qaisjp/go-discord-irc#57

Webhook edits gets ratelimited which cause other problems with
matterbridge. Disabling for now.
@qaisjp qaisjp closed this as completed in 469c58d Nov 22, 2020
@butlerx
Copy link
Contributor Author

butlerx commented Nov 23, 2020

I've deployed the fix to my server will report back if I've any issues

@qaisjp
Copy link
Owner

qaisjp commented Nov 23, 2020

thanks!

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

No branches or pull requests

3 participants