Closed freya022 closed 2 months ago
The latest master commit added a new trace information to further investigate this issue, please let me know when you encounter the error including that trace detail.
I tried this and it works fine in my environment I used JDK 17 and dependencies {implementation("net.dv8tion:JDA:5.0.0-beta.18")} and run by InteliJ This is my test code and result
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.requests.GatewayIntent;
public class BotApplication {
public static void main(String[] args) {
JDABuilder.createLight(Bot.token) // my test token
.enableIntents(GatewayIntent.MESSAGE_CONTENT)
.setActivity(Activity.customStatus("I need more bullets"))
.setEventManager(null)
.build();
}
}
This is not an issue on startup, it happens at random times, days after the bot started, multiple people have reported this issue, I've created this issue for tracking purpose, so it can also be linked when a fix is available
Oh, I see. I didn't know that. Thank you for telling me. :)
Got one running main: https://duncte123.sentry.io/share/issue/fac5e12d2d2c40bc8baa0a46f21fc64f/
Got one running 5.0.0-beta.23
Got one running 5.0.0-beta.23
Please send the exception with the WS trace, like duncte123 sent
I don't think I have WS trace enabled or how to retrieve it. I have the stacktrace that is the same as the OP
[2024/05/02 23:20:23] [ERROR] [JDA MainWS-ReadThread] ERROR WebSocketClient - There was an error in the WebSocket connection com.neovisionaries.ws.client.WebSocketException: The RSV1 bit of a frame is set unexpectedly. at com.neovisionaries.ws.client.ReadingThread.verifyReservedBit1(ReadingThread.java:481) at com.neovisionaries.ws.client.ReadingThread.verifyReservedBits(ReadingThread.java:451) at com.neovisionaries.ws.client.ReadingThread.verifyFrame(ReadingThread.java:421) at com.neovisionaries.ws.client.ReadingThread.readFrame(ReadingThread.java:341) at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:99) at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45) [2024/05/02 23:20:23] [ERROR] Exception while handling JDA event:: com.neovisionaries.ws.client.WebSocketException: The RSV1 bit of a frame is set unexpectedly. at com.neovisionaries.ws.client.ReadingThread.verifyReservedBit1(ReadingThread.java:481) at com.neovisionaries.ws.client.ReadingThread.verifyReservedBits(ReadingThread.java:451) at com.neovisionaries.ws.client.ReadingThread.verifyFrame(ReadingThread.java:421) at com.neovisionaries.ws.client.ReadingThread.readFrame(ReadingThread.java:341) at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:99) at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64) at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)
Ah yea, please updated to the latest snapshot:
Maven:
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>io.github.discord-jda</groupId>
<artifactId>JDA</artifactId>
<version>6f7189f91a</version>
</dependency>
</dependencies>
Gradle (Kotlin):
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
implementation("io.github.discord-jda:JDA:6f7189f91a")
}
I have updated my POM, will see if I get it again. https://github.com/Slaynash/Lumbot/commit/d30becdef1d36d21bbf3d425a7fd18ba68fb8ed5
This issue has been escalated to cloudflare. Apparently, the web socket is receiving an http response body instead of a web socket frame. The specific bit happens to be set when the frame starts with HTTP/1.1 502 Bad Gateway Server
.
This should be fixed as of last Friday.
General Troubleshooting
Version of JDA
5.0.0-beta.18
Expected Behaviour
Handle the frame gracefully I guess?
Code Example for Reproduction Steps
Code for JDABuilder or DefaultShardManagerBuilder used
Exception or Error
BEFORE REPORTING A SIMILAR ERROR
Please update to the JDA snapshot https://github.com/discord-jda/JDA/issues/2663#issuecomment-2091841521 and include the WebSocket trace with the error