Inconsistent "Unknown Interaction" Error
I checked the probably causes but neither of them should be causing the issue.
- My interactions are already deferred.
- I'm not using collectors.
- I have reset the bot token and pasted it where I'm hosting the bot, making sure it's only started once.
- I'm not deferring modals. And this happens on other interactions as well.
I attached some error traces as well.
I could of course send codes, but that will be a lot of code. So it would be great if someone could first give me some specific things to look for to help you help me.





36 Replies
- 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!Node: 23-alpine
Djs: 14.18.0
do you know what actually happens in discord? does it error with application did not respond?
Hmmm, not sure. We haven't seen anyone report it yet.
Let me go and check if someone opened a ticket about it though.
In the meantime, here's the Ipa.ts file. (one of the errors originate here)
hmm I was hoping to completely rule out the third point in the tag if you could know what happens in discord, but given your third point, it's probably ruled out already
yep...
lemmi check though. gimmi a min
if defers are the first thing you're doing in your handler, sounds like it's either taking way too long to reach your handler, or the request is taking too long to reach discord (network problem)
could it ever depend on the user's internet connection?
no, only your bot's
hmmmm. yeah that shouldnt be an issue then.
and discord ig but it's not likely to be that since that'd be a known issue at that time
yeah.
in my error logs, I saw that it kept happening to the same user
there's also some other weird issue that for some reason, a place where the code is giving users a role, only works sometimes. I still have to test this though.
but more on that later
example

Could make sense for it to happen in Ask.execute.
Because this is all there is
we'd have to take a look at what happens from the event emit to that execute call, in order to be able to see whether it makes sense
but that'd be tedious for everyone
Also, no. no user has reported anything yet. Which is unfortunate. I wish it were easy to reproduce the issue
we do know that the error always happens inside the handler. Based on the stack trace at least.
so it does get to the handler
I'd recommend considering these options, maybe you could debug by logging the time before replying and Interaction#createdAt, or well, the difference
but don't know how long it takes to get to the handler.
there is no awaited processing before it gets to the handler. That should not be a problem though
hmmm. Okay. Will try this out.
could also include the timestamp in those message logs
that's actually a great idea.
also will prevent flooding logs because i'll only get them when an error occurs
if possible you can also include the interaction timestamp, considering the url is in the error, which contains the interaction id, which is a snowflake, which is a timestamp
where dyu see the URL in the error btw? I was trying to figure out a way to do this because I'm not passing the interaction object in my webhook error logger atm
great! okay lemmi do that
dyu have an example url for an interaction pls? If not, i'll throw an error and get it. Would be faster if you already have an example though :Pray:
noice thanks
Alright. I'll push this to prod and observe for a while :thumbsup:

Note that that 5s 253ms tells me that the processing of the interaction took 253ms. The 5s is the timeout i set for testing.
I don't know how or why but i haven't seen a single Unknown Interaction error since I added timestamps in the embed. :roouhh:
@Amgelo hmmmmmm. what to do


yeah both say more than 3s
6s is way too much as well
^^
yeah
but how do I fix this
it happens randomly
why are both 524ms
are you using any kind of proxy?
None that I know of. But again, I'm not too familiar with proxies, so if I am, I wouldn't know that I am.
I'm using Railway to host my bot. Does that help?
isnt railway one of those free hosts that use shared ip's? If so theres your issue