KararTY / DiscordTwitchAnnouncer

Announces on Discord when Twitch channels go live.
MIT License
17 stars 6 forks source link

Consistent timeouts for the past 6 hours #27

Closed justatrivialbot closed 3 years ago

justatrivialbot commented 3 years ago

Using the most recent versions of everything including node-fetch.

I've been getting consistent timeouts with the bot for the past 6 hours. Twitch API status page is not showing any issues. Token should be valid until Jan 15.

Error received with multiple different channel names replaced with "channel":

FetchError: request to https://api.twitch.tv/helix/streams?user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel&user_login=channel failed, reason: connect ETIMEDOUT 151.101.186.214:443
    at ClientRequest.<anonymous> (H:\Streambot Oauth\node_modules\node-fetch\lib\index.js:1461:11)
    at ClientRequest.emit (events.js:315:20)
    at TLSSocket.socketErrorListener (_http_client.js:463:9)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:\100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}

If someone in that list deactivates their channel or changes their name would it cause a timeout? Or is something else going on that I'm unaware of?

KararTY commented 3 years ago

I've not noticed any strange behavior, has this happened before? Did any of your other clients/bots disconnect?

Looks like it can either be Twitch issue or a problem with your internet provider / host provider but I'm not drawing any conclusions. Keep watch on the bot and see if it happens again.

justatrivialbot commented 3 years ago

I've been online since I posted that message 10 hours ago. It has tried at regular intervals and failed every time. All of my other bots are working but this is the only one I have that's checking Twitch. The rest have been working with the Reddit API with no problem.

KararTY commented 3 years ago

Interesting, can you access https://api.twitch.tv/helix/streams?

justatrivialbot commented 3 years ago

It just connected for the first time in 18 hours. That link loads in browser but gives me the expected 401 error. Gonna chalk it up to an unannounced API error but will keep you posted. You can close for now.

justatrivialbot commented 3 years ago

Never mind it's back to failing again.

FetchError: request to https://api.twitch.tv/helix/games?id=509725 failed, reason: connect ETIMEDOUT 151.101.186.214:443
    at ClientRequest.<anonymous> (H:\Streambot Oauth\node_modules\node-fetch\lib\index.js:1461:11)
    at ClientRequest.emit (events.js:315:20)
    at TLSSocket.socketErrorListener (_http_client.js:463:9)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}
FetchError: request to https://api.twitch.tv/helix/games?id=509725 failed, reason: connect ETIMEDOUT 151.101.186.214:443
    at ClientRequest.<anonymous> (H:\Streambot Oauth\node_modules\node-fetch\lib\index.js:1461:11)
    at ClientRequest.emit (events.js:315:20)
    at TLSSocket.socketErrorListener (_http_client.js:463:9)
    at TLSSocket.emit (events.js:315:20)
    at emitErrorNT (internal/streams/destroy.js:100:8)
    at emitErrorCloseNT (internal/streams/destroy.js:68:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}
KararTY commented 3 years ago

What's your timer set in settings.js ?

justatrivialbot commented 3 years ago

301000

KararTY commented 3 years ago

Alright, so I have a few troubleshooting steps. I'm hoping we'll solve this eventually. That timer seems fine but exaggerated, so we're moving on to the next step.

And then see if the timeouts still occur.

justatrivialbot commented 3 years ago

It seems to have sorted itself, it was a DNS problem on my end, which I didn't realize would be a problem until I saw it farting out on both helix and kraken calls.

Did a tracert & ping, saw pile of dropped packets, switched DNS servers and all was well.

Timer is deliberately exaggerated to build in a non-compete delay on follow feeds.

Thank you for your help!

KararTY commented 3 years ago

Great, good to know it's solved! Unless there's any remaining problems related to this, I'm closing this issue.