Androz2091 / discord-player

🎧 Complete framework to simplify the implementation of music commands using discord.js v14
https://discord-player.js.org/
MIT License
603 stars 190 forks source link

AbortError being thrown when Player stops a queue #1656

Closed febkosq8 closed 1 year ago

febkosq8 commented 1 year ago

Describe the bug Bot will throw a AbortError when its stops the queue, either through command or disconnection. This was supposed to be patched already keep happening mostly for me in Heroku.

Since I am handling uncaughtException in my code, my bot doesn't crash. (otherwise would have crashed the bot completely)

Attaching error stack below :

AbortError: The operation was aborted
at EventTarget.abortListener (node:events:958:14)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:735:20)
at EventTarget.dispatchEvent (node:internal/event_target:677:26)
at abortSignal (node:internal/abort_controller:308:10)
at AbortController.abort (node:internal/abort_controller:338:5)
at Timeout.<anonymous> (/app/node_modules/@discordjs/voice/dist/index.js:1931:39)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7) {
code: 'ABORT_ERR',
[cause]: DOMException [AbortError]: This operation was aborted
at new DOMException (node:internal/per_context/domexception:53:5)
at AbortController.abort (node:internal/abort_controller:336:18)
at Timeout.<anonymous> (/app/node_modules/@discordjs/voice/dist/index.js:1931:39)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)
}

To Reproduce Steps to reproduce the behavior:

  1. Queue a playlist
  2. Stop the queue either using command or disconnect the bot
  3. AbortError gets thrown

Expected behavior

  1. Queue a playlist
  2. Stop the queue either using command or disconnect the bot
  3. No error should be thrown

Please complete the following information:

febkosq8 commented 1 year ago

Edit : Nvm, it's still happening with the cache clean.

Old Update : Added the npm cache clean command to my Heroku procfile along with npm start seems to have stopped the issue. If I remove the cache clean then the problem seems to come back. IDK why this is the case.

worker: npm cache clean --force && npm start
Mittelblut9 commented 1 year ago

Happenes too, when i try to add a song to the queue

twlite commented 1 year ago

☹️ I guess this needs a complete rewrite for voice connection part

kewanfr commented 1 year ago

I have the same error with: v6.2.0 discord-player version, djs 14.9.0 and djs/voice 0.16.0

twlite commented 1 year ago

The voice connection handler was rewritten in discord-player@dev, please give it a try report any issues.

febkosq8 commented 1 year ago

Tried out discord-player@6.6.0-dev. I still got a AbortError on kicking the bot from vc.

twlite commented 1 year ago

From the recent research, it is confirmed that aborts are always emitted from player.events in the form of an event and it does not cause the process to crash. Abort specific errors may be emitted in their own event in the future but for now I am going to close this issue. Aborts usually happen upon attempting to perform something on illegal context or timeouts. Use the error event and forward the message to the user if necessary.

febkosq8 commented 1 year ago

For me the AbortErrors used to be caught in my unhandled exception not player.events. Good news is that I am no longer getting AbortErrors in the latest version - discord-player@6.6.1.