Can't restart/stop the server when EssentialsDiscord is rate limited
catinbetween opened this issue · 3 comments
Type of bug
Error in console, Other unexpected behaviour
/ess dump all
output
https://essentialsx.net/dump.html?id=605927e1e44949baa4200b3f8335dc3a
Error log (if applicable)
No response
Bug description
Is it normal that when the plugin is being rate limited via discord API, the server can't shut down properly?
I'm developing a plugin that is trying to hook onto the EssentialsDiscord and the EssentialsDiscordLink module, and probably due to a lot of restarts, i'm being discord rate limited. I am actually not sure why i'm being rate limited. I should be nowhere close to the API rate limits.
Anyway, when trying to restart the server, it gets stuck when trying to disable the EssentialsDiscord Plugin. The server basically crashes and the console instance has to be closed so that the server shuts down.
Not quite sure if this is relevant, but: Originally i started getting those errors after i had bug in my own plugin where i didn't disconnect the Discord API properly that plugin has its own Application and bot token. This is now fixed, but now this error persists after multiple restarts, even after i removed said plugin again.
Btw: using the latest dev builds because i need 1.20.1 to work.
Steps to reproduce
- start server
- EssentialsDiscord is being resource rate limited and can't register application commands
- stop or restart the server
Expected behaviour
Server shuts down / restarts
Actual behaviour
The Server gets stuck while trying to disable EssentialsX for a server shutdown.
> stop
[11:26:48 INFO]: Stopping the server
[11:26:48 INFO]: Stopping server
[11:26:48 INFO]: [net.essentialsx.discordlink.EssentialsDiscordLink] Disabling EssentialsDiscordLink v2.20.1-dev+36-e558e73
[11:26:48 INFO]: [EssentialsDiscord] Disabling EssentialsDiscord v2.20.1-dev+36-e558e73
[11:27:41 WARN]: [net.essentialsx.dep.net.dv8tion.jda.api.requests.RestRateLimiter] Encountered 429 on route PUT/applications/{application_id}/guilds/{guild_id}/commands with bucket a3b974ef6eb1c925dd4ceb42f4db26fd:guild_id=<guildID>Retry-After: 432000 ms Scope: shared```
when starting and stopping the server the discord channel set up as a console relay receives a lot of messages in a short time which is often interpreted by discord as spam.