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.37k stars 93 forks source link

error during browser automation #194

Closed CyberSardinha closed 2 years ago

CyberSardinha commented 2 years ago

Describe the bug It finds a purchasableGames but when it tries to purchase the game if gives an error

Screenshots or Logs error-2021-12-16T23%3A09%3A50 879Z


Setting timezone: Europe/Berlin
Run on startup: true
[2021-12-17 00:10:10.539 +0100] INFO (44 on e09a8e166f26): Checking free games for *********@gmail.com
[2021-12-17 00:10:27.548 +0100] INFO (44 on e09a8e166f26): Successfully refreshed login
user: "*********@gmail.com"
[2021-12-17 00:10:41.849 +0100] INFO (44 on e09a8e166f26): Available free games
user: "**********@gmail.com"
availableGames: [
"Shenmue III - Standard Edition"
]
[2021-12-17 00:10:42.305 +0100] INFO (44 on e09a8e166f26): Unpurchased free games
user: "***********@gmail.com"
purchasableGames: [
"Shenmue III - Standard Edition"
]
[2021-12-17 00:10:42.306 +0100] INFO (44 on e09a8e166f26): Purchasing Shenmue III - Standard Edition
[2021-12-17 00:10:42.306 +0100] WARN (44 on e09a8e166f26): hcaptchaAccessibilityUrl not configured, captchas are less likely to be bypassed. Follow this guide to set it up: https://github.com/claabs/epicgames-freegames-node#hcaptcha-accessibility-cookies
[2021-12-17 00:10:42.305 +0100] INFO (44 on e09a8e166f26): Unpurchased free games
user: "***********@gmail.com"
purchasableGames: [
"Shenmue III - Standard Edition"
]
[2021-12-17 00:10:42.306 +0100] INFO (44 on e09a8e166f26): Purchasing Shenmue III - Standard Edition
[2021-12-17 00:10:42.306 +0100] WARN (44 on e09a8e166f26): hcaptchaAccessibilityUrl not configured, captchas are less likely to be bypassed. Follow this guide to set it up: https://github.com/claabs/epicgames-freegames-node#hcaptcha-accessibility-cookies
[2021-12-17 00:11:19.600 +0100] ERROR (44 on e09a8e166f26): Encountered an error during browser automation. Saved a screenshot for debugging purposes.
claabs commented 2 years ago

Thanks for including the screenshot. I just added that today and you figured it out easily.

There's a couple things this could have been:

  1. Epic has been having issues all day, so it may have been just a random bug
  2. The cookie popup on the screen is preventing it from working
  3. Something else.

In the recent update, I added HTML output alongside the screenshot, so I can see the state of the page in detail. Please update and run it again when you get a chance.

IcyTower1337 commented 2 years ago

This is identical to #194. Please continue this there. There should have been an HTML file output by the error as well. I'll need that to create the query to click the accept cookies button.

Thank you for redirecting me to the right place. I don't seem to have any HTML files on the .config folder, the only output was the .png pictures, am I lacking any specific configuration on the config to also output the HTML files? or could you tell me where the HTML file was created inside the container so I can mount the docker volume and extract it directly.

This is is my docker run docker run --name EpicGamesRedeemBot --restart unless-stopped -d -e TZ=Europe/Lisbon -v C:\Users\Icy\docker\epicgames-freegames-node-2.0.0\.config:/usr/app/config:rw -p 3000:3000 charlocharlie/epicgames-freegames:latest

Thank you again.

claabs commented 2 years ago

Outputting the HTML file was a feature I added recently. You might not be on the latest version that has it. docker pull and it should have it.

IcyTower1337 commented 2 years ago

image image

I already seem to be on the latest version of charlocharlie/epicgames-freegames:latest

claabs commented 2 years ago

Whoops my bad. I forgot to set the path of the output file to the config directory.

The fixed Docker image is pushed now, so please pull and try again.

IcyTower1337 commented 2 years ago

After pulling the latest image the files were created successfully. Attached the error .png and .html files to the zip bellow since github doesn't let me add .html files to the issue.

New Log in case it's useful:

[2021-12-17 19:24:34.643 +0000] INFO  (40 on 71b688c2c36d): Checking free games for acc1@hotmail.com 

[2021-12-17 19:24:40.369 +0000] INFO  (40 on 71b688c2c36d): Successfully refreshed login

    user: "acc1@hotmail.com"

[2021-12-17 19:24:40.369 +0000] INFO  (40 on 71b688c2c36d): searchStrategy is `all`: searching for weekly and promotional games

    user: "acc1@hotmail.com"

[2021-12-17 19:24:57.997 +0000] INFO  (40 on 71b688c2c36d): Available free games

    user: "acc1@hotmail.com"

    availableGames: [

      "Neon Abyss"

    ]

[2021-12-17 19:24:58.324 +0000] INFO  (40 on 71b688c2c36d): Unpurchased free games

    user: "acc1@hotmail.com"

    purchasableGames: [

      "Neon Abyss"

    ]

[2021-12-17 19:24:58.324 +0000] INFO  (40 on 71b688c2c36d): Purchasing Neon Abyss

[2021-12-17 19:25:00.513 +0000] ERROR (40 on 71b688c2c36d): Error encountered during purchase

    user: "acc1@hotmail.com"

    errorBody: {

      "error": true,

      "message": "We could not confirm your purchase at this time.  Please try again later.",

      "order": null,

      "syncToken": "58e918b4-07ee-4c68-bb92-21e3127c48bb"

    }

    code: 400

[2021-12-17 19:25:00.514 +0000] WARN  (HTTPError/40 on 71b688c2c36d): Response code 400 (Bad Request)

    HTTPError: Response code 400 (Bad Request)

        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)

        at processTicksAndRejections (internal/process/task_queues.js:95:5)

[2021-12-17 19:25:00.514 +0000] WARN  (40 on 71b688c2c36d): API purchase experienced an error, trying puppeteer purchase

[2021-12-17 19:25:04.767 +0000] WARN  (40 on 71b688c2c36d): Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies

    status: 401

    errorBody: {

      "status": "error"

    }

[2021-12-17 19:25:05.462 +0000] INFO  (40 on 71b688c2c36d): Loading purchase page

    user: "acc1@hotmail.com"

    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-b0ebefb11a9145488af78f6d2488afff-1ad9b7fca007477ca454d2048d019d2f&orderId&purchaseToken&showNavigation=true"

[2021-12-17 19:25:34.623 +0000] INFO  (40 on 71b688c2c36d): Checking free games for acc2@gmail.com 

[2021-12-17 19:25:40.844 +0000] INFO  (40 on 71b688c2c36d): Successfully refreshed login

    user: "acc2@gmail.com"

[2021-12-17 19:25:40.844 +0000] INFO  (40 on 71b688c2c36d): searchStrategy is `all`: searching for weekly and promotional games

    user: "acc2@gmail.com"

[2021-12-17 19:25:44.679 +0000] ERROR (40 on 71b688c2c36d): Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.

    user: "acc1@hotmail.com"

    errorImage: "config/error-2021-12-17T19:25:44.537Z.png"

    errorHtml: "config/error-2021-12-17T19:25:44.537Z.html"

[2021-12-17 19:25:44.754 +0000] ERROR (TimeoutError/40 on 71b688c2c36d): waiting for function failed: timeout 30000ms exceeded

    TimeoutError: waiting for function failed: timeout 30000ms exceeded

        at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:788:28)

        at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:710:22)

        at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1239:28)

        at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3263:29)

        at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:177:12)

        at redeemAccount (/usr/app/src/index.ts:44:9)

        at async Promise.all (index 1)

        at main (/usr/app/src/index.ts:64:5)

[2021-12-17 19:25:54.682 +0000] INFO  (40 on 71b688c2c36d): Available free games

    user: "acc2@gmail.com"

    availableGames: [

      "Neon Abyss"

    ]

[2021-12-17 19:25:55.024 +0000] INFO  (40 on 71b688c2c36d): Unpurchased free games

    user: "acc2@gmail.com"

    purchasableGames: [

      "Neon Abyss"

    ]

[2021-12-17 19:25:55.024 +0000] INFO  (40 on 71b688c2c36d): Purchasing Neon Abyss

[2021-12-17 19:25:57.240 +0000] ERROR (40 on 71b688c2c36d): Error encountered during purchase

    user: "acc2@gmail.com"

    errorBody: {

      "error": true,

      "message": "We could not confirm your purchase at this time.  Please try again later.",

      "order": null,

      "syncToken": "3fe9796b-4f2f-43ab-9cfb-93a2a5009cea"

    }

    code: 400

[2021-12-17 19:25:57.241 +0000] WARN  (HTTPError/40 on 71b688c2c36d): Response code 400 (Bad Request)

    HTTPError: Response code 400 (Bad Request)

        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)

        at runMicrotasks (<anonymous>)

        at processTicksAndRejections (internal/process/task_queues.js:95:5)

[2021-12-17 19:25:57.241 +0000] WARN  (40 on 71b688c2c36d): API purchase experienced an error, trying puppeteer purchase

[2021-12-17 19:26:01.277 +0000] WARN  (40 on 71b688c2c36d): Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies

    status: 401

    errorBody: {

      "status": "error"

    }

[2021-12-17 19:26:02.027 +0000] INFO  (40 on 71b688c2c36d): Loading purchase page

    user: "acc2@gmail.com"

    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-b0ebefb11a9145488af78f6d2488afff-1ad9b7fca007477ca454d2048d019d2f&orderId&purchaseToken&showNavigation=true"

[2021-12-17 19:26:41.235 +0000] ERROR (40 on 71b688c2c36d): Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.

    user: "acc2@gmail.com"

    errorImage: "config/error-2021-12-17T19:26:41.083Z.png"

    errorHtml: "config/error-2021-12-17T19:26:41.083Z.html"

[2021-12-17 19:26:41.324 +0000] ERROR (TimeoutError/40 on 71b688c2c36d): waiting for function failed: timeout 30000ms exceeded

    TimeoutError: waiting for function failed: timeout 30000ms exceeded

        at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:788:28)

        at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:710:22)

        at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1239:28)

        at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3263:29)

        at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:177:12)

        at redeemAccount (/usr/app/src/index.ts:44:9)

        at async Promise.all (index 2)

        at main (/usr/app/src/index.ts:64:5)

Run once: false

Setting cron schedule as 5 16 * * *

If any additional information is needed let me know.

error.zip

claabs commented 2 years ago

Alright, I pushed a couple attempts to fix it. Please try again.

And thanks for workin with me on this btw. None of my test accounts are able to recreate it.

IcyTower1337 commented 2 years ago

After updating and checking the image it appears as it does remove the cookies request, but it seems as it still isn't able to finish purchasing it, I've attached updated information below... And no worries, glad to be helpful on the project, I'll keep providing information, hope it helps with debugging.

New log (account1_working was the one I manually added the game on, 2 and 3 are the ones from above):

> epicgames-freegames-node@4.0.0 entrypoint-config /usr/app

> node dist/src/entrypoint-config.js

Setting timezone: Europe/Lisbon

Run on startup: true

[2021-12-17 20:56:18.060 +0000] INFO  (40 on d78e566fde88): Checking free games for account1_working 

[2021-12-17 20:56:24.251 +0000] INFO  (40 on d78e566fde88): Successfully refreshed login

    user: "account1_working"

[2021-12-17 20:56:24.252 +0000] INFO  (40 on d78e566fde88): searchStrategy is `all`: searching for weekly and promotional games

    user: "account1_working"

[2021-12-17 20:56:38.461 +0000] INFO  (40 on d78e566fde88): Available free games

    user: "account1_working"

    availableGames: [

      "Neon Abyss"

    ]

[2021-12-17 20:56:38.798 +0000] INFO  (40 on d78e566fde88): Unpurchased free games

    user: "account1_working"

    purchasableGames: []

[2021-12-17 20:57:18.099 +0000] INFO  (40 on d78e566fde88): Checking free games for account2_not_working 

[2021-12-17 20:57:25.836 +0000] INFO  (40 on d78e566fde88): Successfully refreshed login

    user: "account2_not_working"

[2021-12-17 20:57:25.836 +0000] INFO  (40 on d78e566fde88): searchStrategy is `all`: searching for weekly and promotional games

    user: "account2_not_working"

[2021-12-17 20:57:39.526 +0000] INFO  (40 on d78e566fde88): Available free games

    user: "account2_not_working"

    availableGames: [

      "Neon Abyss"

    ]

[2021-12-17 20:57:39.840 +0000] INFO  (40 on d78e566fde88): Unpurchased free games

    user: "account2_not_working"

    purchasableGames: [

      "Neon Abyss"

    ]

[2021-12-17 20:57:39.840 +0000] INFO  (40 on d78e566fde88): Purchasing Neon Abyss

[2021-12-17 20:57:42.081 +0000] ERROR (40 on d78e566fde88): Error encountered during purchase

    user: "account2_not_working"

    errorBody: {

      "error": true,

      "message": "We could not confirm your purchase at this time.  Please try again later.",

      "order": null,

      "syncToken": "8f713499-cbca-4689-8bea-bfa023375cb4"

    }

    code: 400

[2021-12-17 20:57:42.082 +0000] WARN  (HTTPError/40 on d78e566fde88): Response code 400 (Bad Request)

    HTTPError: Response code 400 (Bad Request)

        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)

        at processTicksAndRejections (internal/process/task_queues.js:95:5)

[2021-12-17 20:57:42.083 +0000] WARN  (40 on d78e566fde88): API purchase experienced an error, trying puppeteer purchase

[2021-12-17 20:57:46.260 +0000] WARN  (40 on d78e566fde88): Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies

    status: 401

    errorBody: {

      "status": "error"

    }

[2021-12-17 20:57:47.019 +0000] INFO  (40 on d78e566fde88): Loading purchase page

    user: "account2_not_working"

    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-b0ebefb11a9145488af78f6d2488afff-1ad9b7fca007477ca454d2048d019d2f&orderId&purchaseToken&showNavigation=true"

[2021-12-17 20:58:18.076 +0000] INFO  (40 on d78e566fde88): Checking free games for account3_not_working 

[2021-12-17 20:58:24.035 +0000] INFO  (40 on d78e566fde88): Successfully refreshed login

    user: "account3_not_working"

[2021-12-17 20:58:24.035 +0000] INFO  (40 on d78e566fde88): searchStrategy is `all`: searching for weekly and promotional games

    user: "account3_not_working"

[2021-12-17 20:58:25.886 +0000] ERROR (40 on d78e566fde88): Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.

    user: "account2_not_working"

    errorImage: "config/error-2021-12-17T20-58:25.751Z.png"

    errorHtml: "config/error-2021-12-17T20-58:25.751Z.html"

[2021-12-17 20:58:25.974 +0000] ERROR (TimeoutError/40 on d78e566fde88): waiting for function failed: timeout 30000ms exceeded

    TimeoutError: waiting for function failed: timeout 30000ms exceeded

        at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:788:28)

        at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:710:22)

        at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1239:28)

        at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3263:29)

        at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:190:12)

        at redeemAccount (/usr/app/src/index.ts:44:9)

        at async Promise.all (index 1)

        at main (/usr/app/src/index.ts:64:5)

[2021-12-17 20:58:39.026 +0000] INFO  (40 on d78e566fde88): Available free games

    user: "account3_not_working"

    availableGames: [

      "Neon Abyss"

    ]

[2021-12-17 20:58:39.345 +0000] INFO  (40 on d78e566fde88): Unpurchased free games

    user: "account3_not_working"

    purchasableGames: [

      "Neon Abyss"

    ]

[2021-12-17 20:58:39.345 +0000] INFO  (40 on d78e566fde88): Purchasing Neon Abyss

[2021-12-17 20:58:41.643 +0000] ERROR (40 on d78e566fde88): Error encountered during purchase

    user: "account3_not_working"

    errorBody: {

      "error": true,

      "message": "We could not confirm your purchase at this time.  Please try again later.",

      "order": null,

      "syncToken": "6e12607a-a956-47c5-9199-ea5f24a9a345"

    }

    code: 400

[2021-12-17 20:58:41.643 +0000] WARN  (HTTPError/40 on d78e566fde88): Response code 400 (Bad Request)

    HTTPError: Response code 400 (Bad Request)

        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)

        at runMicrotasks (<anonymous>)

        at processTicksAndRejections (internal/process/task_queues.js:95:5)

[2021-12-17 20:58:41.644 +0000] WARN  (40 on d78e566fde88): API purchase experienced an error, trying puppeteer purchase

[2021-12-17 20:58:45.660 +0000] WARN  (40 on d78e566fde88): Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies

    status: 401

    errorBody: {

      "status": "error"

    }

[2021-12-17 20:58:46.400 +0000] INFO  (40 on d78e566fde88): Loading purchase page

    user: "account3_not_working"

    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-b0ebefb11a9145488af78f6d2488afff-1ad9b7fca007477ca454d2048d019d2f&orderId&purchaseToken&showNavigation=true"

[2021-12-17 20:59:25.584 +0000] ERROR (40 on d78e566fde88): Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.

    user: "account3_not_working"

    errorImage: "config/error-2021-12-17T20-59:25.460Z.png"

    errorHtml: "config/error-2021-12-17T20-59:25.460Z.html"

[2021-12-17 20:59:25.674 +0000] ERROR (TimeoutError/40 on d78e566fde88): waiting for function failed: timeout 30000ms exceeded

    TimeoutError: waiting for function failed: timeout 30000ms exceeded

        at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:788:28)

        at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:710:22)

        at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1239:28)

        at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3263:29)

        at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:190:12)

        at redeemAccount (/usr/app/src/index.ts:44:9)

        at async Promise.all (index 2)

        at main (/usr/app/src/index.ts:64:5)

Run once: false

Setting cron schedule as 5 16 * * *

error-updated.zip

claabs commented 2 years ago

Okay, so here's the deal:

I have a feeling the button press just isn't going through because a network request like order-preview or Talon isn't finished yet. Technically that shouldn't happen since I'm using waitUntil: 'networkidle0' on the goto, but I added an extra waitForNetworkIdle in there for the hell of it. Maybe that will fix it.

Also, I took a nuclear approach, so if any error is thrown during the purchase flow, it will notify you to intervene and press a button if necessary. Some people might not like that, so it can be disabled with noHumanErrorHelp: true in the config.

IcyTower1337 commented 2 years ago

