Skip to content
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

unexpected error #2788

Closed
2 tasks done
Matita008 opened this issue Jan 3, 2025 · 6 comments
Closed
2 tasks done

unexpected error #2788

Matita008 opened this issue Jan 3, 2025 · 6 comments

Comments

@Matita008
Copy link

Matita008 commented Jan 3, 2025

General Troubleshooting

  • 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

The code was working up to yesterday, no modification were done

seems like #2756 since i'm also using a button but also with a slash command it does no longer works

Code Example for Reproduction Steps

public static void closeTicket(@NotNull GenericInteractionCreateEvent e) {
      if(noDM(e)) return;
      if(e.getChannel() instanceof TextChannel t) {
         if(checkStaffAv(e, e.getMember(), t)) {
            String reason = "";
            if(e instanceof SlashCommandInteractionEvent se && se.getOption("reason") != null) reason = noNull(se.getOption("reason")).getAsString();
            else if(e instanceof ModalInteractionEvent me) reason = noNull(me.getValue("Ticket-close-reason")).getAsString();
            t.sendMessage(e.getUser().getAsMention() + " ha chiuso il ticket " + (reason.isEmpty() || reason.isBlank()? " senza motivazione" : " con motivo: " + reason)).queue();
            reply((IReplyCallback)e);
            saveTranscript(t, e.getUser(), reason);
            t.delete().queueAfter(15, TimeUnit.SECONDS, (q)->System.out.println("Chiuso un ticket\n" + t));
            System.out.println("chiudo " + e.getChannel().getName());
         }
      } else System.out.println("NaTC");
   }

Trascript class is:
        public FileUpload createTranscript(@NotNull TextChannel textChannel) throws IOException {
            return FileUpload.fromData(generateFromMessages(MessageHistory.getHistoryFromBeginning(textChannel).complete().getRetrievedHistory()), textChannel.getName()+".html");
        }

Code for JDABuilder or DefaultShardManagerBuilder used

DefaultShardManagerBuilder b = DefaultShardManagerBuilder.createDefault(ticketToken);
        b.enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_MESSAGES, GatewayIntent.MESSAGE_CONTENT);
        b.setActivity(Activity.watching("Tickets"));
        b.addEventListeners(new TicketListener());
        b.enableCache(CacheFlag.MEMBER_OVERRIDES);
        shard = b.build();

Exception or Error

2025-01-03 15:36:21 [WebSocketClient] [ERROR] Got an unexpected error. Please redirect the following message to the devs:
        JDA 5.1.2_5f799f1
        INTERACTION_CREATE -> {"entitlements":[],"data":{"component_type":2,"custom_id":"close"},"entitlement_sku_ids":[],"channel":(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 slash one:
2025-01-03 15:42:53 [WebSocketClient] [ERROR] Got an unexpected error. Please redirect the following message to the devs:
        JDA 5.1.2_5f799f1
        INTERACTION_CREATE -> {"entitlements":[],"data":{(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.command.CommandInteractionImpl.<init>(CommandInteractionImpl.java:41)
        at net.dv8tion.jda.internal.interactions.command.SlashCommandInteractionImpl.<init>(SlashCommandInteractionImpl.java:30)
        at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleCommand(InteractionCreateHandler.java:112)
        at net.dv8tion.jda.internal.handle.InteractionCreateHandler.handleInternally(InteractionCreateHandler.java:83)
        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)
@Matita008
Copy link
Author

Upsie, didn't noticet there was the token
Resetted it anyway

@Matita008
Copy link
Author

resetting the token fixed it, idk why but if you have the same issue try resetting the token

@Matita008
Copy link
Author

2025-01-10 18:10:14 [WebSocketClient] [ERROR] Got an unexpected error. Please redirect the following message to the devs: JDA 5.1.2_5f799f1 INTERACTION_CREATE -> {"entitlements":[],"data":{"component_type":2,"custom_id":"close"},"entitlement_sku_ids":[],"channel":{"last_pin_timestamp":"2025-01-10T18:03:05+00:00","nsfw":false,"rate_limit_per_user":0,"flags":0,"type":0,"last_message_id":"1327338721720271023","permissions":"1095942546988737","parent_id":"1322180962725134470","name":"ticket-partnership-ziotom0112_49963","guild_id":"996566150089539714","topic":null,"position":67,"id":"1327336925178101884"},"authorizing_integration_owners":{"0":"996566150089539714"},"type":3,"message":{"mention_everyone":false,"pinned":false,"components":[{"components":[{"custom_id":"claim","style":3,"label":"Rivendica il ticket","id":2,"type":2},{"custom_id":"close","style":4,"label":"Chiudi il ticket","id":3,"type":2},{"custom_id":"close-reason","style":4,"label":"Chiudi il ticket con motivazione","id":4,"type":2}],"id":1,"type":1},{"components":[{"style":5,"label":"La nostra descrizione","id":6,"type":2,"url":"https://discord.com/channels/996566150089539714/1321995715463090278"}],"id":5,"type":1}],"attachments":[],"author":{"primary_guild":null,"global_name":null,"bot":true,"avatar_decoration_data":null,"clan":null,"public_flags":0,"id":"1321967608752509059","avatar":"0b4d767cc11bd776cee76aec57e9dbf8","username":"Ticket Gaming Core","discriminator":"8017"},"flags":0,"type":0,"mention_roles":[],"edited_timestamp":null,"content":"","tts":false,"mentions":[],"id":"1327336926860148847","embeds":[{"content_scan_version":0,"footer":{"text":"Evita ping inutili, grazie ❤"},"description":"<@1189207218948681790> | 1189207218948681790 grazie per aver aperto un ticket\nPremi sul pulsante qua sotto per vedere la nostra descrizione\nUno staff ti risponderà presto","type":"rich"}],"channel_id":"1327336925178101884","timestamp":"2025-01-10T18:03:04.091000+00:00"},"locale":"it","version":1,"application_id":"1321967608752509059","token":"aW50ZXJhY3Rpb246MTMyNzMzODczMTMzMzQ4ODc3MjpXOVRqQ0JiWEoweXkzckR5MVI1Vm12WDE1cDBKaGl1M1hyNTZuTW94bVhnTjZQNVFpVjhkSzJBOGMzMlN4WG1CcW1zU1JGcXhJbUx1WmVKaXJ0MTZFd1lqamQ1NXpKNWNvYmpMSWZCV25KNk41WlVUdjltcHNDa1UxQ0t5SmtXaw","guild":{"features":["ENABLED_MODERATION_EXPERIENCE_FOR_NON_COMMUNITY","GUILD_SERVER_GUIDE","MEMBER_VERIFICATION_GATE_ENABLED","AUTO_MODERATION","SOUNDBOARD","NEWS","GUILD_ONBOARDING","PREVIEW_ENABLED","GUILD_ONBOARDING_EVER_ENABLED","COMMUNITY","GUILD_ONBOARDING_HAS_PROMPTS"],"id":"996566150089539714","locale":"it"},"member":{"premium_since":null,"roles":["1322176590507147296","1322189444962455584","1322347602171138210","1322339678090821733","1322347585666682950","1322191675614953512","1322187102544465993","1322189401740021851","1321934673676472415","1322347594562928751","1322500790362964021","1322504492520050743","1322339345667195000","1322339597979484251","1322339633631199324","1322339659841540157","1321944210068340830","1322191702533865503"],"pending":false,"flags":42,"deaf":false,"banner":null,"mute":false,"unusual_dm_activity_until":null,"avatar":null,"nick":"🎗 Staff › Bazar_Simo","joined_at":"2025-01-03T09:43:50.271000+00:00","communication_disabled_until":"2025-01-08T13:38:20.167000+00:00","permissions":"1095942546988737","user":{"primary_guild":null,"global_name":"シモ | 999🖤","avatar_decoration_data":null,"clan":null,"public_flags":4194304,"id":"1189655871567966289","avatar":"a_d2f24f9637a0b75933462d1f9f5ec28e","username":"bazart_simo","discriminator":"0"}},"guild_id":"996566150089539714","context":0,"id":"1327338731333488772","app_permissions":"2251799813685247","channel_id":"1327336925178101884","guild_locale":"it"} java.lang.IllegalStateException: Failed to create channel instance for interaction! Channel Type: 0
this is another error message

@Matita008
Copy link
Author

(Btw the bot is respondig fine to Dropdown menu but not to buttons or slash commands)
(also the bot is for a week now, and the channel in question was created an hour ago)

@Matita008
Copy link
Author

also when i tried to shu it down it has just gave me another error:
2025-01-10 20:08:24 [WebSocketClient] [ERROR] Was unable to schedule next packet due to rejected execution by threadpool
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@2adabac1[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@41e27b5b[Wrapped task = net.dv8tion.jda.internal.requests.WebSocketSendingThread@243e1674]] rejected from java.util.concurrent.ScheduledThreadPoolExecutor@409bf450[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 1252118]
at java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2081)
at java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:841)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:340)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:562)
at net.dv8tion.jda.internal.requests.WebSocketSendingThread.scheduleIdle(WebSocketSendingThread.java:83)
at net.dv8tion.jda.internal.requests.WebSocketSendingThread.scheduleNext(WebSocketSendingThread.java:177)
at net.dv8tion.jda.internal.requests.WebSocketSendingThread.run(WebSocketSendingThread.java:167)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
2025-01-10 20:08:24 [WebSocketClient] [ERROR] Was unable to schedule next packet due to rejected execution by threadpool
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@1b8b153c[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@4a15d223[Wrapped task = net.dv8tion.jda.internal.requests.WebSocketSendingThread@47a088c9]] rejected from java.util.concurrent.ScheduledThreadPoolExecutor@be35cd9[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 1252026]
at java.base/java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2081)
at java.base/java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:841)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:340)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:562)
at net.dv8tion.jda.internal.requests.WebSocketSendingThread.scheduleIdle(WebSocketSendingThread.java:83)
at net.dv8tion.jda.internal.requests.WebSocketSendingThread.scheduleNext(WebSocketSendingThread.java:177)
at net.dv8tion.jda.internal.requests.WebSocketSendingThread.run(WebSocketSendingThread.java:167)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)

@freya022
Copy link
Contributor

The shutdown exception is most likely fine, but for the unknown channel i doubt we can help you unless you find a way to reproduce the issue, even if not 100% reliable, or if you give us the trace logs for the websocket, which is likely a lot, and would need to be filtered specially

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants