Discord.JS | Error: socket hang up

(node:1452) UnhandledPromiseRejectionWarning: Error: socket hang up
at TLSSocket.onHangUp (_tls_wrap.js:1148:19)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at TLSSocket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickCallback (internal/process/next_tick.js:181:9)

I get a this error in my project. Can you please fix this?
My project name: rtdbot

1 Like

Hey,

This error could be caused by some things, mostly by a poor connection, and this is a very rare error that would happen on glitch, but it can happen to anyone as websocket aren’t the best with steady connections.

1 Like

@cori Can you renew my Glitch IP? Sometimes I am getting connection problems and my Discord bot has high ping

1 Like

It could be an issue on Discord’s side, otherwise something in your code has forced the TCP Socket to perform a hookup.

If your ping is high, it could be because Glitch projects are hosted in the us-east AWS region.

Edit: Updated the AWS region as I typed the wrong one.

Hey @RaknaX, I did look at our hosts when you posted this and we didn’t have any hosts banned at that time. Simply changing the server your project is running on is unlikely to resolve the issue; as @charliea21 points out all of our servers are hosted in US AWS regions (they’re actually all in one of the us-east regions), so if you’re seeing connection problems it could be related to network issues between you (or your Discord server) and your project’s host.

Hey, @cori can you renew my glitch IP too.
Thanks …
I didn’t fixed and same error :frowning: why!?

Hey @Kyoya, as I mentioned I don’t think the socket hung up message is an issue on Glitch’s side. Moving your project to a new host (in order to get a new IP address) is only really effective for Discord bans, and we don’t have any banned hosts right now. Usually those result in a different error message (along the lines of something took too long to do) in any case.