I've tried the fix you pushed and while the automatic process still didn't work and I've added the log and usual HTML and PNG files on the zip I also recorded a gif of myself doing it manually on the second account in case that helps you (but I assume that's also the process you tried to automate), still the manual help is a good and welcome addition, thanks for adding it.

If there's anything else I can help you debug with my setup I'd be glad to help.

newest log:


> epicgames-freegames-node@4.0.0 entrypoint-config /usr/app
> node dist/src/entrypoint-config.js

Setting timezone: Europe/Lisbon
Run on startup: true
[2021-12-17 22:49:35.882 +0000] INFO  (39 on b0a48f7a2309): Checking free games for account1_working 
[2021-12-17 22:49:43.077 +0000] INFO  (39 on b0a48f7a2309): Successfully refreshed login
    user: "account1_working"
[2021-12-17 22:49:43.079 +0000] INFO  (39 on b0a48f7a2309): searchStrategy is `all`: searching for weekly and promotional games
    user: "account1_working"
[2021-12-17 22:49:57.449 +0000] INFO  (39 on b0a48f7a2309): Available free games
    user: "account1_working"
    availableGames: [
      "Neon Abyss"
    ]
[2021-12-17 22:49:57.910 +0000] INFO  (39 on b0a48f7a2309): Unpurchased free games
    user: "account1_working"
    purchasableGames: []
[2021-12-17 22:50:35.919 +0000] INFO  (39 on b0a48f7a2309): Checking free games for account2_not_working 
[2021-12-17 22:50:41.962 +0000] INFO  (39 on b0a48f7a2309): Successfully refreshed login
    user: "account2_not_working"
[2021-12-17 22:50:41.962 +0000] INFO  (39 on b0a48f7a2309): searchStrategy is `all`: searching for weekly and promotional games
    user: "account2_not_working"
[2021-12-17 22:50:55.631 +0000] INFO  (39 on b0a48f7a2309): Available free games
    user: "account2_not_working"
    availableGames: [
      "Neon Abyss"
    ]
[2021-12-17 22:50:56.087 +0000] INFO  (39 on b0a48f7a2309): Unpurchased free games
    user: "account2_not_working"
    purchasableGames: [
      "Neon Abyss"
    ]
[2021-12-17 22:50:56.087 +0000] INFO  (39 on b0a48f7a2309): Purchasing Neon Abyss
[2021-12-17 22:50:58.377 +0000] WARN  (39 on b0a48f7a2309): Error encountered during purchase
    user: "account2_not_working"
    errorBody: {
      "error": true,
      "message": "We could not confirm your purchase at this time.  Please try again later.",
      "order": null,
      "syncToken": "5f540f91-1806-4ebd-93c5-da1201d97302"
    }
    code: 400
[2021-12-17 22:50:58.377 +0000] WARN  (HTTPError/39 on b0a48f7a2309): Response code 400 (Bad Request)
    HTTPError: Response code 400 (Bad Request)
        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-17 22:50:58.378 +0000] WARN  (39 on b0a48f7a2309): API purchase experienced an error, trying puppeteer purchase
[2021-12-17 22:51:03.369 +0000] INFO  (39 on b0a48f7a2309): Loading purchase page
    user: "account2_not_working"
    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-b0ebefb11a9145488af78f6d2488afff-1ad9b7fca007477ca454d2048d019d2f&orderId&purchaseToken&showNavigation=true"
[2021-12-17 22:51:35.898 +0000] INFO  (39 on b0a48f7a2309): Checking free games for account3_not_working 
[2021-12-17 22:51:42.290 +0000] INFO  (39 on b0a48f7a2309): Successfully refreshed login
    user: "account3_not_working"
[2021-12-17 22:51:42.291 +0000] INFO  (39 on b0a48f7a2309): searchStrategy is `all`: searching for weekly and promotional games
    user: "account3_not_working"
[2021-12-17 22:51:45.480 +0000] ERROR (39 on b0a48f7a2309): Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.
    user: "account2_not_working"
    errorImage: "config/error-2021-12-17T22-51-45.325Z.png"
    errorHtml: "config/error-2021-12-17T22-51-45.325Z.html"
[2021-12-17 22:51:45.481 +0000] INFO  (39 on b0a48f7a2309): Asking a human for help...
    user: "account2_not_working"
[2021-12-17 22:51:45.490 +0000] INFO  (39 on b0a48f7a2309): Go to this URL and purchase the game
    user: "account2_not_working"
    url: "http://localhost:3000/?targetId=CE25397DFC2C6980BAC3F67F3468DEFF"
[2021-12-17 22:51:57.549 +0000] INFO  (39 on b0a48f7a2309): Available free games
    user: "account3_not_working"
    availableGames: [
      "Neon Abyss"
    ]
[2021-12-17 22:51:57.895 +0000] INFO  (39 on b0a48f7a2309): Unpurchased free games
    user: "account3_not_working"
    purchasableGames: [
      "Neon Abyss"
    ]
[2021-12-17 22:51:57.896 +0000] INFO  (39 on b0a48f7a2309): Purchasing Neon Abyss
[2021-12-17 22:52:00.528 +0000] WARN  (39 on b0a48f7a2309): Error encountered during purchase
    user: "account3_not_working"
    errorBody: {
      "error": true,
      "message": "We could not confirm your purchase at this time.  Please try again later.",
      "order": null,
      "syncToken": "5bb23acd-b47f-46b0-a236-1d2205ff355e"
    }
    code: 400
[2021-12-17 22:52:00.529 +0000] WARN  (HTTPError/39 on b0a48f7a2309): Response code 400 (Bad Request)
    HTTPError: Response code 400 (Bad Request)
        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-17 22:52:00.529 +0000] WARN  (39 on b0a48f7a2309): API purchase experienced an error, trying puppeteer purchase
[2021-12-17 22:52:06.614 +0000] INFO  (39 on b0a48f7a2309): Loading purchase page
    user: "account3_not_working"
    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-b0ebefb11a9145488af78f6d2488afff-1ad9b7fca007477ca454d2048d019d2f&orderId&purchaseToken&showNavigation=true"
[2021-12-17 22:52:50.039 +0000] ERROR (39 on b0a48f7a2309): Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes.
    user: "account3_not_working"
    errorImage: "config/error-2021-12-17T22-52-49.861Z.png"
    errorHtml: "config/error-2021-12-17T22-52-49.861Z.html"
[2021-12-17 22:52:50.040 +0000] INFO  (39 on b0a48f7a2309): Asking a human for help...
    user: "account3_not_working"
[2021-12-17 22:52:50.045 +0000] INFO  (39 on b0a48f7a2309): Go to this URL and purchase the game
    user: "account3_not_working"
    url: "http://localhost:3000/?targetId=CCCD7E7AE52A2FBB158B3CB169D91FBA"
[2021-12-17 22:53:27.882 +0000] INFO  (39 on b0a48f7a2309): Done purchasing Neon Abyss
[2021-12-17 22:56:43.717 +0000] INFO  (39 on b0a48f7a2309): Done purchasing Neon Abyss
Run once: false
Setting cron schedule as 5 16 * * *

manual-fix.zip

claabs commented 2 years ago

@IcyTower1337 I forgot to mention, next time you run it, can you run with trace log level enabled? I'm wondering if it has something to do with the EU "Refund and Right of Withdrawal Information" dialog box.

Luckily there's a new game every day, so it's pretty easy to test often. 😀

IcyTower1337 commented 2 years ago

Yea, I'd be happy to help, Would you be able to explain how I turn on trace log level? Tried searching for it on the readme and wasn't able to find anything, thank you. I'll also make sure I don't claim the game manually on all of the accounts so I can keep testing the automatic claim method and gather more information.

claabs commented 2 years ago

In the config, just add a "logLevel": "trace", at the root level. More details here: https://claabs.github.io/epicgames-freegames-node/classes/AppConfig.html#logLevel

IcyTower1337 commented 2 years ago

I've just ran it again this time with trace log level now that there was an available game and I'll attach the log down, I've replaced some information like the account e-mails and hcaptcha id.

Additionally it didn't output any PNG or HTML files since I assume the manual workaround prevents the automatic process from failing and creating the PNG and HTML files.

I've purposefully not claimed the game in any account so I can keep testing, if you need any additional information let me know.

new log (there was some missing information on the top of the log since docker doesn't go far back enough to see everything):

    }
[2021-12-18 17:29:54.103 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account1"
    offerId: "c7742701d2b6470fae612437b05cf3e1"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:29:54.103 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account1"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "c7742701d2b6470fae612437b05cf3e1",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:29:54.105 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account1"
    offerId: "c3a4300ca5fb498b91008b7e5fe5778e"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:29:54.105 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account1"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "c3a4300ca5fb498b91008b7e5fe5778e",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:29:54.437 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account1"
    offerId: "c7742701d2b6470fae612437b05cf3e1"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:29:54.441 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account1"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: true
[2021-12-18 17:29:54.451 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account1"
    offerId: "c3a4300ca5fb498b91008b7e5fe5778e"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:29:54.453 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account1"
    offerId: "4d5a7cd6f04a4d1fbb8ba0136c9ce988"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:29:54.454 +0000] DEBUG (40 on 5c54758c7f6e): Getting global free games
    user: "account1"
[2021-12-18 17:29:54.454 +0000] TRACE (40 on 5c54758c7f6e): Posting for all games in catalog
    user: "account1"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "allowCountries": "US",
      "category": "games/edition/base|software/edition/base|editors|bundles/games",
      "count": 1000,
      "country": "US",
      "effectiveDate": "[,2021-12-18T17:29:54.454Z]",
      "keywords": "",
      "locale": "en-US",
      "onSale": true,
      "sortBy": "relevancy",
      "sortDir": "DESC",
      "start": 0,
      "tag": "",
      "withPrice": true
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "0304d711e653a2914f3213a6d9163cc17153c60aef0ef52279731b02779231d2"
      }
    }
