-
-
Notifications
You must be signed in to change notification settings - Fork 737
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
Button interactions randomly failing after some time #2756
Comments
I assume this is due to the interaction channel not being in the cache If you have a way of checking after the error, try to inspect the channel cache, see which channels may be missing, also try another channel Enable trace logs for the Sample logback.xmlThis config below will save the package's logs to a file, other logs will remain in the console <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true"> <!-- Reloads every minute -->
<timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} %boldCyan(%-26.-26thread) %boldYellow(%-20.-20logger{0}) %highlight(%-6level) %msg%n%throwable</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/latest.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>logs/logs-%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- keep 90 days worth of history capped at 3GB total size -->
<maxHistory>90</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{HH:mm:ss.SSS} %-26.-26thread %-20.-20logger{0} %-6level %msg%n%throwable</pattern>
</encoder>
</appender>
<!-- JDA -->
<logger name="net.dv8tion.jda.internal.requests" level="trace" additivity="false">
<appender-ref ref="FILE"/>
</logger>
<!-- All the remaining loggers -->
<root level="info">
<appender-ref ref="STDOUT"/>
</root>
</configuration> |
I've changed the logging in October, updated to JDA 5.2.1 in the meantime and it happened multiple times, last incident being today, with no clear reason in the logs. Channel was created (id 1315832097482477640) today at 00:06 UTC and renamed directly afterwards:
Permissions were set, channel was renamed, button interaction inside the channel was created, audit log entries were created/received, all fine so far.
And the exact same log message repeats from that point onward every time someone is posting a message inside that channel. So to me it looks like the channel was never cached to begin with for some reason. Interactions with that channel still failed exactly as stated in the initial bug report, at least until a bot restart. This still happens completely randomly, with only a few channels affected every month. The channels are created like this: (all actions like creation, rename, permission changes etc. are done with .complete())
It uses channel.getId() successfully there and renames the channel, not sure if that hits the cache or works differently. |
Are there any more logs for that guild? Are there any logs about reconnecting? |
The logs get deleted frequently due to very limited disk space. This was the first time I got a full log of this happening. Anything specific I should look for? There was a reconnect at 01:24, so much later and nowhere near the time around channel creation.
|
General Troubleshooting
Version of JDA
5.1.2
Expected Behaviour
Sometimes button interactions randomly start failing and won't work anymore until a full bot restart. This happens seemingly randomly, sometimes after a few hours, sometimes after a few days of the bot running without a restart.
The interactions sometimes only fail in some channels. Sometimes they start failing in all.
Nothings happens, no event is fired, just the error is logged: java.lang.IllegalStateException: Failed to create channel instance for interaction! Channel Type: 0
I've pasted the full stack trace below, with some details such as the exact channel data removed.
After restarting the bot, the same interactions suddenly all work again.
Code Example for Reproduction Steps
Code for JDABuilder or DefaultShardManagerBuilder used
Exception or Error
The text was updated successfully, but these errors were encountered: