Unknown Interaction

LOGGING DiscordAPIError[10062]: Unknown interaction
30 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
d.js docs
d.js docs5mo ago
Common causes of DiscordAPIError[10062]: Unknown interaction: - Initial response took more than 3 seconds ➞ defer the response *. - Wrong interaction object inside a collector. - Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance) * Note: you cannot defer modal or autocomplete value responses
Bacio001
Bacio001OP5mo ago
After about 15 minutes (most of the time less) of running some of my bots get the error LOGGING DiscordAPIError[10062]: Unknown interaction For no reason at all, they have always ran fine, they just started doing that all of a sudden. Been debugging it for 12 hours now and I just can't find anything. Firewall / NAT / rate limit on that server IP - Discord may silently block outbound requests if it detects rate abuse, or if your IP is flagged. This is what I got sent it just fails on every interaction, modals, buttons, menus, commands idk
No description
Bacio001
Bacio001OP5mo ago
Is defered, not dual hosted so only on my host and the object is fine
treble/luna
treble/luna5mo ago
it is not deferred though it is unknown by the time it reaches the defer so its probably a network issue
Bacio001
Bacio001OP5mo ago
Uh, I deffer it like right when it gets ran, that is confusing me
treble/luna
treble/luna5mo ago
this is not a deferred reply if your code reached the defer you would see '... is thinking'
Bacio001
Bacio001OP5mo ago
Right Okay, ill try some stuff
LOGGING DiscordAPIError[10062]: Unknown interaction

at handleErrors (/app/node_modules/@discordjs/rest/dist/index.js:727:13)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/dist/index.js:831:23)

at async _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1272:22)

at async ChatInputCommandInteraction.reply (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:194:22)