[2021-12-18 17:30:08.609 +0000] DEBUG (40 on 5c54758c7f6e): Retrieved catalog data for 598 games
    user: "account1"
[2021-12-18 17:30:08.610 +0000] TRACE (40 on 5c54758c7f6e): Found 1 free games in catalog
    user: "account1"
[2021-12-18 17:30:08.610 +0000] DEBUG (40 on 5c54758c7f6e): Found 1 unique free games in catalog
    user: "account1"
[2021-12-18 17:30:08.610 +0000] TRACE (40 on 5c54758c7f6e): Free games in catalog
    user: "account1"
    offers: [
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      }
    ]
[2021-12-18 17:30:08.610 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account1"
    dupedFreeGames: [
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      },
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      }
    ]
[2021-12-18 17:30:08.611 +0000] INFO  (40 on 5c54758c7f6e): Available free games
    user: "account1"
    availableGames: [
      "Remnant: From the Ashes"
    ]
[2021-12-18 17:30:08.611 +0000] DEBUG (40 on 5c54758c7f6e): Checking ownership on available games
    user: "account1"
[2021-12-18 17:30:08.612 +0000] DEBUG (40 on 5c54758c7f6e): Getting product ownership info
    user: "account1"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:30:08.612 +0000] TRACE (40 on 5c54758c7f6e): Posting for offer entitlement
    user: "account1"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "803d00fd80aef2cbb0b998ba27b761143d228195b86cc8af55e73002f18a1678"
      }
    }
[2021-12-18 17:30:09.139 +0000] TRACE (40 on 5c54758c7f6e): Entitlement response
    user: "account1"
    resp: {
      "Launcher": {
        "entitledOfferItems": {
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "entitledToAllItemsInOffer": true,
          "entitledToAnyItemInOffer": true
        }
      }
    }
[2021-12-18 17:30:09.139 +0000] INFO  (40 on 5c54758c7f6e): Unpurchased free games
    user: "account1"
    purchasableGames: []
[2021-12-18 17:30:48.312 +0000] INFO  (40 on 5c54758c7f6e): Checking free games for account2 
[2021-12-18 17:30:48.344 +0000] DEBUG (40 on 5c54758c7f6e): Refreshing login session
    user: "account2"
[2021-12-18 17:30:48.345 +0000] TRACE (40 on 5c54758c7f6e): Request store homepage
    user: "account2"
    url: "https://www.epicgames.com/store/"
[2021-12-18 17:30:49.274 +0000] TRACE (40 on 5c54758c7f6e): Reputation request
    user: "account2"
    url: "https://www.epicgames.com/id/api/reputation"
[2021-12-18 17:30:49.621 +0000] TRACE (40 on 5c54758c7f6e): Location request
    user: "account2"
    url: "https://www.epicgames.com/id/api/location"
[2021-12-18 17:30:49.963 +0000] TRACE (40 on 5c54758c7f6e): Client redirect request
    user: "account2"
    params: {
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/client/875a3b57d3a640a6b7f9b4e883463ab4"
[2021-12-18 17:30:50.291 +0000] TRACE (40 on 5c54758c7f6e): Client redirect response
    user: "account2"
    resp: {
      "clientId": "875a3b57d3a640a6b7f9b4e883463ab4",
      "clientName": "dieselWebsite",
      "redirectUrl": "https://www.epicgames.com/store",
      "internal": true,
      "native": false,
      "product": "store",
      "allowedScope": [],
      "epicLoginOnly": false
    }
[2021-12-18 17:30:50.292 +0000] TRACE (40 on 5c54758c7f6e): Authenticate request
    user: "account2"
    url: "https://www.epicgames.com/id/api/authenticate"
[2021-12-18 17:30:50.664 +0000] TRACE (40 on 5c54758c7f6e): Authenticate response
    user: "account2"
    resp: ""
[2021-12-18 17:30:50.664 +0000] TRACE (40 on 5c54758c7f6e): Redirect request
    user: "account2"
    params: {
      "clientId": "875a3b57d3a640a6b7f9b4e883463ab4",
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2021-12-18 17:30:51.075 +0000] TRACE (40 on 5c54758c7f6e): Redirect response
    user: "account2"
    resp: {
      "redirectUrl": "https://www.epicgames.com/store/",
      "authorizationCode": null,
      "sid": "868e609c1f2b40bf9a511816c3b25acc"
    }
[2021-12-18 17:30:51.075 +0000] TRACE (40 on 5c54758c7f6e): Set SID request
    user: "account2"
    params: {
      "sid": "868e609c1f2b40bf9a511816c3b25acc"
    }
    url: "https://www.unrealengine.com/id/api/set-sid"
[2021-12-18 17:30:51.696 +0000] TRACE (40 on 5c54758c7f6e): Set SID response headers
    user: "account2"
    headers: {
      "date": "Sat, 18 Dec 2021 17:30:49 GMT",
      "connection": "close",
      "x-powered-by": "PHP 7.2.7",
      "vary": "Origin",
      "access-control-allow-credentials": "true",
      "content-language": "en-US",
      "surrogate-control": "no-store",
      "cache-control": "no-store, no-cache, must-revalidate, proxy-revalidate, no-cache",
      "pragma": "no-cache",
      "expires": "0",
      "x-content-type-options": "nosniff",
      "x-frame-options": "SAMEORIGIN",
      "x-xss-protection": "1; mode=block",
      "referrer-policy": "same-origin",
      "content-security-policy": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
      "x-content-security-policy": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
      "x-webkit-csp": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
      "strict-transport-security": "max-age=15552000; includeSubDomains",
      "set-cookie": [
        "EPIC_SSO=01fdf7fc904e43b893607cea91a48c1a; Max-Age=28800; Domain=.unrealengine.com; Path=/; Expires=Sun, 19 Dec 2021 01:30:49 GMT; HttpOnly; Secure; SameSite=None",
        "EPIC_BEARER_TOKEN=1be5c372c40f4ea7a4304545bb67d5a1; Max-Age=28800; Domain=.unrealengine.com; Path=/; Expires=Sun, 19 Dec 2021 01:30:49 GMT; HttpOnly; Secure; SameSite=None",
        "EPIC_SSO_RM=01fdf7fc904e43b893607cea91a48c1a; Max-Age=2592000; Domain=.unrealengine.com; Path=/; Expires=Mon, 17 Jan 2022 17:30:49 GMT; HttpOnly; Secure; SameSite=None"
      ]
    }
[2021-12-18 17:30:51.697 +0000] TRACE (40 on 5c54758c7f6e): Request store homepage
    user: "account2"
    url: "https://www.epicgames.com/store/"
[2021-12-18 17:30:53.636 +0000] INFO  (40 on 5c54758c7f6e): Successfully refreshed login
    user: "account2"
[2021-12-18 17:30:53.636 +0000] INFO  (40 on 5c54758c7f6e): searchStrategy is `all`: searching for weekly and promotional games
    user: "account2"
[2021-12-18 17:30:53.636 +0000] DEBUG (40 on 5c54758c7f6e): Getting current weekly free games list
    user: "account2"
[2021-12-18 17:30:53.636 +0000] TRACE (40 on 5c54758c7f6e): Getting free games list
    user: "account2"
    url: "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
    searchParams: {
      "locale": "en",
      "country": "US",
      "allowCountries": "US"
    }
[2021-12-18 17:30:53.789 +0000] DEBUG (40 on 5c54758c7f6e): Getting product info using productSlug
    user: "account2"
    productSlug: "remnant-from-the-ashes"
[2021-12-18 17:30:53.789 +0000] TRACE (40 on 5c54758c7f6e): Getting product info
    user: "account2"
    url: "https://store-content-ipv4.ak.epicgames.com/api/en-US/content/products/remnant-from-the-ashes"
[2021-12-18 17:30:53.901 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account2"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:30:53.901 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account2"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:30:53.902 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account2"
    offerId: "4d5a7cd6f04a4d1fbb8ba0136c9ce988"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:30:53.903 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account2"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "4d5a7cd6f04a4d1fbb8ba0136c9ce988",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:30:53.904 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account2"
    offerId: "c7742701d2b6470fae612437b05cf3e1"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:30:53.904 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account2"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "c7742701d2b6470fae612437b05cf3e1",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:30:53.905 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account2"
    offerId: "c3a4300ca5fb498b91008b7e5fe5778e"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:30:53.905 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account2"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "c3a4300ca5fb498b91008b7e5fe5778e",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:30:54.253 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account2"
    offerId: "c3a4300ca5fb498b91008b7e5fe5778e"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:30:54.254 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account2"
    offerId: "c7742701d2b6470fae612437b05cf3e1"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:30:54.257 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account2"
    offerId: "4d5a7cd6f04a4d1fbb8ba0136c9ce988"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:30:54.282 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account2"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: true
[2021-12-18 17:30:54.283 +0000] DEBUG (40 on 5c54758c7f6e): Getting global free games
    user: "account2"
[2021-12-18 17:30:54.283 +0000] TRACE (40 on 5c54758c7f6e): Posting for all games in catalog
    user: "account2"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "allowCountries": "US",
      "category": "games/edition/base|software/edition/base|editors|bundles/games",
      "count": 1000,
      "country": "US",
      "effectiveDate": "[,2021-12-18T17:30:54.283Z]",
      "keywords": "",
      "locale": "en-US",
      "onSale": true,
      "sortBy": "relevancy",
      "sortDir": "DESC",
      "start": 0,
      "tag": "",
      "withPrice": true
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "0304d711e653a2914f3213a6d9163cc17153c60aef0ef52279731b02779231d2"
      }
    }
