Discord.JS / Something took too long to do


#1

Hey, I am getting the error

(node:1939) UnhandledPromiseRejectionWarning: Error: Something took too long to do.

I see the bot doesn’t log in correctly into Discord (though the Token is correct)
I also get

[ws] Attempted to destroy WebSocket but no connection exists!

This is also happening to a Friend’s Discord.JS bot hosted on Glitch.
Any ideas on how to solve this?


#2

It happens to me too, but some of the bots are still fast, but the ones i use mostly are down and they have either high ping or not login at all


#3

Happening to me as well.


#4

So the bot finally connected to the web socket. But running a single command takes upwards of an hour to respond. This is not on my end of the code as it is something that worked for months. Can someone check to see if there are issues with whatever server my glitch project is on? Thanks.


#5

That does seem like odd behavior, but we’re not seeing anything out of the ordinary on any of our hosts. @Hackerplanes, @razefeixx, and @iBisho can you provide project name so we can take a closer look?


#6

@cori It is working fine now. Not sure if you guys did anything on your end but it went back to normal right as you posted your reply. I will let you know if something changes again.


#7

I have the same problem


#8

No changes on our end. @zeis974 can you also provide your project name so we can take a look?


#9

The same problem started to my bots too. It also doesn’t look like it is the code, since nothing were changed, and it is returning the same “Something took too long” timeout on login.


#10

Same for me as well.


#11

Same question for you as well, @Codingpro (and you, @Naruyoko). Please provide project names so that we can look at them specifically.


#12

discord-channel-bot, rosquad @cori :smile:


#13

@cori

here is the full error

(node:3217) UnhandledPromiseRejectionWarning: Error: Something took too long to do.

    at timeout.client.setTimeout (/rbd/pnpm-volume/ba5c37af-02df-4742-91c4-c5ceb7c6f78a/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/ClientManager.js:40:57)

    at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/ba5c37af-02df-4742-91c4-c5ceb7c6f78a/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/Client.js:433:7)

    at ontimeout (timers.js:436:11)

    at tryOnTimeout (timers.js:300:5)

    at listOnTimeout (timers.js:263:5)

    at Timer.processTimers (timers.js:223:10)

(node:3217) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)

(node:3217) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

#14

@cori indice-bot and protobot.


#15

Thanks for the project names; we’ll take a closer look as soon as we can - probably tomorrow morning.

In the meantime it may be useful for each of you to follow the guidance in https://github.com/discordjs/discord.js/issues/1604#issuecomment-311942193 and catch the error from login() to see if we can sort out where the breakdown is occurring; it might show us a little more detail.


#16

I’ve also been having the same issue with my bot where it says that it is live, but not online on discord. At first I couldn’t figure it out so I commented out certain parts of the code that dealt with timeouts and cooldowns. Funnily enough it seemed like it worked and it came back online on Discord however it immediately went back to it’s previous state and I can not figure out what the error means. My bot’s name is zielo-rules.


#17

Hey Cori!

There are people currently relying on the bot, and I would like if you could fix it ASAP. Also, I added the console error thing, but didn’t get any response.


#18

I just recently got this error on my bot, too. I added a catch to login, and all that comes up is [Function: bound consoleCall].
Project name is leaf-bot.

EDIT: My bad, I did add the catch, but instead of doing just console.error I had console.log(console.error) due to previous attempts to try and catch out the error. The error message is:

Error: Something took too long to do.

    at timeout.client.setTimeout (/app/node_modules/discord.js/src/client/ClientManager.js:40:57)

    at Timeout.setTimeout [as _onTimeout] (/app/node_modules/discord.js/src/client/Client.js:433:7)

    at ontimeout (timers.js:466:11)

    at tryOnTimeout (timers.js:304:5)

    at Timer.listOnTimeout (timers.js:267:5)

My bot does not want to start anymore
#19

Same issue.

Error: Something took too long to do.
    at timeout.client.setTimeout (/rbd/pnpm-volume/2bdb8956-80c9-4849-9866-15bd6c896ba8/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/ClientManager.js:40:57)
    at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/2bdb8956-80c9-4849-9866-15bd6c896ba8/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/Client.js:433:7)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5) Promise {
  <rejected> Error: Something took too long to do.
    at timeout.client.setTimeout (/rbd/pnpm-volume/2bdb8956-80c9-4849-9866-15bd6c896ba8/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/ClientManager.js:40:57)
    at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/2bdb8956-80c9-4849-9866-15bd6c896ba8/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/Client.js:433:7)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5) }```

#20

Same issue. Project name is bermuda-fn. My other bots are working fine its just this one

Error: Something took too long to do.

at timeout.client.setTimeout (/rbd/pnpm-volume/0eee7f8a-59cf-4bee-83a9-d7c867095478/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/ClientManager.js:40:57)

at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/0eee7f8a-59cf-4bee-83a9-d7c867095478/node_modules/.registry.npmjs.org/discord.js/11.4.2/node_modules/discord.js/src/client/Client.js:433:7)

at ontimeout (timers.js:436:11)

at tryOnTimeout (timers.js:300:5)

at listOnTimeout (timers.js:263:5)

at Timer.processTimers (timers.js:223:10)