Report this

What is the reason for this report?

Intermittent DNS Failure running Discord bot on Droplet

Posted on January 9, 2021

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',
....
  }
}


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hi @innovatingbliss,

getaddrinfo is by definition a DNS issue. Does dig host or nslookup host work?

Additionally, what DNS are you using, is it DigitalOcean’s one, if not, can you confirm from where and how are you using your DNS, is it selfhosted, when did you configure the DNS? Please note that DNS propagation can take up to 24 hours to work.

Regards, KFSys

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.