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.34k stars 91 forks source link

Connection was Reset (Response Code 400 Bad Request) #314

Open jyang3737 opened 1 year ago

jyang3737 commented 1 year ago

I am pretty sure I setup something wrong but I am not sure where I messed up. I am running Docker in Synology. I keep getting a Discord notification regarding login but every time I click on the link, the webpage says that the "Connection was reset".

Port Settings

Local Port: 3000
Container Port: 3000
Type: tcp

config.json

{
  "runOnStartup": true,
  "cronSchedule": "5 16 * * *",
  "logLevel": "trace",
  "browserNavigationTimeout": 300000,
  "testNotifiers": false,
  "webPortalConfig": {
    "baseUrl": "http://localhost:3000",
  },
  "accounts": [
    {
      "email": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX@gmail.com",
      "password": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
      "totp": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    },
  ],
  "notifiers": [
    {
      "type": "discord",
      "webhookUrl": "https://discord.com/api/webhooks/XXXXXXXXXXXXXXXXXXXX",
      // Optional list of users or roles to mention
      "mentionedUsers": ["XXXXXXXXXXXXXXX"],
      //"mentionedRoles": ["XXXXXXXXXXXXXXX"],
    },
    {
      "type": "bark",
      // your bark key
      "key": "xxxxxxxxxxxxxxxxxxxxxx",
      // bark title, optional, default: 'epicgames-freegames'
      "title": "epicgames-freegames",
      // bark group, optional, default: 'epicgames-freegames'
      "group": "epicgames-freegames",
      // bark private service address, optional, default: 'https://api.day.app'
      "apiUrl": "https://api.day.app"
    },
  ],
}

Log

> epicgames-freegames-node@4.1.0 entrypoint-config

> node dist/src/entrypoint-config.js

Setting timezone: US/Central

Run on startup: true

[2023-01-16 17:00:31.872 -0600] INFO: Started epicgames-freegames-node

    COMMIT_SHA: "67778639ee9bc09c8a543f7e7904116f850dcabc"

    BRANCH: "master"

    DISTRO: "alpine"

[2023-01-16 17:00:31.873 -0600] DEBUG: Performing version check

    PROJECT_NAME: "epicgames-freegames-node"

    BRANCH: "master"

    COMMIT_SHA: "67778639ee9bc09c8a543f7e7904116f850dcabc"

[2023-01-16 17:00:32.298 -0600] TRACE: Response from GitHub API

    latestSha: "67778639ee9bc09c8a543f7e7904116f850dcabc"

[2023-01-16 17:00:32.302 -0600] INFO: Checking free games for xxxxx@gmail.com 

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:32.302 -0600] DEBUG: Launching a new browser

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:32.823 -0600] DEBUG: Logging in with puppeteer

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:32.823 -0600] DEBUG: Launching a new browser

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:33.058 -0600] DEBUG: Launching a new page

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:33.216 -0600] TRACE: devtools://devtools/bundled/inspector.html?ws=127.0.0.1:39778/devtools/page/8BAA77774EAA2DA8F36E4DC0B3ED6618

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:50.192 -0600] DEBUG: Could not refresh credentials. Logging in fresh.

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:50.192 -0600] TRACE: Navigating to Epic Games login page

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:58.543 -0600] TRACE: Waiting for email field

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:58.563 -0600] TRACE: Filling email field

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:58.894 -0600] TRACE: Waiting for password field

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:58.903 -0600] TRACE: Filling password field

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:59.404 -0600] TRACE: Waiting for sign-in button

    user: "xxxxx@gmail.com"

[2023-01-16 17:00:59.412 -0600] TRACE: Clicking sign-in button

    user: "xxxxx@gmail.com"

[2023-01-16 17:01:01.236 -0600] TRACE: Waiting for sign-in result

    user: "xxxxx@gmail.com"

[2023-01-16 17:01:01.237 -0600] TRACE: Waiting for hcaptcha iframe

    user: "xxxxx@gmail.com"

[2023-01-16 17:01:02.929 -0600] TRACE: Captcha detected

    user: "xxxxx@gmail.com"

