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

Error "Failed to authenticate with GraphQL API, trying again" #217

Closed SimonTod closed 2 years ago

SimonTod commented 2 years ago

Describe the bug

Application cannot login anymore. I get the next warning : "Failed to authenticate with GraphQL API, trying again" Then I get the next error : "Sid returned null"

Screenshots or Logs

[2022-02-04 10:04:39.309 +0000] INFO: Started epicgames-freegames-node
(node:3904) [PINODEP008] PinoWarning: prettyPrint is deprecated, look at https://github.com/pinojs/pino-pretty for alternatives.
(Use `node --trace-warnings ...` to show where the warning was created)
[2022-02-04 10:04:39.329 +0000] INFO: Checking free games for simon.ouistiti@gmail.com
[2022-02-04 10:06:09.803 +0000] WARN: Could not find talon_frame_login_prod
    user: "simon.ouistiti@gmail.com"
    err: {
      "type": "Error",
      "message": "Could not find talon_frame_login_prod",
      "stack":
          Error: Could not find talon_frame_login_prod
              at PuppetLogin.waitForHCaptcha (/root/epicgames-freegames-node/src/puppet/login.ts:111:31)
              at processTicksAndRejections (internal/process/task_queues.js:95:5)
              at PuppetLogin.handleLoginClick (/root/epicgames-freegames-node/src/puppet/login.ts:175:20)
              at PuppetLogin.startLogin (/root/epicgames-freegames-node/src/puppet/login.ts:66:64)
              at PuppetLogin.login (/root/epicgames-freegames-node/src/puppet/login.ts:83:7)
              at Login.fullLogin (/root/epicgames-freegames-node/src/login.ts:102:7)
              at redeemAccount (/root/epicgames-freegames-node/src/index.ts:25:5)
              at async Promise.all (index 0)
              at main (/root/epicgames-freegames-node/src/index.ts:66:5)
    }
[2022-02-04 10:06:31.069 +0000] INFO: Successfully logged in fresh
    user: "simon.ouistiti@gmail.com"
[2022-02-04 10:06:40.939 +0000] INFO: Available free games
    availableGames: [
      "Yooka-Laylee and the Impossible Lair"
    ]
    user: "simon.ouistiti@gmail.com"
[2022-02-04 10:06:41.361 +0000] WARN: Failed to authenticate with GraphQL API, trying again
    user: "simon.ouistiti@gmail.com"
[2022-02-04 10:06:44.356 +0000] ERROR: Sid returned null
    err: {
      "type": "Error",
      "message": "Sid returned null",
      "stack":
          Error: Sid returned null
              at Login.refreshAndSid (/root/epicgames-freegames-node/src/login.ts:80:24)
              at runMicrotasks (<anonymous>)
              at processTicksAndRejections (internal/process/task_queues.js:95:5)
              at FreeGames.ownsGame (/root/epicgames-freegames-node/src/free-games.ts:239:9)
              at async Promise.all (index 0)
              at FreeGames.getPurchasableFreeGames (/root/epicgames-freegames-node/src/free-games.ts:255:23)
              at FreeGames.getAllFreeGames (/root/epicgames-freegames-node/src/free-games.ts:325:30)
              at redeemAccount (/root/epicgames-freegames-node/src/index.ts:26:20)
              at async Promise.all (index 0)
              at main (/root/epicgames-freegames-node/src/index.ts:66:5)
    }

Additional context

I am running the application without docker. It is configured with a custom cron and launches itself once every day and logs the output in a dated file.

It has been working until January 26.

Today I updated the code with git pull origin master and npm install commands.

SimonTod commented 2 years ago

One suggestion I could give, which I really like to see in the future :

This kind of error could be catched, and sent to whatever notifiers is configured. This way, I could have been warned earlier that there was a problem.

I imagine that in some cases (unfortunately not this one), a simple code update could solve the issue.

claabs commented 2 years ago

You're still running the old built .js files. You'll either need to run npm build after updating, or use npm run start:ts rather than npm start.

This kind of error could be catched, and sent to whatever notifiers is configured. This way, I could have been warned earlier that there was a problem.

173 tracks this.

SimonTod commented 2 years ago

npm run build was the right solution. Thanks :+1: