Discord.js: Socket Hangup

Created on 16 Sep 2017  路  8Comments  路  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:
My bot crashes like every 5-10 minutes with

Error [TOKEN_INVALID]: An invalid token was provided.
at timeout.client.setTimeout (/root/k3po/node_modules/discord.js/src/client/ClientManager.js:40:57)
at Timeout.setTimeout [as _onTimeout] (/root/k3po/node_modules/discord.js/src/client/BaseClient.js:79:7)
at ontimeout (timers.js:469:11)
at tryOnTimeout (timers.js:304:5)
at Timer.listOnTimeout (timers.js:264:5)

and then

Error: socket hang up
at createHangUpError (_http_client.js:345:15)
at TLSSocket.socketOnEnd (_http_client.js:437:23)
at emitNone (events.js:110:20)
at TLSSocket.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1045:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

No, my token is not invalid. After that, my bot automatically reconnects and works fine again, for 5 minutes and the same thing happens again. This started happening yesterday evening, makes my bot un-usable and is extremely annoying. I hope someone can help me to fix it.

Further details:

  • discord.js version: v12.0.0-dev
  • node.js version: v8.2.1
  • Operating system: Ubuntu

  • [ ] I found this issue while running code on a __user account__
  • [ ] I have also tested the issue on latest master, commit hash:
low gateway bug

Most helpful comment

As space (nicknamed appellation, but ignore that) also answered you in the lib-support channel, it _is_ a connection issue. You could try seeing if this happens on another computer, or if you have a vps try comparing it when running on your local pc and your vps.

All 8 comments

I'm sure that, as a human that knows how to read and write, you can see you gave an invalid token to login
EDIT: okay I see your statement

Seriously? Did you even read what I said? My token is valid because it also reconnects after it crashes and then works for 5 minutes, but then crashes again. @PgBiel

this stems from an error with promise bubbles. the actual issue is that you have shitty internet

It started happening yesterday. It's been working fine for multiple months.

I reset my token multiple times, and even tried it on a different application - Same issue.

As space (nicknamed appellation, but ignore that) also answered you in the lib-support channel, it _is_ a connection issue. You could try seeing if this happens on another computer, or if you have a vps try comparing it when running on your local pc and your vps.

This has been occurring a lot lately.
It is NOT a connection issue as i host on the vultr cloud. I have 3 other bots running on the same vps but only 1 has this issue( handles a lot of commands and is in 2 huge guilds without about 60k members with messages coming in at 13-20 messages per second )
The issue occurs once in 3-6 days and is annoying tbh.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shukriadams picture shukriadams  路  3Comments

smchase picture smchase  路  3Comments

DatMayo picture DatMayo  路  3Comments

ghost picture ghost  路  3Comments

ghost picture ghost  路  3Comments