aaronshappell / picabot

A discord bot for didney worl who has an appetite for non-nutritive substances
MIT License
3 stars 7 forks source link

Random crash while testing #22

Closed aaronshappell closed 7 years ago

aaronshappell commented 7 years ago

Could be due to lag and was while testing a sound queue system redesign

(node:23292) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: getaddrinfo ENOTFOUND discordapp.com d
iscordapp.com:443
(node:23292) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: getaddrinfo ENOTFOUND discordapp.com d
iscordapp.com:443
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo ENOTFOUND gateway.discord.gg gateway.discord.gg:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)
aaronshappell commented 7 years ago

Looks to have been a wifi issue judging by Error: getaddrinfo ENOTFOUND gateway.discord.gg gateway.discord.gg:443

cozuya commented 7 years ago

I had this in my production app today (digital ocean).

aaronshappell commented 7 years ago

This error occurred while hosting locally and while my wifi was acting funny. Hasn't happened since.

cozuya commented 7 years ago

DNS down or something? I make a lot of requests here maybe 20+ an hour. IDK I put a try catch around it we'll see if it keeps happening. https://github.com/cozuya/secret-hitler/blob/master/routes/socket/user-events.js#L741

aaronshappell commented 7 years ago

Ya my wifi wasn't being stable during some testing. Hopefully that try catch will fix it, otherwise you could maybe look into a persistent nodejs setup? (don't remember the name). It doesn't fix it per say but would at least auto restart everything. Looks like a great project btw! I love secret hitler :)

cozuya commented 7 years ago

Yeah I use PM2 in production its great but a crash means all of my player's games are dead =/ Thanks project is really mature now and ~100 players on peak is amazing.