[2021-12-18 17:31:07.108 +0000] DEBUG (40 on 5c54758c7f6e): Retrieved catalog data for 598 games
    user: "account2"
[2021-12-18 17:31:07.109 +0000] TRACE (40 on 5c54758c7f6e): Found 1 free games in catalog
    user: "account2"
[2021-12-18 17:31:07.110 +0000] DEBUG (40 on 5c54758c7f6e): Found 1 unique free games in catalog
    user: "account2"
[2021-12-18 17:31:07.110 +0000] TRACE (40 on 5c54758c7f6e): Free games in catalog
    user: "account2"
    offers: [
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      }
    ]
[2021-12-18 17:31:07.111 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account2"
    dupedFreeGames: [
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      },
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      }
    ]
[2021-12-18 17:31:07.111 +0000] INFO  (40 on 5c54758c7f6e): Available free games
    user: "account2"
    availableGames: [
      "Remnant: From the Ashes"
    ]
[2021-12-18 17:31:07.112 +0000] DEBUG (40 on 5c54758c7f6e): Checking ownership on available games
    user: "account2"
[2021-12-18 17:31:07.112 +0000] DEBUG (40 on 5c54758c7f6e): Getting product ownership info
    user: "account2"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:31:07.112 +0000] TRACE (40 on 5c54758c7f6e): Posting for offer entitlement
    user: "account2"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "803d00fd80aef2cbb0b998ba27b761143d228195b86cc8af55e73002f18a1678"
      }
    }
[2021-12-18 17:31:07.431 +0000] TRACE (40 on 5c54758c7f6e): Entitlement response
    user: "account2"
    resp: {
      "Launcher": {
        "entitledOfferItems": {
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "entitledToAllItemsInOffer": false,
          "entitledToAnyItemInOffer": false
        }
      }
    }
[2021-12-18 17:31:07.431 +0000] INFO  (40 on 5c54758c7f6e): Unpurchased free games
    user: "account2"
    purchasableGames: [
      "Remnant: From the Ashes"
    ]
[2021-12-18 17:31:07.432 +0000] INFO  (40 on 5c54758c7f6e): Purchasing Remnant: From the Ashes
[2021-12-18 17:31:07.432 +0000] TRACE (40 on 5c54758c7f6e): Request for purchase token
    user: "account2"
    searchParams: {
      "namespace": "663e521f2a444199be58152fd93fa66e",
      "offers": "a0bb13a219f747f88dff4c2a50b070c0"
    }
    url: "https://www.epicgames.com/store/purchase"
[2021-12-18 17:31:08.556 +0000] DEBUG (40 on 5c54758c7f6e): purchaseToken
    user: "account2"
    purchaseToken: "8405f84317014e3cbec20ea40ae71aa7"
[2021-12-18 17:31:08.556 +0000] TRACE (40 on 5c54758c7f6e): Order preview request
    user: "account2"
    body: {
      "canQuickPurchase": false,
      "country": "US",
      "eulaId": null,
      "lineOffers": [
        {
          "appliedNsOfferIds": [],
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "quantity": 1,
          "title": "Remnant: From the Ashes",
          "upgradePathId": null
        }
      ],
      "locale": "en_US",
      "offers": null,
      "setDefault": false,
      "syncToken": "",
      "useDefaultBillingAccount": true
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/order-preview"
[2021-12-18 17:31:09.154 +0000] TRACE (40 on 5c54758c7f6e): Order preview response
    user: "account2"
[2021-12-18 17:31:09.154 +0000] TRACE (40 on 5c54758c7f6e): Confirm order request
    user: "account2"
    body: {
      "eulaId": null,
      "useDefaultBillingAccount": false,
      "country": "US",
      "offers": null,
      "lineOffers": [
        {
          "appliedNsOfferIds": [],
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "quantity": 1,
          "title": "Remnant: From the Ashes",
          "upgradePathId": null
        }
      ],
      "totalAmount": 0,
      "setDefault": false,
      "syncToken": "9beb1cd4-8782-46a5-9795-8e87d1b82048",
      "canQuickPurchase": true,
      "locale": "en_US",
      "affiliateId": "",
      "creatorSource": ""
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2021-12-18 17:31:09.604 +0000] WARN  (40 on 5c54758c7f6e): Error encountered during purchase
    user: "account2"
    errorBody: {
      "error": true,
      "message": "We could not confirm your purchase at this time.  Please try again later.",
      "order": null,
      "syncToken": "551cd5ba-3ac4-44c7-8aca-34207c166bea"
    }
    code: 400
[2021-12-18 17:31:09.605 +0000] WARN  (HTTPError/40 on 5c54758c7f6e): Response code 400 (Bad Request)
    HTTPError: Response code 400 (Bad Request)
        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-18 17:31:09.605 +0000] WARN  (40 on 5c54758c7f6e): API purchase experienced an error, trying puppeteer purchase
[2021-12-18 17:31:09.623 +0000] DEBUG (40 on 5c54758c7f6e): Setting hCaptcha accessibility cookies
[2021-12-18 17:31:09.983 +0000] TRACE (40 on 5c54758c7f6e): devtools://devtools/bundled/inspector.html?ws=127.0.0.1:45683/devtools/page/9D5A343DCFDFEB181268134B62B36836
[2021-12-18 17:31:09.984 +0000] TRACE (40 on 5c54758c7f6e): Navigating to https://accounts.hcaptcha.com/verify_email/hcaptchaID
[2021-12-18 17:31:12.920 +0000] TRACE (40 on 5c54758c7f6e): Waiting for setAccessibilityCookie button
[2021-12-18 17:31:12.932 +0000] TRACE (40 on 5c54758c7f6e): Clicking setAccessibilityCookie button
[2021-12-18 17:31:13.751 +0000] DEBUG (40 on 5c54758c7f6e): Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies
    status: 401
    errorBody: {
      "status": "error"
    }
[2021-12-18 17:31:13.752 +0000] TRACE (40 on 5c54758c7f6e): Saving new cookies
[2021-12-18 17:31:13.842 +0000] DEBUG (40 on 5c54758c7f6e): Purchasing with puppeteer (short)
    user: "account2"
[2021-12-18 17:31:14.123 +0000] TRACE (40 on 5c54758c7f6e): devtools://devtools/bundled/inspector.html?ws=127.0.0.1:32991/devtools/page/88D4D71D5F84CFC2620E16EE2ACC8EAA
    user: "account2"
[2021-12-18 17:31:14.510 +0000] INFO  (40 on 5c54758c7f6e): Loading purchase page
    user: "account2"
    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-663e521f2a444199be58152fd93fa66e-a0bb13a219f747f88dff4c2a50b070c0&orderId&purchaseToken&showNavigation=true"
[2021-12-18 17:31:22.911 +0000] TRACE (40 on 5c54758c7f6e): Waiting for cookieDialog
    user: "account2"
[2021-12-18 17:31:25.913 +0000] TRACE (40 on 5c54758c7f6e): No cookie dialog presented
    user: "account2"
[2021-12-18 17:31:25.913 +0000] TRACE (40 on 5c54758c7f6e): Waiting for placeOrderButton
    user: "account2"
[2021-12-18 17:31:25.922 +0000] TRACE (40 on 5c54758c7f6e): Clicking placeOrderButton
    user: "account2"
[2021-12-18 17:31:26.091 +0000] TRACE (40 on 5c54758c7f6e): Clicking euRefundAgreeButton
    user: "account2"
[2021-12-18 17:31:26.262 +0000] DEBUG (40 on 5c54758c7f6e): Waiting for receipt
    user: "account2"
[2021-12-18 17:31:26.704 +0000] TRACE (40 on 5c54758c7f6e): Waiting for hcaptcha iframe
    user: "account2"
[2021-12-18 17:31:28.229 +0000] DEBUG (40 on 5c54758c7f6e): Captcha detected
    user: "account2"
[2021-12-18 17:31:28.238 +0000] INFO  (40 on 5c54758c7f6e): Go to this URL and do something
    user: "account2"
    url: "http://localhost:3000/?targetId=88D4D71D5F84CFC2620E16EE2ACC8EAA"
[2021-12-18 17:31:28.242 +0000] TRACE (40 on 5c54758c7f6e): Sending email
    user: "account2"
    reason: "PURCHASE"
[2021-12-18 17:31:29.810 +0000] DEBUG (40 on 5c54758c7f6e): Email sent.
    user: "account2"
    reason: "PURCHASE"
    from: "account1"
    to: "notification_email"