[2023-01-16 17:01:02.940 -0600] INFO: Go to this URL and do something

    user: "xxxxx@gmail.com"

    url: "http://localhost:3000/?targetId=8BAA77774EAA2DA8F36E4DC0B3ED6618"

[2023-01-16 17:01:02.941 -0600] TRACE: Sending discord notification

    user: "xxxxx@gmail.com"

    reason: "LOGIN"

[2023-01-16 17:01:02.946 -0600] TRACE: Sending Bark notification

    user: "xxxxx@gmail.com"

    reason: "LOGIN"

[2023-01-16 17:01:02.946 -0600] TRACE: Sending request

    user: "xxxxx@gmail.com"

    reason: "LOGIN"

    requestUrl: "https://api.day.app/xxxxxxxxxxxxxxxxxxxxxx/epicgames-freegames/reason%3A%20LOGIN%2C%20account%3A%20xxxxx%40gmail.com?url=http%3A%2F%2Flocalhost%3A3000%2F%3FtargetId%3D8BAA77774EAA2DA8F36E4DC0B3ED6618&group=epicgames-freegames"

[2023-01-16 17:01:03.852 -0600] ERROR: Response code 400 (Bad Request)

    user: "xxxxx@gmail.com"

    reason: "LOGIN"

    err: {

      "type": "HTTPError",

      "message": "Response code 400 (Bad Request)",

      "stack":

          HTTPError: Response code 400 (Bad Request)

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

              at processTicksAndRejections (node:internal/process/task_queues:95:5)

      "name": "HTTPError",

      "code": "ERR_NON_2XX_3XX_RESPONSE",

      "timings": {

        "start": 1673910062954,

        "socket": 1673910062956,

        "lookup": 1673910063010,

        "connect": 1673910063032,

        "secureConnect": 1673910063637,

        "upload": 1673910063637,

        "response": 1673910063843,

        "end": 1673910063844,

        "phases": {

          "wait": 2,

          "dns": 54,

          "tcp": 22,

          "tls": 605,

          "request": 0,

          "firstByte": 206,

          "download": 1,

          "total": 890

        }

      }

    }

[2023-01-16 17:01:03.852 -0600] ERROR: Failed to send message

    user: "xxxxx@gmail.com"

    reason: "LOGIN"

    type: "bark"

    title: "epicgames-freegames"

    group: "epicgames-freegames"

        apiUrl: "https://api.day.app"

    key: "xxxxxxxxxxxxxxxxxxxxxx"

[2023-01-16 17:01:04.162 -0600] ERROR: Encountered an error during browser automation. Saved a screenshot for debugging purposes.

    user: "xxxxx@gmail.com"

    errorFile: "error-2023-01-16T23:01:03.853Z.png"

[2023-01-16 17:01:04.170 -0600] ERROR: {"code":400,"message":"failed to get device token: failed to get [xxxxxxxxxxxxxxxxxxxxxx] device token from database","timestamp":1673910063}

    user: "xxxxx@gmail.com"

[2023-01-16 17:01:04.170 -0600] ERROR: Response code 400 (Bad Request)

    user: "xxxxx@gmail.com"

    err: {

      "type": "HTTPError",

      "message": "Response code 400 (Bad Request)",

      "stack":

          HTTPError: Response code 400 (Bad Request)

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

              at processTicksAndRejections (node:internal/process/task_queues:95:5)

      "name": "HTTPError",

      "code": "ERR_NON_2XX_3XX_RESPONSE",

      "timings": {

        "start": 1673910062954,

        "socket": 1673910062956,

        "lookup": 1673910063010,

        "connect": 1673910063032,

        "secureConnect": 1673910063637,

        "upload": 1673910063637,

        "response": 1673910063843,

        "end": 1673910063844,

        "phases": {

          "wait": 2,

          "dns": 54,

          "tcp": 22,

          "tls": 605,

          "request": 0,

          "firstByte": 206,

          "download": 1,

          "total": 890

        }

      }

    }