You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked for similar issues on the Issue-tracker.
I have checked for PRs that might already address this issue.
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.
19:08:01.957 [JDA MainWS-ReadThread] ERROR n.d.j.i.requests.WebSocketClient -- Got an unexpected error. Please redirect the following message to the devs:
JDA 5.1.2_5f799f1
INTERACTION_CREATE -> {"entitlements":[],... (REDACTED)
java.lang.IllegalStateException: Failed to create channel instance for interaction! Channel Type: 0
at net.dv8tion.jda.internal.interactions.InteractionImpl.<init>(InteractionImpl.java:81)
at net.dv8tion.jda.internal.interactions.DeferrableInteractionImpl.<init>(DeferrableInteractionImpl.java:33)
at net.dv8tion.jda.internal.interactions.component.ComponentInteractionImpl.<init>(ComponentInteractionImpl.java:48)
at net.dv8tion.jda.internal.interactions.component.ButtonInteractionImpl.<init>(ButtonInteractionImpl.java:33)
at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleAction(InteractionCreateHandler.java:134)
at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:86)
at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39)
at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:1009)
at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:892)
at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:870)
at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1048)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
The text was updated successfully, but these errors were encountered:
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 net.dv8tion.jda.internal.requests package, so you can see if there's a point in which the channel was deleted, the general goal being to reconstitute what happened exactly
Sample logback.xml
This 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"?>
<configurationscan="true"> <!-- Reloads every minute -->
<timestampkey="bySecond"datePattern="yyyyMMdd'T'HHmmss"/>
<appendername="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>
<appendername="FILE"class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/latest.log</file>
<rollingPolicyclass="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 -->
<loggername="net.dv8tion.jda.internal.requests"level="trace"additivity="false">
<appender-refref="FILE"/>
</logger>
<!-- All the remaining loggers -->
<rootlevel="info">
<appender-refref="STDOUT"/>
</root>
</configuration>
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: