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.33k stars 90 forks source link

Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable #183

Closed smilebasti closed 2 years ago

smilebasti commented 2 years ago

Hi,

i just wanted to check why i wasn't getting any new Epic-Bills of free games and found that the container was stuck at: Checking free games for e@mail.com.

After a few restarts and waiting overnight if something would change nothing happened. I followed the debug process of #164. First tried adding test notifier to my config, but it got stuck there afterwards: testing all notifiers.

I then tried the the provided debian-slim image but it gets stuck:

> node dist/src/entrypoint-config.js
[2021-11-21 09:35:55.930 +0000] WARN  (27 on 5d0841f847a8): A newer version of epicgames-freegames-node is available! `docker pull` this image to update.
Setting timezone: UTC
Run on startup: true
[2021-11-21 09:36:01.333 +0000] INFO  (55 on 5d0841f847a8): Testing all configured notifiers
[2021-11-21 09:36:01.484 +0000] ERROR (55 on 5d0841f847a8): Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: /usr/bin/chromium-browser
    Error: Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: /usr/bin/chromium-browser
        at ChromeLauncher.launch (/usr/app/node_modules/puppeteer/src/node/Launcher.ts:127:32)
        at PuppeteerNode.launch (/usr/app/node_modules/puppeteer/src/node/Puppeteer.ts:155:27)
        at PuppeteerExtra.launch (/usr/app/node_modules/puppeteer-extra/src/index.ts:170:37)
        at testNotifiers (/usr/app/src/notify.ts:55:19)
        at main (/usr/app/src/index.ts:55:7)

I already tried pulling a newer image, but it says it's on the newest image (docker repo). As i just pulled the debian image it doesn't make sense.

My config:

{
  "searchStrategy": "promotion",
  "runOnStartup": true,
  "cronSchedule": "8 16 * * *",
  "logLevel": "trace",
  "testNotifiers": true,
  "hcaptchaAccessibilityUrl": "https://accounts.hcaptcha.com/verify_email/something",
  "webPortalConfig": {
    "baseUrl": "https://epic.something.de",
  },
  "accounts": [
    {
      "email": "e@mail.de",
      "password": "something"
    },
  ],
  "notifiers": [
    // You may configure as many of any notifier as needed
    // Here are some examples of each type
    {
      "type": "email",
      "smtpHost": "something",
      "smtpPort": 26,
      "emailSenderAddress": "e@mail.de",
      "emailSenderName": "Epic Games Captchas",
      "emailRecipientAddress": "e@mail.de",
      "secure": false,
      "auth": {
          "user": "something",
          "pass": "something",
      },
    }
  ],
}

Without the test notifier but still debian-slim image:

[2021-11-21 10:47:43.689 +0000] WARN  (21 on 5d0841f847a8): A newer version of epicgames-freegames-node is available! `docker pull` this image to update.
Setting timezone: UTC
Run on startup: true
[2021-11-21 10:47:49.115 +0000] INFO  (45 on 5d0841f847a8): Checking free games for e@mail.de 
[2021-11-21 10:47:49.140 +0000] DEBUG (45 on 5d0841f847a8): Refreshing login session
    user: "e@mail.de"
[2021-11-21 10:47:49.145 +0000] TRACE (45 on 5d0841f847a8): Request store homepage
    user: "e@mail.de"
    url: "https://www.epicgames.com/store/"
[2021-11-21 10:47:51.515 +0000] TRACE (45 on 5d0841f847a8): Reputation request
    user: "e@mail.de"
    url: "https://www.epicgames.com/id/api/reputation"
[2021-11-21 10:47:51.914 +0000] TRACE (45 on 5d0841f847a8): Location request
    user: "e@mail.de"
    url: "https://www.epicgames.com/id/api/location"
[2021-11-21 10:47:52.294 +0000] TRACE (45 on 5d0841f847a8): Client redirect request
    user: "e@mail.de"
    params: {
     "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/client/smoeID"
[2021-11-21 10:47:52.674 +0000] TRACE (45 on 5d0841f847a8): Client redirect response
    user: "e@mail.de"
    resp: {
      "clientId": "someID",
      "clientName": "dieselWebsite",
      "redirectUrl": "https://www.epicgames.com/store",
      "internal": true,
      "native": false,
      "product": "store",
      "allowedScope": [],
      "epicLoginOnly": false
    }
[2021-11-21 10:47:52.676 +0000] TRACE (45 on 5d0841f847a8): Authenticate request
    user: "e@mail.de"
    url: "https://www.epicgames.com/id/api/authenticate"
[2021-11-21 10:47:53.042 +0000] TRACE (45 on 5d0841f847a8): Authenticate response
    user: "e@mail.de"
    resp: ""
[2021-11-21 10:47:53.043 +0000] TRACE (45 on 5d0841f847a8): Redirect request
    user: "e@mail.de"
    params: {
      "clientId": "someID",
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2021-11-21 10:47:53.424 +0000] TRACE (45 on 5d0841f847a8): Redirect response
    user: "e@mail.de"
    resp: {
      "redirectUrl": "https://www.epicgames.com/store/",
      "authorizationCode": null,
      "sid": null
    }
[2021-11-21 10:47:53.425 +0000] DEBUG (45 on 5d0841f847a8): Could not refresh credentials. Logging in fresh.
    user: "e@mail.de"
[2021-11-21 10:47:53.437 +0000] DEBUG (45 on 5d0841f847a8): Setting hCaptcha accessibility cookies
[2021-11-21 10:47:53.573 +0000] WARN  (45 on 5d0841f847a8): Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: /usr/bin/chromium-browser
    Error: Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: /usr/bin/chromium-browser
        at ChromeLauncher.launch (/usr/app/node_modules/puppeteer/src/node/Launcher.ts:127:32)
        at PuppeteerNode.launch (/usr/app/node_modules/puppeteer/src/node/Puppeteer.ts:155:27)
        at PuppeteerExtra.launch (/usr/app/node_modules/puppeteer-extra/src/index.ts:170:37)
        at getHcaptchaCookies (/usr/app/src/puppet/hcaptcha.ts:47:17)
        at PuppetLogin.login (/usr/app/src/puppet/login.ts:68:29)
        at Login.fullLogin (/usr/app/src/login.ts:102:7)
        at redeemAccount (/usr/app/src/index.ts:23:5)
        at async Promise.all (index 0)
        at main (/usr/app/src/index.ts:58:5)
[2021-11-21 10:47:53.763 +0000] WARN  (45 on 5d0841f847a8): Setting the hCaptcha accessibility cookies encountered an error. Continuing without them...
[2021-11-21 10:47:53.771 +0000] DEBUG (45 on 5d0841f847a8): Logging in with puppeteer
    user: "e@mail.de"
[2021-11-21 10:47:53.779 +0000] ERROR (45 on 5d0841f847a8): Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: /usr/bin/chromium-browser
    Error: Tried to use PUPPETEER_EXECUTABLE_PATH env variable to launch browser but did not find any executable at: /usr/bin/chromium-browser
        at ChromeLauncher.launch (/usr/app/node_modules/puppeteer/src/node/Launcher.ts:127:32)
        at PuppeteerNode.launch (/usr/app/node_modules/puppeteer/src/node/Puppeteer.ts:155:27)
        at PuppeteerExtra.launch (/usr/app/node_modules/puppeteer-extra/src/index.ts:170:37)
        at PuppetLogin.login (/usr/app/src/puppet/login.ts:72:21)
        at Login.fullLogin (/usr/app/src/login.ts:102:7)
        at redeemAccount (/usr/app/src/index.ts:23:5)
        at async Promise.all (index 0)
        at main (/usr/app/src/index.ts:58:5)
Run once: false
Setting cron schedule as 8 16 * * *
/usr/local/bin/docker-entrypoint.sh: 32: /usr/sbin/crond: not found

Thanks ahead

claabs commented 2 years ago

I'm not able to recreate this. My though it that your docker run or docker-compose configuration is deleting the container's environment variables somehow. Can you post the command/config you're using to run the Docker container?

smilebasti commented 2 years ago

I used it this in first place: docker run -d -v /my/host/dir/:/usr/app/config:rw -p 3000:3000 charlocharlie/epicgames-freegames:latest In Portainer i then changed the image. Not sure if that changed something but i think so.

Now with the latest image it hangs at:

> epicgames-freegames-node@4.0.0 entrypoint-config /usr/app
> node dist/src/entrypoint-config.js
[2021-11-22 09:25:29.217 +0000] WARN  (26 on ddd3b1f1232f): A newer version of epicgames-freegames-node is available! `docker pull` this image to update.
Setting timezone: UTC
Run on startup: true
[2021-11-22 09:25:37.061 +0000] INFO  (54 on ddd3b1f1232f): Checking free games for e@mail.de 
[2021-11-22 09:25:37.100 +0000] DEBUG (54 on ddd3b1f1232f): Refreshing login session
    user: "e@mail.de"
[2021-11-22 09:25:37.104 +0000] TRACE (54 on ddd3b1f1232f): Request store homepage
    user: "e@mail.de"
    url: "https://www.epicgames.com/store/"
[2021-11-22 09:25:39.604 +0000] TRACE (54 on ddd3b1f1232f): Reputation request
    user: "e@mail.de"
    url: "https://www.epicgames.com/id/api/reputation"
[2021-11-22 09:25:40.025 +0000] TRACE (54 on ddd3b1f1232f): Location request
    user: "e@mail.de"
    url: "https://www.epicgames.com/id/api/location"
[2021-11-22 09:25:40.428 +0000] TRACE (54 on ddd3b1f1232f): Client redirect request
    user: "e@mail.de"
    params: {
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/client/someID"
[2021-11-22 09:25:40.837 +0000] TRACE (54 on ddd3b1f1232f): Client redirect response
    user: "e@mail.de"
    resp: {
      "clientId": "someID",
      "clientName": "dieselWebsite",
      "redirectUrl": "https://www.epicgames.com/store",
      "internal": true,
      "native": false,
      "product": "store",
      "allowedScope": [],
      "epicLoginOnly": false
    }
[2021-11-22 09:25:40.838 +0000] TRACE (54 on ddd3b1f1232f): Authenticate request
    user: "e@mail.de"
    url: "https://www.epicgames.com/id/api/authenticate"
[2021-11-22 09:25:41.216 +0000] TRACE (54 on ddd3b1f1232f): Authenticate response
    user: "e@mail.de"

    resp: ""
[2021-11-22 09:25:41.217 +0000] TRACE (54 on ddd3b1f1232f): Redirect request
    user: "e@mail.de"
    params: {
      "clientId": "someID",
      "redirectUrl": "https://www.epicgames.com/store/"
    }
    url: "https://www.epicgames.com/id/api/redirect"
[2021-11-22 09:25:41.641 +0000] TRACE (54 on ddd3b1f1232f): Redirect response
    user: "e@mail.de"
    resp: {
      "redirectUrl": "https://www.epicgames.com/store/",
      "authorizationCode": null,
      "sid": null
    }
[2021-11-22 09:25:41.642 +0000] DEBUG (54 on ddd3b1f1232f): Could not refresh credentials. Logging in fresh.
    user: "e@mail.de"
[2021-11-22 09:25:41.658 +0000] DEBUG (54 on ddd3b1f1232f): Setting hCaptcha accessibility cookies

After that i tried it again with the debian image and the standard command as above and it finally worked. Seemed to be an issue with Portainer change the image. But also the normal image getting stuck...

Thanks for the help :)