[2021-12-18 17:31:48.286 +0000] INFO  (40 on 5c54758c7f6e): Checking free games for account3 
[2021-12-18 17:31:48.308 +0000] DEBUG (40 on 5c54758c7f6e): Refreshing login session
    user: "account3"
[2021-12-18 17:31:48.308 +0000] TRACE (40 on 5c54758c7f6e): Request store homepage
    user: "account3"
    url: "https://www.epicgames.com/store/"
[2021-12-18 17:31:49.198 +0000] TRACE (40 on 5c54758c7f6e): Reputation request
    user: "account3"
    url: "https://www.epicgames.com/id/api/reputation"
[2021-12-18 17:31:49.545 +0000] TRACE (40 on 5c54758c7f6e): Location request
    user: "account3"
    url: "https://www.epicgames.com/id/api/location"
[2021-12-18 17:31:49.886 +0000] TRACE (40 on 5c54758c7f6e): Client redirect request
    user: "account3"
    params: {
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/client/875a3b57d3a640a6b7f9b4e883463ab4"
[2021-12-18 17:31:50.212 +0000] TRACE (40 on 5c54758c7f6e): Client redirect response
    user: "account3"
    resp: {
      "clientId": "875a3b57d3a640a6b7f9b4e883463ab4",
      "clientName": "dieselWebsite",
      "redirectUrl": "https://www.epicgames.com/store",
      "internal": true,
      "native": false,
      "product": "store",
      "allowedScope": [],
      "epicLoginOnly": false
    }
[2021-12-18 17:31:50.213 +0000] TRACE (40 on 5c54758c7f6e): Authenticate request
    user: "account3"
    url: "https://www.epicgames.com/id/api/authenticate"
[2021-12-18 17:31:50.585 +0000] TRACE (40 on 5c54758c7f6e): Authenticate response
    user: "account3"
    resp: ""
[2021-12-18 17:31:50.585 +0000] TRACE (40 on 5c54758c7f6e): Redirect request
    user: "account3"
    params: {
      "clientId": "875a3b57d3a640a6b7f9b4e883463ab4",
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2021-12-18 17:31:50.974 +0000] TRACE (40 on 5c54758c7f6e): Redirect response
    user: "account3"
    resp: {
      "redirectUrl": "https://www.epicgames.com/store/",
      "authorizationCode": null,
      "sid": "e376fb5828364958b9f34e8c966c3427"
    }
[2021-12-18 17:31:50.975 +0000] TRACE (40 on 5c54758c7f6e): Set SID request
    user: "account3"
    params: {
      "sid": "e376fb5828364958b9f34e8c966c3427"
    }
    url: "https://www.unrealengine.com/id/api/set-sid"
[2021-12-18 17:31:51.444 +0000] TRACE (40 on 5c54758c7f6e): Set SID response headers
    user: "account3"
    headers: {
      "date": "Sat, 18 Dec 2021 17:31:49 GMT",
      "connection": "close",
      "x-powered-by": "PHP 7.2.7",
      "vary": "Origin",
      "access-control-allow-credentials": "true",
      "content-language": "en-US",
      "surrogate-control": "no-store",
      "cache-control": "no-store, no-cache, must-revalidate, proxy-revalidate, no-cache",
      "pragma": "no-cache",
      "expires": "0",
      "x-content-type-options": "nosniff",
      "x-frame-options": "SAMEORIGIN",
      "x-xss-protection": "1; mode=block",
      "referrer-policy": "same-origin",
      "content-security-policy": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
      "x-content-security-policy": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
      "x-webkit-csp": "default-src 'self'; style-src 'self' static-assets-prod.epicgames.com static-assets-prod.unrealengine.com",
      "strict-transport-security": "max-age=15552000; includeSubDomains",
      "set-cookie": [
        "EPIC_SSO=d79f308d534b45468361db2b33e3a6ac; Max-Age=28800; Domain=.unrealengine.com; Path=/; Expires=Sun, 19 Dec 2021 01:31:49 GMT; HttpOnly; Secure; SameSite=None",
        "EPIC_BEARER_TOKEN=6268830c455248f3ad016318ddafa683; Max-Age=28800; Domain=.unrealengine.com; Path=/; Expires=Sun, 19 Dec 2021 01:31:49 GMT; HttpOnly; Secure; SameSite=None",
        "EPIC_SSO_RM=d79f308d534b45468361db2b33e3a6ac; Max-Age=2592000; Domain=.unrealengine.com; Path=/; Expires=Mon, 17 Jan 2022 17:31:49 GMT; HttpOnly; Secure; SameSite=None"
      ]
    }
[2021-12-18 17:31:51.445 +0000] TRACE (40 on 5c54758c7f6e): Request store homepage
    user: "account3"
    url: "https://www.epicgames.com/store/"
[2021-12-18 17:31:53.447 +0000] INFO  (40 on 5c54758c7f6e): Successfully refreshed login
    user: "account3"
[2021-12-18 17:31:53.448 +0000] INFO  (40 on 5c54758c7f6e): searchStrategy is `all`: searching for weekly and promotional games
    user: "account3"
[2021-12-18 17:31:53.448 +0000] DEBUG (40 on 5c54758c7f6e): Getting current weekly free games list
    user: "account3"
[2021-12-18 17:31:53.448 +0000] TRACE (40 on 5c54758c7f6e): Getting free games list
    user: "account3"
    url: "https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions"
    searchParams: {
      "locale": "en",
      "country": "US",
      "allowCountries": "US"
    }
[2021-12-18 17:31:53.877 +0000] DEBUG (40 on 5c54758c7f6e): Getting product info using productSlug
    user: "account3"
    productSlug: "remnant-from-the-ashes"
[2021-12-18 17:31:53.877 +0000] TRACE (40 on 5c54758c7f6e): Getting product info
    user: "account3"
    url: "https://store-content-ipv4.ak.epicgames.com/api/en-US/content/products/remnant-from-the-ashes"
[2021-12-18 17:31:53.964 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account3"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:31:53.964 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account3"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:31:53.965 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account3"
    offerId: "4d5a7cd6f04a4d1fbb8ba0136c9ce988"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:31:53.966 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account3"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "4d5a7cd6f04a4d1fbb8ba0136c9ce988",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:31:53.966 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account3"
    offerId: "c7742701d2b6470fae612437b05cf3e1"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:31:53.967 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account3"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "c7742701d2b6470fae612437b05cf3e1",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:31:53.968 +0000] TRACE (40 on 5c54758c7f6e): Getting offer details
    user: "account3"
    offerId: "c3a4300ca5fb498b91008b7e5fe5778e"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:31:53.968 +0000] TRACE (40 on 5c54758c7f6e): Posting for catalog offer
    user: "account3"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "locale": "en-US",
      "country": "US",
      "offerId": "c3a4300ca5fb498b91008b7e5fe5778e",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "3fe02aae98bea508d894173f8bcd8a379f0959ff4b3e1bd2c31183260578922a"
      }
    }
[2021-12-18 17:31:54.309 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account3"
    offerId: "4d5a7cd6f04a4d1fbb8ba0136c9ce988"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:31:54.323 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account3"
    offerId: "c3a4300ca5fb498b91008b7e5fe5778e"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:31:54.326 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account3"
    offerId: "c7742701d2b6470fae612437b05cf3e1"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: false
[2021-12-18 17:31:54.330 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account3"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
    isFree: true
[2021-12-18 17:31:54.331 +0000] DEBUG (40 on 5c54758c7f6e): Getting global free games
    user: "account3"
[2021-12-18 17:31:54.331 +0000] TRACE (40 on 5c54758c7f6e): Posting for all games in catalog
    user: "account3"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "allowCountries": "US",
      "category": "games/edition/base|software/edition/base|editors|bundles/games",
      "count": 1000,
      "country": "US",
      "effectiveDate": "[,2021-12-18T17:31:54.331Z]",
      "keywords": "",
      "locale": "en-US",
      "onSale": true,
      "sortBy": "relevancy",
      "sortDir": "DESC",
      "start": 0,
      "tag": "",
      "withPrice": true
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "0304d711e653a2914f3213a6d9163cc17153c60aef0ef52279731b02779231d2"
      }
    }
[2021-12-18 17:32:07.044 +0000] DEBUG (40 on 5c54758c7f6e): Retrieved catalog data for 598 games
    user: "account3"
[2021-12-18 17:32:07.045 +0000] TRACE (40 on 5c54758c7f6e): Found 1 free games in catalog
    user: "account3"
[2021-12-18 17:32:07.045 +0000] DEBUG (40 on 5c54758c7f6e): Found 1 unique free games in catalog
    user: "account3"
[2021-12-18 17:32:07.045 +0000] TRACE (40 on 5c54758c7f6e): Free games in catalog
    user: "account3"
    offers: [
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      }
    ]
[2021-12-18 17:32:07.045 +0000] TRACE (40 on 5c54758c7f6e):
    user: "account3"
    dupedFreeGames: [
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      },
      {
        "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
        "offerNamespace": "663e521f2a444199be58152fd93fa66e",
        "productName": "Remnant: From the Ashes",
        "productSlug": "remnant-from-the-ashes"
      }
    ]
