Request aborted error?

I keep receiving this error:
test-bot/node_modules/undici/lib/api/abort-signal.js:10
self.onError(new RequestAbortedError())
^

RequestAbortedError [AbortError]: Request aborted
at abort (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:10:18)
at AbortSignal.self.<computed> (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:29:5)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:694:20)
at AbortSignal.dispatchEvent (node:internal/event_target:636:26)
at abortSignal (node:internal/abort_controller:292:10)
at AbortController.abort (node:internal/abort_controller:323:5)
at Timeout.<anonymous> (/root/test-bot/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:515:73)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_ABORTED'
}
test-bot/node_modules/undici/lib/api/abort-signal.js:10
self.onError(new RequestAbortedError())
^

RequestAbortedError [AbortError]: Request aborted
at abort (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:10:18)
at AbortSignal.self.<computed> (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:29:5)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:694:20)
at AbortSignal.dispatchEvent (node:internal/event_target:636:26)
at abortSignal (node:internal/abort_controller:292:10)
at AbortController.abort (node:internal/abort_controller:323:5)
at Timeout.<anonymous> (/root/test-bot/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:515:73)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_ABORTED'
}
Not sure why.
5 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
AbortError: The user aborted a request. A request took longer than the specified restRequestTimeout (15 seconds default), and was aborted to not lock up the request handler. • This can be caused by an internal server error on Discord's side, or just a slow connection. • In case of a slow connection, the restRequestTimeout option in ClientOptions can be increased to prevent future AbortErrors.
Erin
Erin2y ago
I don't have a slow connection and I didn't abort anything. This keeps happening on ready
Timmy
Timmy2y ago
First point ?
Erin
Erin2y ago
I posted teh full stack trace I am on the lastest discord.js npm is 8.19.2, node is 16.17.1 Discord.js v14.6.0 Didn't know I had to spell it out. Figured "latest discord.js" = discord.js v14.6.0 I'm getting this on my test bot now. I believe I updated the restRequestTimeout via ClientOptions.
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages ], partials: [Partials.Channel], restRequestTimeout: 5000 });
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages ], partials: [Partials.Channel], restRequestTimeout: 5000 });
That's how you do it right? Hasn't helped. Pretty sure this is a bug with DJS v 14.6... been happening since 14.5 for me... (I think?) Error:
/root/test-bot/node_modules/undici/lib/api/abort-signal.js:10
self.onError(new RequestAbortedError())
^

RequestAbortedError [AbortError]: Request aborted
at abort (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:10:18)
at AbortSignal.self.<computed> (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:29:5)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:694:20)
at AbortSignal.dispatchEvent (node:internal/event_target:636:26)
at abortSignal (node:internal/abort_controller:292:10)
at AbortController.abort (node:internal/abort_controller:323:5)
at Timeout.<anonymous> (/root/test-bot/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:515:73)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_ABORTED'
/root/test-bot/node_modules/undici/lib/api/abort-signal.js:10
self.onError(new RequestAbortedError())
^

RequestAbortedError [AbortError]: Request aborted
at abort (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:10:18)
at AbortSignal.self.<computed> (/root/test-bot/node_modules/undici/lib/api/abort-signal.js:29:5)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:694:20)
at AbortSignal.dispatchEvent (node:internal/event_target:636:26)
at abortSignal (node:internal/abort_controller:292:10)
at AbortController.abort (node:internal/abort_controller:323:5)
at Timeout.<anonymous> (/root/test-bot/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:515:73)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7) {
code: 'UND_ERR_ABORTED'
I believe it is a bug because I asked on my coding help server and a fellow mod says he has this issue with one of his bots when he uses whatever host he uses to keep the bot online 24/7 but when he locally hosts it is fine. It is only when he uses whatever host he uses. My bot is on my VPS. I refuse to locally host it. Ah, seems to have worked.