at async handleReply (file:///app/bot/util/helpers.js:536:21)

at async Module.execute (file:///app/bot/src/block/action/send-message.js:30:19)

at async runTree (file:///app/bot/src/blockHandler.js:140:11)

at async commandHandler (file:///app/bot/util/clientEvents.js:148:5)

at async interactionEvent (file:///app/bot/util/clientEvents.js:102:16) {

requestBody: { files: [], json: { type: 4, data: [Object] } },

rawError: { message: 'Unknown interaction', code: 10062 },

code: 10062,

status: 404,

method: 'POST',

url:

}
LOGGING DiscordAPIError[10062]: Unknown interaction

at handleErrors (/app/node_modules/@discordjs/rest/dist/index.js:727:13)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/dist/index.js:831:23)

at async _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1272:22)

at async ChatInputCommandInteraction.reply (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:194:22)

at async handleReply (file:///app/bot/util/helpers.js:536:21)

at async Module.execute (file:///app/bot/src/block/action/send-message.js:30:19)

at async runTree (file:///app/bot/src/blockHandler.js:140:11)

at async commandHandler (file:///app/bot/util/clientEvents.js:148:5)

at async interactionEvent (file:///app/bot/util/clientEvents.js:102:16) {

requestBody: { files: [], json: { type: 4, data: [Object] } },

rawError: { message: 'Unknown interaction', code: 10062 },

code: 10062,

status: 404,

method: 'POST',

url:

}
Yeah on the button ones, but on commands it does the exact same This is a command Ill see if I can find the command in the logs Ill have to restart the bot so it may take up to 15 minutes again. Ill add timestamping Alright will restart them ignore that Also happend right after restart 1751060079803
1388271312514060340 Can that be right Alright thnx now I have something to actually contact my provider with. How did you convert this? Seems like the issue still isn't fixed 1751065381051 LOGGING DiscordAPIError[10062]: Unknown interaction at handleErrors (/app/node_modules/@discordjs/rest/dist/index.js:727:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/dist/index.js:831:23) at async _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1272:22) at async ChatInputCommandInteraction.reply (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:194:22) at async handleReply (file:///app/bot/util/helpers.js:536:21) at async Module.execute (file:///app/bot/src/block/action/send-message.js:30:19) at async runTree (file:///app/bot/src/blockHandler.js:140:11) at async commandHandler (file:///app/bot/util/clientEvents.js:148:5) at async interactionEvent (file:///app/bot/util/clientEvents.js:102:16) { requestBody: { files: [], json: { type: 4, data: [Object] } }, rawError: { message: 'Unknown interaction', code: 10062 }, code: 10062, status: 404, method: 'POST', url: 'https://discord.com/api/v10/interactions/1388293567302336775/callback?with_response=false' } Even ones with 1 second delay are invalid
Question
Question5mo ago
Its network or ratelimit -# ahm, or probably Duplicated interactions idk if you deferred or not, but this thing will definitely be cool
if (!interaction.deferred && !interaction.replied) {
await interaction.deferReply();
}
if (!interaction.deferred && !interaction.replied) {
await interaction.deferReply();
}
also you cannot defer modals, instead you use
await interaction.reply({ content: "working on it", ephemeral: true });
await interaction.reply({ content: "working on it", ephemeral: true });
you should check your provider status
Bacio001
Bacio001OP5mo ago
Already done all that, status is fine. I'm doing the defering just like you right after a command is ran.
Question
Question5mo ago
can you reheck?
Bacio001
Bacio001OP5mo ago
Jep we just did, it's making good contact We even switch out the NAS that handles the traffic to a new one
Question
Question5mo ago
Is the error only shows to 1 command or entire command?
Bacio001
Bacio001OP5mo ago
All commands buttons modals etc.
Question
Question5mo ago
did u defer modal
Bacio001
Bacio001OP5mo ago
And randomly it only happens after a couple minutes Nope, I have a handler for that. It only defers after 2.5 seconds so modals run before that But even when I rermove that 2.5 seconds it still does the same Well modals don't work then ofc but neither do commands or buttons
Question
Question5mo ago
It randomly happens?
Bacio001
Bacio001OP5mo ago
Jep after like 10 ish minutes or so Like it all works fine, then just stops
Question
Question5mo ago
try adding rest debugging
const { REST } = require('@discordjs/rest');
// ur business
rest.on('debug', console.log)
const { REST } = require('@discordjs/rest');
// ur business
rest.on('debug', console.log)
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Bacio001
Bacio001OP5mo ago
Ill add the client.on debug thing should be the same right
Question
Question5mo ago
Ye
Bacio001
Bacio001OP5mo ago
Going to add that tmmr, bots have been up for 24 minutes without issue now so hoping it's stable enough for me to go to bed after 14 hours 😂. If it still happens tmmr then ill push the debugging update and see if I can get something out of that Ah nvm it just broke again
Question
Question5mo ago
:crySparkle:
Bacio001
Bacio001OP5mo ago
These are the outputs of the interaction failed + their MS before and after which is 100ms and 200ms so idk
Question
Question5mo ago
I'm on mobile right now
Bacio001
Bacio001OP5mo ago
Alright that file has a button and command example ill be on again in like 7 hours Other bots also seem to have it, not hosted by me. Is there a Discord outage or smth?
[WS => Shard 0] Heartbeat acknowledged, latency of 113ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 116ms.
[WS => Shard 0] First heartbeat sent, starting to beat every 41250ms
1751111446524 LOGGING DiscordAPIError[10062]: Unknown interaction
at handleErrors (/app/node_modules/@discordjs/rest/dist/index.js:748:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/dist/index.js:852:23)
at async _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1293:22)
at async ButtonInteraction.showModal (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:381:22)
at async Module.execute (file:///app/bot/src/block/action/modal.js:69:3)
at async runTree (file:///app/bot/src/blockHandler.js:140:11)
at async buttonHandler (file:///app/bot/util/clientEvents.js:355:5)
at async interactionEvent (file:///app/bot/util/clientEvents.js:103:40)
at async Client.<anonymous> (file:///app/bot/src/index.js:102:9) {
requestBody: { files: undefined, json: { type: 9, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1388486759901298708/aW50ZXJhY3Rpb246MTM4ODQ4Njc1OTkwMTI5ODcwODpNejY5NEFDdDk5WmMyZVlWWkl6R3Q2Tk5yenlnWWpkYTNsUzloSUgzSDd4NjFOVWl0YmgxR0l3UjFGcUZZZHdCSmVqNnNDM3FMSmxlY2Iyb3Vlc2ZreGRTZkJyQlh2M1NtSE9sNHFPNHRyNlVweFF3NjVKeERteEVON0NYUmtNNQ/callback?with_response=false'
}
[WS => Shard 0] Heartbeat acknowledged, latency of 106ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 107ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 113ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 116ms.
[WS => Shard 0] First heartbeat sent, starting to beat every 41250ms
1751111446524 LOGGING DiscordAPIError[10062]: Unknown interaction
at handleErrors (/app/node_modules/@discordjs/rest/dist/index.js:748:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/dist/index.js:852:23)
at async _REST.request (/app/node_modules/@discordjs/rest/dist/index.js:1293:22)
at async ButtonInteraction.showModal (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:381:22)
at async Module.execute (file:///app/bot/src/block/action/modal.js:69:3)
at async runTree (file:///app/bot/src/blockHandler.js:140:11)
at async buttonHandler (file:///app/bot/util/clientEvents.js:355:5)
at async interactionEvent (file:///app/bot/util/clientEvents.js:103:40)
at async Client.<anonymous> (file:///app/bot/src/index.js:102:9) {
requestBody: { files: undefined, json: { type: 9, data: [Object] } },
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1388486759901298708/aW50ZXJhY3Rpb246MTM4ODQ4Njc1OTkwMTI5ODcwODpNejY5NEFDdDk5WmMyZVlWWkl6R3Q2Tk5yenlnWWpkYTNsUzloSUgzSDd4NjFOVWl0YmgxR0l3UjFGcUZZZHdCSmVqNnNDM3FMSmxlY2Iyb3Vlc2ZreGRTZkJyQlh2M1NtSE9sNHFPNHRyNlVweFF3NjVKeERteEVON0NYUmtNNQ/callback?with_response=false'
}
[WS => Shard 0] Heartbeat acknowledged, latency of 106ms.
[WS => Shard 0] Heartbeat acknowledged, latency of 107ms.
treble/luna
treble/luna5mo ago
thats probably just a network issue then. If it were a discors issue we'd be getting loads of those in support (And those are usually indicated by 5xx errors) what host are you using
Bacio001
Bacio001OP5mo ago
Well I just switched host And still getting it
treble/luna
treble/luna5mo ago
Then something is slowing down your code

Did you find this page helpful?