hypherionmc / sdlink

A simple to use Minecraft to Discord Chat linker with Whitelisting
MIT License
22 stars 7 forks source link

[BUG] Bot gets stuck in not-ready state #129

Open Zeklandia opened 5 days ago

Zeklandia commented 5 days ago

Occasionally, SDLink will stop relaying Discord messages to Minecraft, updating the bot's status, updating the channel topic, updating Discord server members' roles, and allowing Minecraft commands to be run from Discord. The only indication of an issue is this console message:

[22:03:34] [pool-4-thread-21/WARN]: Tried to relay discord message before bot is ready. Aborting

When this happens, messages from Minecraft are still relayed to Discord, including special message categories, and access control still functions to block access based on Discord roles.

The only thing that resolves this is to reboot the server. It happens frequently enough that this is impractical. In addition to getting more info about the bot's interactions with Discord logged to the console (I tried debugging = true but nothing more was logged), it would be helpful if the bot could be restarted separately from the server.

hypherionmc commented 5 days ago

it would be helpful if the bot could be restarted separately from the server.

reloadbot command in minecraft

As for the actual error, that occurs when the bot disconnects from discord, or the channel is somehow magically unloaded from the cache. The discord disconnect error should always be logged, regardless of the debugging setting.

When this occurs again, can you please send me a copy of your server log so that I can look over it

Zeklandia commented 5 days ago

The 'Discord disconnect' error message only appears once in all the logs from my server, from around the time I was configuring the bot and the Discord server we use, so it is probably unrelated to this issue. Importantly, there is nothing about an issue with Discord since the last time the bot reported Successfully connected to discord.

I wasn't aware of reloadbot (or reloadcache), as it is only mentioned in the changelogs on the docs site (the %color%/%end_color% tags used in mcPrefix are another thing I've found only through the changelogs).

I have disabled the console relay in case sudden surges of log entries are causing this issue. I will report back if the issue happens again.

Zeklandia commented 5 days ago

While the relays are working now, I still can't get the ability to run Minecraft commands in Discord to work again. No idea if that's related. My config for it is almost identical to the example in the documentation.

Zeklandia commented 5 days ago

It happened again on startup. Reloading it fixed it. latest.log

hypherionmc commented 5 days ago

It happened again on startup. Reloading it fixed it. latest.log

Hmmmm. This message is missing from the first startup, meaning for some reason the bot didn't fully connect 08:28:30] [pool-16-thread-2/INFO]: Successfully connected to discord. I'll see if I can replicate this. I might have an idea of why this happens.

I wasn't aware of reloadbot (or reloadcache), as it is only mentioned in the changelogs on the docs site (the %color%/%end_color% tags used in mcPrefix are another thing I've found only through the changelogs).

Yeah, we still need to add all this to the docs, including all the commands and luckperm stuff. Been slacking a bit on keeping the documentation up to date. Not going to deny that 😓

Zeklandia commented 5 days ago

Good luck with the replication. Let me know if you want me to send anything else in. And don't sweat the docs. You've done a wonderful job with all these mods.