claabs / epicgames-freegames-node

Automatically login and find available free games the Epic Games Store. Sends you a prepopulated checkout link so you can complete the checkout after logging in. Supports multiple accounts, login sessions, and scheduled runs.
https://hub.docker.com/r/charlocharlie/epicgames-freegames
MIT License
1.39k stars 93 forks source link

massive Localtunnel connections and "HTTPS ERROR 408" when retrying the same url #300

Closed zzz6839 closed 1 year ago

zzz6839 commented 1 year ago

Describe the bug

I received a discord notification with "purchase error" and a localtunnel link, then I clicked the link and I saw this:

image

nothing happened after I clicked "try again", so I closed the link and retry it, then I received "HTTP ERROR 408".

However, there are massive connections still alive, with zero bytes of upload/download data, the connections sent out massive requests in a short time unless I manually stopped the docker container.

image image

Screenshots or Logs


[2022-12-19 12:34:37.633 +0800] DEBUG: Getting current weekly free games list
    user: "my.email@gmail.com"
[2022-12-19 12:34:37.638 +0800] DEBUG: Logging in with puppeteer
    user: "my.email@gmail.com"
[2022-12-19 12:34:37.638 +0800] DEBUG: Launching a new browser
    user: "my.email@gmail.com"
[2022-12-19 12:34:38.312 +0800] DEBUG: Launching a new page
    user: "my.email@gmail.com"
[2022-12-19 12:35:06.935 +0800] DEBUG: Getting product info using productSlug
    user: "my.email@gmail.com"
    productSlug: "sable"
    offerType: "OTHERS"
[2022-12-19 12:35:08.052 +0800] DEBUG: Getting global free games
    user: "my.email@gmail.com"
[2022-12-19 12:35:28.261 +0800] DEBUG: Retrieved catalog data for 1032 games
    user: "my.email@gmail.com"
[2022-12-19 12:35:28.262 +0800] DEBUG: Found 1 unique free games in catalog
    user: "my.email@gmail.com"
[2022-12-19 12:35:28.263 +0800] INFO: Available free games
    user: "my.email@gmail.com"
    availableGames: [
      "Sable"
    ]
[2022-12-19 12:35:28.263 +0800] DEBUG: Checking ownership and prerequesites on available games
    user: "my.email@gmail.com"
[2022-12-19 12:35:28.264 +0800] DEBUG: Getting offers validation info
    user: "my.email@gmail.com"
    offerId: "d19627e74ac445bcbcfc8157a35d6f80"
    namespace: "66a0893b7b9a42a695f0a387d64dfcc6"
[2022-12-19 12:35:28.528 +0800] DEBUG: Offers validation response
    user: "my.email@gmail.com"
    offerId: "d19627e74ac445bcbcfc8157a35d6f80"
    namespace: "66a0893b7b9a42a695f0a387d64dfcc6"
    validations: {
      "conflictingOffers": [],
      "missingPrerequisites": [],
      "fullyOwnedOffers": [],
      "possiblePartialUpgradeOffers": [],
      "unablePartiallyUpgradeOffers": []
    }
[2022-12-19 12:35:28.529 +0800] INFO: Unpurchased free games
    user: "my.email@gmail.com"
    purchasableGames: [
      "Sable"
    ]
[2022-12-19 12:35:28.539 +0800] INFO: Purchasing Sable
    user: "my.email@gmail.com"
[2022-12-19 12:35:28.546 +0800] DEBUG: Logging in with puppeteer
    user: "my.email@gmail.com"
[2022-12-19 12:35:28.546 +0800] DEBUG: Launching a new browser
    user: "my.email@gmail.com"
[2022-12-19 12:35:29.509 +0800] DEBUG: Launching a new page
    user: "my.email@gmail.com"
[2022-12-19 12:35:39.697 +0800] INFO: Loading purchase page
    user: "my.email@gmail.com"
    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-6 57a35d6f80&orderId&purchaseToken&showNavigation=true"
[2022-12-19 12:36:02.962 +0800] DEBUG: Waiting for order button or cookie dialog
    user: "my.email@gmail.com"
[2022-12-19 12:36:03.041 +0800] DEBUG: Clicking placeOrderButton
    user: "my.email@gmail.com"
[2022-12-19 12:36:06.140 +0800] DEBUG: Waiting for receipt, captcha, refund dialog, or error
    user: "my.email@gmail.com"
[2022-12-19 12:44:06.626 +0800] WARN: waiting for function failed: timeout 480000ms exceeded
    user: "my.email@gmail.com"
    err: {
      "type": "TimeoutError",
      "message": "waiting for function failed: timeout 480000ms exceeded",
      "stack":
          TimeoutError: waiting for function failed: timeout 480000ms exceeded
              at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:938:28)
              at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:844:22)
              at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1449:28)
              at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3472:29)
              at PuppetPurchase.waitForPurchaseEvent (/usr/app/src/puppet/purchase.ts:36:10)
              at initPurchase (/usr/app/src/puppet/purchase.ts:96:40)
              at processTicksAndRejections (node:internal/process/task_queues:95:5)
              at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:137:7)
              at redeemAccount (/usr/app/src/index.ts:43:9)
              at async Promise.all (index 0)
      "name": "TimeoutError"
    }
[2022-12-19 12:44:06.839 +0800] ERROR: Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.
    user: "my.email@gmail.com"
    errorImage: "config/error-2022-12-19T04-44-06.145Z.png"
    errorHtml: "config/error-2022-12-19T04-44-06.145Z.html"
[2022-12-19 12:44:06.840 +0800] INFO: Asking a human for help...
    user: "my.email@gmail.com"
[2022-12-19 12:44:08.181 +0800] INFO: Go to this URL and do something
    user: "my.email@gmail.com"
    url: "https://polite-emus-sneeze-212-107-28-27.loca.lt/?targetId=4B 6E35361C637A3F08F8D3B"

** Press ANY KEY to close this window ** 

Additional context

hope this problem could be solved, or offer a LocaltunnelConnectionTimeout option to close all the connections.

zzz6839 commented 1 year ago

This issue happened in the Windows Epicgame client as well, security check after clicking the "place order" button, then no response, could be my own network issue with ipv6, however, localtunnel connections spamming is still a thing, so hope there is a solution.

p.s. ipv6 connectivity seems no problem. p.p.s Really odd, I've acquired this game without a problem after rebooting my router, so it is a network related issue, but I cant confirm the relativity between the ipv6 connection and the issue.

image