[2021-12-18 17:32:07.046 +0000] INFO  (40 on 5c54758c7f6e): Available free games
    user: "account3"
    availableGames: [
      "Remnant: From the Ashes"
    ]
[2021-12-18 17:32:07.046 +0000] DEBUG (40 on 5c54758c7f6e): Checking ownership on available games
    user: "account3"
[2021-12-18 17:32:07.047 +0000] DEBUG (40 on 5c54758c7f6e): Getting product ownership info
    user: "account3"
    offerId: "a0bb13a219f747f88dff4c2a50b070c0"
    namespace: "663e521f2a444199be58152fd93fa66e"
[2021-12-18 17:32:07.047 +0000] TRACE (40 on 5c54758c7f6e): Posting for offer entitlement
    user: "account3"
    url: "https://www.epicgames.com/graphql"
    variables: {
      "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
      "sandboxId": "663e521f2a444199be58152fd93fa66e"
    }
    extensions: {
      "persistedQuery": {
        "version": 1,
        "sha256Hash": "803d00fd80aef2cbb0b998ba27b761143d228195b86cc8af55e73002f18a1678"
      }
    }
[2021-12-18 17:32:07.391 +0000] TRACE (40 on 5c54758c7f6e): Entitlement response
    user: "account3"
    resp: {
      "Launcher": {
        "entitledOfferItems": {
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "entitledToAllItemsInOffer": false,
          "entitledToAnyItemInOffer": false
        }
      }
    }
[2021-12-18 17:32:07.392 +0000] INFO  (40 on 5c54758c7f6e): Unpurchased free games
    user: "account3"
    purchasableGames: [
      "Remnant: From the Ashes"
    ]
[2021-12-18 17:32:07.392 +0000] INFO  (40 on 5c54758c7f6e): Purchasing Remnant: From the Ashes
[2021-12-18 17:32:07.392 +0000] TRACE (40 on 5c54758c7f6e): Request for purchase token
    user: "account3"
    searchParams: {
      "namespace": "663e521f2a444199be58152fd93fa66e",
      "offers": "a0bb13a219f747f88dff4c2a50b070c0"
    }
    url: "https://www.epicgames.com/store/purchase"
[2021-12-18 17:32:08.542 +0000] DEBUG (40 on 5c54758c7f6e): purchaseToken
    user: "account3"
    purchaseToken: "58992b9ad046481c996843324f6ebd2d"
[2021-12-18 17:32:08.542 +0000] TRACE (40 on 5c54758c7f6e): Order preview request
    user: "account3"
    body: {
      "canQuickPurchase": false,
      "country": "US",
      "eulaId": null,
      "lineOffers": [
        {
          "appliedNsOfferIds": [],
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "quantity": 1,
          "title": "Remnant: From the Ashes",
          "upgradePathId": null
        }
      ],
      "locale": "en_US",
      "offers": null,
      "setDefault": false,
      "syncToken": "",
      "useDefaultBillingAccount": true
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/order-preview"
[2021-12-18 17:32:09.150 +0000] TRACE (40 on 5c54758c7f6e): Order preview response
    user: "account3"
[2021-12-18 17:32:09.150 +0000] TRACE (40 on 5c54758c7f6e): Confirm order request
    user: "account3"
    body: {
      "eulaId": null,
      "useDefaultBillingAccount": false,
      "country": "US",
      "offers": null,
      "lineOffers": [
        {
          "appliedNsOfferIds": [],
          "namespace": "663e521f2a444199be58152fd93fa66e",
          "offerId": "a0bb13a219f747f88dff4c2a50b070c0",
          "quantity": 1,
          "title": "Remnant: From the Ashes",
          "upgradePathId": null
        }
      ],
      "totalAmount": 0,
      "setDefault": false,
      "syncToken": "200ccbb6-4300-439a-8d02-66e70522ada0",
      "canQuickPurchase": true,
      "locale": "en_US",
      "affiliateId": "",
      "creatorSource": ""
    }
    url: "https://payment-website-pci.ol.epicgames.com/purchase/confirm-order"
[2021-12-18 17:32:09.606 +0000] WARN  (40 on 5c54758c7f6e): Error encountered during purchase
    user: "account3"
    errorBody: {
      "error": true,
      "message": "We could not confirm your purchase at this time.  Please try again later.",
      "order": null,
      "syncToken": "3d7f8b3e-88da-494e-9c29-1aadc142126f"
    }
    code: 400
[2021-12-18 17:32:09.607 +0000] WARN  (HTTPError/40 on 5c54758c7f6e): Response code 400 (Bad Request)
    HTTPError: Response code 400 (Bad Request)
        at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-18 17:32:09.607 +0000] WARN  (40 on 5c54758c7f6e): API purchase experienced an error, trying puppeteer purchase
[2021-12-18 17:32:09.615 +0000] DEBUG (40 on 5c54758c7f6e): Setting hCaptcha accessibility cookies
[2021-12-18 17:32:09.885 +0000] TRACE (40 on 5c54758c7f6e): devtools://devtools/bundled/inspector.html?ws=127.0.0.1:42607/devtools/page/4C6C66C7E6DA95A8AA03396495696A38
[2021-12-18 17:32:09.886 +0000] TRACE (40 on 5c54758c7f6e): Navigating to https://accounts.hcaptcha.com/verify_email/hcaptchaID
[2021-12-18 17:32:12.868 +0000] TRACE (40 on 5c54758c7f6e): Waiting for setAccessibilityCookie button
[2021-12-18 17:32:12.879 +0000] TRACE (40 on 5c54758c7f6e): Clicking setAccessibilityCookie button
[2021-12-18 17:32:13.734 +0000] DEBUG (40 on 5c54758c7f6e): Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies
    status: 401
    errorBody: {
      "status": "error"
    }
[2021-12-18 17:32:13.734 +0000] TRACE (40 on 5c54758c7f6e): Saving new cookies
[2021-12-18 17:32:13.780 +0000] DEBUG (40 on 5c54758c7f6e): Purchasing with puppeteer (short)
    user: "account3"
[2021-12-18 17:32:14.099 +0000] TRACE (40 on 5c54758c7f6e): devtools://devtools/bundled/inspector.html?ws=127.0.0.1:38507/devtools/page/29CB8211EBDB56F2BECDD59CBB9C848B
    user: "account3"
[2021-12-18 17:32:14.505 +0000] INFO  (40 on 5c54758c7f6e): Loading purchase page
    user: "account3"
    purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-663e521f2a444199be58152fd93fa66e-a0bb13a219f747f88dff4c2a50b070c0&orderId&purchaseToken&showNavigation=true"
[2021-12-18 17:32:22.757 +0000] TRACE (40 on 5c54758c7f6e): Waiting for cookieDialog
    user: "account3"
[2021-12-18 17:32:25.759 +0000] TRACE (40 on 5c54758c7f6e): No cookie dialog presented
    user: "account3"
[2021-12-18 17:32:25.760 +0000] TRACE (40 on 5c54758c7f6e): Waiting for placeOrderButton
    user: "account3"
[2021-12-18 17:32:25.774 +0000] TRACE (40 on 5c54758c7f6e): Clicking placeOrderButton
    user: "account3"
[2021-12-18 17:32:25.950 +0000] TRACE (40 on 5c54758c7f6e): Clicking euRefundAgreeButton
    user: "account3"
[2021-12-18 17:32:26.122 +0000] DEBUG (40 on 5c54758c7f6e): Waiting for receipt
    user: "account3"
[2021-12-18 17:32:26.585 +0000] TRACE (40 on 5c54758c7f6e): Waiting for hcaptcha iframe
    user: "account3"
[2021-12-18 17:32:27.947 +0000] DEBUG (40 on 5c54758c7f6e): Captcha detected
    user: "account3"
[2021-12-18 17:32:27.953 +0000] INFO  (40 on 5c54758c7f6e): Go to this URL and do something
    user: "account3"
    url: "http://localhost:3000/?targetId=29CB8211EBDB56F2BECDD59CBB9C848B"
[2021-12-18 17:32:27.956 +0000] TRACE (40 on 5c54758c7f6e): Sending email
    user: "account3"
    reason: "PURCHASE"
[2021-12-18 17:32:29.044 +0000] DEBUG (40 on 5c54758c7f6e): Email sent.
    user: "account3"
    reason: "PURCHASE"
    from: "account1"
    to: "notification_email"
claabs commented 2 years ago

It actually looks like it worked correctly there. The captcha notification was the "happy path" one, and not the "human error help" one. (reason: "PURCHASE" vs reason: "PURCHASE_ERROR")

I ended up adding another Europe-based account to my test account collection. Hopefully it can help better replicate this issue in the future.

I'm going to close this for now, but feel free to open again if it reappears later. Thanks very much for your help on this.

JoeBoJoe commented 2 years ago

I seem to be always getting the error reason PURCHASE_ERROR ever since I first configured my container. I am always required to manually purchase the free games and have never had this automated successfully.

error-2022-06-02T16-52-03 520Z

Log:

