Question
Intermittent DNS Failure running Discord bot on Droplet
I’m trying to run a discord node js server on a digital ocean droplet and seeing this error around 24 hours after launching the process. I believe it’s crashing my app. Any idea what’s going on and how to handle this?
I see it’s a DNS lookup error, but I can’t figure out what is causing it and how to safely keep the bot alive.
Error: getaddrinfo EAI_AGAIN discordapp.com
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'discordapp.com',
request: ClientRequest {
.....
shouldKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
"logs.txt" 216L, 7582C 3,5 Top
[Symbol(connect-options)]: [Object]
},
Dt
'Host: discordapp.com\r\n' +
'Authorization: XXXXXX +
'User-Agent: DiscordBot (https://github.com/discordjs/discord.js, 11.5.1) Node.js/v12.18.1\r\n' +
'Content-Type: application/json\r\n' +
'Accept-Encoding: gzip, deflate\r\n' +
'Connection: keep-alive\r\n' +
'Content-Length: 26\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
....
path: '/api/v7/channels/796972614174113792/messages',
....
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×