qeled / discordie

Predictable JavaScript abstractions for Discord API.
https://qeled.github.io/discordie/
BSD 2-Clause "Simplified" License
190 stars 45 forks source link

Cannot set property 'length' of undefined in EncoderWorker.js #101

Closed Senither closed 4 years ago

Senither commented 7 years ago

The issue seems to pop up randomly, the error has been thrown twice in the last 48 hours, with 43 hours between them, the bot are streaming music for most of that time so I'm not sure why it suddenly decides to fail.

TypeError: Cannot set property 'length' of undefined
  File "/discord/avaire-bot/node_modules/discordie/lib/voice/threading/EncoderWorker.js", line 27, col 28, in EncoderWorker.kill
    this.audioQueue.length = 0;
  File "/discord/avaire-bot/node_modules/discordie/lib/voice/AudioEncoder.js", line 278, col 17, in AudioEncoder.kill
    this.worker.kill();
  File "/discord/avaire-bot/node_modules/discordie/lib/networking/ws/VoiceSocket.js", line 154, col 25, in VoiceSocket.disconnect
    this.audioEncoder.kill();
  File "/discord/avaire-bot/node_modules/discordie/lib/networking/ws/GatewaySocket.js", line 434, col 17, in GatewaySocket.disconnectVoice
    voiceSocket.disconnect(error);
  File "/discord/avaire-bot/node_modules/discordie/lib/collections/VoiceConnectionCollection.js", line 111, col 28, in DiscordieDispatcher.discordie.Dispatcher.on.e
    info.gatewaySocket.disconnectVoice(guildId);
  File "events.js", line 101, col 20, in emitOne
  File "events.js", line 188, col 7, in DiscordieDispatcher.emit
  File "/discord/avaire-bot/node_modules/discordie/lib/core/DiscordieDispatcher.js", line 37, col 16, in DiscordieDispatcher.emit
    super.emit.apply(this, arguments);
  File "/discord/avaire-bot/node_modules/discordie/lib/networking/ws/VoiceSocket.js", line 140, col 23, in VoiceSocket.disconnect
    this.Dispatcher.emit(Events.VOICESOCKET_DISCONNECT, msg);
  File "/discord/avaire-bot/node_modules/discordie/lib/networking/ws/GatewaySocket.js", line 441, col 19, in GatewaySocket.disconnectAllVoice
    voiceSocket.disconnect(error);
  File "/discord/avaire-bot/node_modules/discordie/lib/networking/ws/GatewaySocket.js", line 270, col 12, in GatewaySocket.disconnect
    this.disconnectAllVoice(causedByEvent ? voiceError : undefined);
  File "/discord/avaire-bot/node_modules/discordie/lib/networking/ws/GatewaySocket.js", line 218, col 12, in BaseSocket.close
    this.disconnect(code, desc, true);
  File "events.js", line 111, col 20, in emitTwo
  File "events.js", line 191, col 7, in BaseSocket.emit
  File "/discord/avaire-bot/node_modules/ws/lib/WebSocket.js", line 950, col 8, in BaseSocket.cleanupWebsocketResources
    this.emit('close', this._closeCode || 1000, this._closeMessage || '');
  File "events.js", line 91, col 20, in emitNone
  File "events.js", line 185, col 7, in TLSSocket.emit
  File "_stream_readable.js", line 926, col 12, in endReadableNT
  File "internal/process/next_tick.js", line 74, col 11, in _combinedTickCallback
  File "internal/process/next_tick.js", line 122, col 9, in process._tickDomainCallback