epicgames-freegames-node@4.1.0 entrypoint-config node dist/src/entrypoint-config.js Setting timezone: UTC Run on startup: true [2022-06-02 17:03:51.634 +0000] INFO: Started epicgames-freegames-node COMMIT_SHA: "ea7a50597231010158212cd60c27983df26b45fd" BRANCH: "master" DISTRO: "alpine" [2022-06-02 17:03:51.822 +0000] INFO: Checking free games for XYZ user: "XYZ" [2022-06-02 17:03:56.963 +0000] INFO: Successfully refreshed login user: "XYZ" [2022-06-02 17:03:57.204 +0000] INFO: searchStrategy is all: searching for weekly and promotional games user: "XYZ" [2022-06-02 17:04:15.796 +0000] INFO: Available free games user: "XYZ" availableGames: [ "Wolfenstein: The New Order" ] [2022-06-02 17:04:15.961 +0000] INFO: Unpurchased free games user: "XYZ" purchasableGames: [ "Wolfenstein: The New Order" ] [2022-06-02 17:04:15.965 +0000] INFO: Purchasing Wolfenstein: The New Order user: "XYZ" [2022-06-02 17:04:16.440 +0000] INFO: Loading purchase page user: "XYZ" purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-0bd3e505924240adb702295fa08c1eff-52a32a3469dd4a2ca20bfff0c6a66486&orderId&purchaseToken&showNavigation=true" [2022-06-02 17:04:58.264 +0000] WARN: waiting for function failed: timeout 30000ms exceeded user: "XYZ" err: { "type": "TimeoutError", "message": "waiting for function failed: timeout 30000ms exceeded", "stack": TimeoutError: waiting for function failed: timeout 30000ms exceeded at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:813:28) at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:728:22) at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1388:28) at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3358:29) at initPurchase (/usr/app/src/puppet/purchase.ts:84:14) at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:117:7) at redeemAccount (/usr/app/src/index.ts:42:7) at async Promise.all (index 0) at main (/usr/app/src/index.ts:65:5) "name": "TimeoutError" } [2022-06-02 17:04:58.365 +0000] ERROR: Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes. user: "XYZ" errorImage: "config/error-2022-06-02T17-04-58.087Z.png" errorHtml: "config/error-2022-06-02T17-04-58.087Z.html" [2022-06-02 17:04:58.365 +0000] INFO: Asking a human for help... user: "XYZ" [2022-06-02 17:04:58.376 +0000] INFO: Go to this URL and do something user: "XYZ" url: "http://192.168.0.111:3000/?targetId=67E0B9BC63E874CD90A7DACA2F03698E"

Trace log:

user: "XYZ" offerId: "52a32a3469dd4a2ca20bfff0c6a66486" namespace: "0bd3e505924240adb702295fa08c1eff" [2022-06-02 16:51:21.255 +0000] TRACE: Posting for offer entitlement user: "XYZ" url: "https://store.epicgames.com/graphql" variables: { "offerId": "52a32a3469dd4a2ca20bfff0c6a66486", "sandboxId": "0bd3e505924240adb702295fa08c1eff" } extensions: { "persistedQuery": { "version": 1, "sha256Hash": "803d00fd80aef2cbb0b998ba27b761143d228195b86cc8af55e73002f18a1678" } } [2022-06-02 16:51:21.424 +0000] TRACE: Entitlement response user: "XYZ" resp: { "Launcher": { "entitledOfferItems": { "namespace": "0bd3e505924240adb702295fa08c1eff", "offerId": "52a32a3469dd4a2ca20bfff0c6a66486", "entitledToAllItemsInOffer": false, "entitledToAnyItemInOffer": false  } } } [2022-06-02 16:51:21.424 +0000] INFO: Unpurchased free games user: "XYZ" purchasableGames: [ "Wolfenstein: The New Order" ] [2022-06-02 16:51:21.429 +0000] INFO: Purchasing Wolfenstein: The New Order user: "XYZ" [2022-06-02 16:51:21.430 +0000] DEBUG: hcaptchaAccessibilityUrl not configured, captchas are less likely to be bypassed. Follow this guide to set it up: https://github.com/claabs/epicgames-freegames-node#hcaptcha-accessibility-cookies [2022-06-02 16:51:21.436 +0000] DEBUG: Logging in with puppeteer user: "XYZ" [2022-06-02 16:51:21.436 +0000] DEBUG: Launching a new browser user: "XYZ" [2022-06-02 16:51:21.647 +0000] DEBUG: Launching a new page user: "XYZ" [2022-06-02 16:51:21.783 +0000] TRACE: devtools://devtools/bundled/inspector.html?ws=127.0.0.1:38449/devtools/page/1B6F417054C8F1E8A5592F6FD18E1C50 user: "XYZ" [2022-06-02 16:51:21.984 +0000] INFO: Loading purchase page user: "XYZ" purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-0bd3e505924240adb702295fa08c1eff-52a32a3469dd4a2ca20bfff0c6a66486&orderId&purchaseToken&showNavigation=true" [2022-06-02 16:51:30.174 +0000] TRACE: Waiting for cookieDialog user: "XYZ" [2022-06-02 16:51:30.189 +0000] TRACE: Clicking cookieDialog user: "XYZ" [2022-06-02 16:51:30.368 +0000] TRACE: Waiting for placeOrderButton user: "XYZ" [2022-06-02 16:51:30.380 +0000] DEBUG: Clicking placeOrderButton user: "XYZ" [2022-06-02 16:51:33.512 +0000] TRACE: No EU "Refund and Right of Withdrawal Information" dialog presented user: "XYZ" [2022-06-02 16:51:33.512 +0000] DEBUG: Waiting for receipt user: "XYZ" [2022-06-02 16:51:33.513 +0000] TRACE: Waiting for hcaptcha iframe user: "XYZ" [2022-06-02 16:52:03.710 +0000] WARN: waiting for function failed: timeout 30000ms exceeded user: "XYZ" err: { "type": "TimeoutError", "message": "waiting for function failed: timeout 30000ms exceeded", "stack": TimeoutError: waiting for function failed: timeout 30000ms exceeded at new WaitTask (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:813:28) at DOMWorld.waitForFunction (/usr/app/node_modules/puppeteer/src/common/DOMWorld.ts:728:22) at Frame.waitForFunction (/usr/app/node_modules/puppeteer/src/common/FrameManager.ts:1388:28) at Page.waitForFunction (/usr/app/node_modules/puppeteer/src/common/Page.ts:3358:29) at initPurchase (/usr/app/src/puppet/purchase.ts:84:14) at PuppetPurchase.purchaseShort (/usr/app/src/puppet/purchase.ts:117:7) at redeemAccount (/usr/app/src/index.ts:42:7) at async Promise.all (index 0) at main (/usr/app/src/index.ts:65:5) "name": "TimeoutError" } [2022-06-02 16:52:03.813 +0000] ERROR: Encountered an error during browser automation. Saved a screenshot and page HTML for debugging purposes. user: "XYZ" errorImage: "config/error-2022-06-02T16-52-03.520Z.png" errorHtml: "config/error-2022-06-02T16-52-03.520Z.html" [2022-06-02 16:52:03.813 +0000] INFO: Asking a human for help... user: "XYZ" [2022-06-02 16:52:03.820 +0000] INFO: Go to this URL and do something user: "XYZ" url: "http://192.168.0.111:3000/?targetId=1B6F417054C8F1E8A5592F6FD18E1C50" [2022-06-02 16:52:03.823 +0000] TRACE: Sending telegram notification user: "XYZ" reason: "PURCHASE ERROR" [2022-06-02 16:52:03.823 +0000] TRACE: Sending json payload user: "XYZ" reason: "PURCHASE ERROR" jsonPayload: { "chat_id": "-123", "text": "epicgames-freegames-node,\nreason: PURCHASE ERROR,\naccount: XYZ, \nurl: Click me!", "disable_web_page_preview": true, "parse_mode": "Markdown" }

IcyTower1337 commented 2 years ago

I'm not the creator of the bot, but I was pinged since this I was commenting on this issue initially. I seem to recall claabs mentioning somewhere (maybe a different issue) that fully automatic game claiming hasn't worked for a while, ever since they've changed hcaptcha to not work with the accessibility cookie, so I think this is normal behaviour but I could be wrong.

claabs commented 2 years ago

@JoeBoJoe Looks like you're just seeing a browser navigation timeout due to your device being slow. You can increase it with browserNavigationTimeout

fully automatic game claiming hasn't worked for a while, ever since they've changed hcaptcha to not work with the accessibility cookie, so I think this is normal behaviour but I could be wrong.

In this case, the manual step required is due to PURCHASE_ERROR, which is different from the need of solving a captcha. It's a fallback to ask for human help when something unexpected goes wrong. These days you'll typically always need to solve a captcha to get a game.

JoeBoJoe commented 2 years ago

@JoeBoJoe Looks like you're just seeing a browser navigation timeout due to your device being slow. You can increase it with browserNavigationTimeout

I've set browserNavigationTimeout to 5 minutes however it still did not manage to get past "Waiting for hcaptcha iframe".

I will try setting it to 0 to see if anything changes over a longer time but I think this is unlikely. I can't imagine this being due to my device being too slow as it is running on a desktop pc.

For some reason the hcaptcha iframe is either not appearing or not being recognised for me.

IcyTower1337 commented 2 years ago

In this case, the manual step required is due to PURCHASE_ERROR, which is different from the need of solving a captcha. It's a fallback to ask for human help when something unexpected goes wrong. These days you'll typically always need to solve a captcha to get a game.

I understand, my mistake then, I assumed it was the normal behaviour where it asks you to fill in the captcha. Thanks for explaining