epicgames-freegames-node icon indicating copy to clipboard operation
epicgames-freegames-node copied to clipboard

Docker hangs for a few minutes then fails with connect ETIMEDOUT

Open nitanmarcel opened this issue 4 years ago • 10 comments

I just started to run this on my new ScaleWay server (Debian) and I noticed that it hands for a few minutes either at Checking free games for <email> or Purchasing <Game> and I don't understand why since it worked very well before I change my distro on scaleway.

I don't know if this is related to the app or the vps but maybe someone knows an answer or a new option to set a timeout if possible could be a help.

Thanks.

Here's the full error:

[2021-06-03 22:55:08.623 +0300] ERROR (RequestError/18 on 5cd824e032d8): connect ETIMEDOUT 34.196.170.8:443
    RequestError: connect ETIMEDOUT 34.196.170.8:443
        at ClientRequest.<anonymous> (/usr/app/node_modules/got/dist/source/core/index.js:792:25)
        at Object.onceWrapper (node:events:476:26)
        at ClientRequest.emit (node:events:381:22)
        at ClientRequest.origin.emit (/usr/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
        at TLSSocket.socketErrorListener (node:_http_client:472:9)
        at TLSSocket.emit (node:events:369:20)
        at emitErrorNT (node:internal/streams/destroy:188:8)
        at emitErrorCloseNT (node:internal/streams/destroy:153:3)
        at processTicksAndRejections (node:internal/process/task_queues:81:21)
        at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1138:16)

nitanmarcel avatar Jun 03 '21 19:06 nitanmarcel

This seems related to the vps itself, it was unable to get a connection to epicgames.com there

GigaFyde avatar Jun 03 '21 19:06 GigaFyde

This seems related to the vps itself, it was unable to get a connection to epicgames.com there

It's strange tho. Everything else works fine, I'm hosting my matrix server and it works without any problems. Just this has problems 🤔🤔

nitanmarcel avatar Jun 03 '21 20:06 nitanmarcel

This seems related to the vps itself, it was unable to get a connection to epicgames.com there

But I think that if it couldn't make the connection to epic it wouldn't login at all

nitanmarcel avatar Jun 03 '21 20:06 nitanmarcel

Its possible there's a network issue with your vps at the moment. As you're saying it did work before.

Run an mtr to epicgames.com and see if there's any packet loss etc

GigaFyde avatar Jun 03 '21 20:06 GigaFyde

Its possible there's a network issue with your vps at the moment. As you're saying it did work before.

Run an mtr to epicgames.com and see if there's any packet loss etc

Probably the server had a problem. I ran the docker image again got out for a cig and in a couple of minutes I got an email from epic with by purchase

nitanmarcel avatar Jun 03 '21 20:06 nitanmarcel

Happy to hear its working again.

GigaFyde avatar Jun 03 '21 20:06 GigaFyde

@claabs could we have a configurable option to set a retry x times with a delay if something like that happens (connection error/timeout)?

nitanmarcel avatar Jun 03 '21 20:06 nitanmarcel

I think Epic has some sort of AWS WAF bot control policy configured that doesn't like the direct HTTP calls. I see a similar timeout when running on a PIA VPN. But when using a browser, I can still load the homepage.

In your case, a programmatic timeout wouldn't exactly work because it would still have the same VPS instance. I think the second time you tried, it got a new IP that the WAF wasn't as eager to block.

claabs avatar Jun 03 '21 20:06 claabs

I think Epic has some sort of AWS WAF bot control policy configured that doesn't like the direct HTTP calls. I see a similar timeout when running on a PIA VPN. But when using a browser, I can still load the homepage.

In your case, a programmatic timeout wouldn't exactly work because it would still have the same VPS instance. I think the second time you tried, it got a new IP that the WAF wasn't as eager to block.

Ah ok. So there's nothing much I could do excepting the fact that O should make the check run a couple of times per day and hope that the VPS isn't using an IP that's blocked

nitanmarcel avatar Jun 06 '21 08:06 nitanmarcel

I actually figured out what was causing issues when connecting via my VPN. It turns out my VPN was configured for a lower MTU value than my other network interfaces, which led to WSL2 failing all connections over the VPN. I just had to configure WSL2 to use a lower MTU value and the requests started working again.

claabs avatar Sep 01 '21 18:09 claabs