Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when claiming new mystery games #166

Closed
solomonricky opened this issue Dec 16, 2021 · 32 comments
Closed

Error when claiming new mystery games #166

solomonricky opened this issue Dec 16, 2021 · 32 comments
Labels
bug Something isn't working

Comments

@solomonricky
Copy link

Outcome with error when claiming Shenmue III

Failed to claim Shenmue III (Error: Unable to acquire purchase token)

Specifications

  • epicgames-freebies-claimer Version: v1.5.7
  • Platform / OS: Debian
@solomonricky solomonricky added the bug Something isn't working label Dec 16, 2021
@mamanlust
Copy link

Same error ocured on automated github action solution

  • Image: ghcr.io/jackblk/epicgames-freebies-claimer:latest
  • Operating System: Ubuntu 20.04.3

@ProblemFactory
Copy link

It is showing a new error now:

ERROR | TypeError: Cannot destructure property 'elements' of 'data.Catalog.searchStore' as it is null.
    at freeGamesPromotions (/app/src/gamePromotions.js:45:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /app/claimer.js:91:30
  • epicgames-freebies-claimer Version: v1.5.7
  • Platform / OS: Debian (ARM 64)

@mamanlust
Copy link

Tried to get the game by hand, and EGS site is going nuts, can't even get the game manually, maybe this is the problem?

@cobadulu001
Copy link

I got a problem too when claiming new mystery game
Screenshot_20211217-052207_Iceraven

epicgames-freebies-claimer Version: v1.5.7
Platform / OS: Github Workflow

@TovMachin
Copy link

TovMachin commented Dec 16, 2021

Same problem here ... Screenshot

@wubushanyan
Copy link

Same problem here ... Screenshot

Same ,but it claimed the game in fact

@Nuevo009
Copy link

Nuevo009 commented Dec 17, 2021

Same error... Seems that the site is broken?

> [email protected] start
> node claimer.js

 2021-12-17 | 03:14:36.073 | INFO  | Epicgames Freebies Claimer (1.5.7) by Revadike
 2021-12-17 | 03:14:39.958 | INFO  | Found 1 unclaimed freebie(s) for [email protected]
 2021-12-17 | 03:14:45.982 | INFO  | Logged in xxx([email protected])
 2021-12-17 | 03:14:48.473 | WARN  | Failed to claim Shenmue III (Error: Unable to acquire purchase token)
 2021-12-17 | 03:14:49.568 | INFO  | Logged xxx out of Epic Games
 2021-12-17 | 03:15:01.585 | INFO  | Push notification sent
 2021-12-17 | 03:15:01.588 | INFO  | Waiting 120 minutes
  • Image: ghcr.io/jackblk/epicgames-freebies-claimer:latest
  • Operating System: Ubuntu 20.04.3 arm64v8

but it claimed the game in fact

And it did not claim the games for me here. I will try to reduce the interval to see if it succeeds.

EDIT: After hundreds of attempts, it still did not succeed. I manually claimed the game. And wait for a couple of hours. Then restart it. It still found an unclaimed freebie for me and failed with the same error.

@c90c90
Copy link

c90c90 commented Dec 17, 2021

Another developer of a similar project said that epic has replaced a new order link, and the previous one seems to be unusable: luminoleon/epicgames-claimer#60 (comment)

@ghost
Copy link

ghost commented Dec 17, 2021

same

@jackblk
Copy link
Contributor

jackblk commented Dec 17, 2021

I tested and I see 2 possible errors:

  • Error: ESOCKETTIMEDOUT
  • Error: Unable to acquire purchase token

It seems like the timeout error also happens on web 😄

@T1MOXA
Copy link

T1MOXA commented Dec 17, 2021

image

I tested and I see 2 possible errors:

  • Error: ESOCKETTIMEDOUT
  • Error: Unable to acquire purchase token

It seems like the timeout error also happens on web 😄

Yup

@ProblemFactory
Copy link

ProblemFactory commented Dec 17, 2021

I tried to claim the free game manually. It worked after several (<10) attempts, but the epicgames-freebies-claimer has never succeeded on any of the 3 accounts I setup after hundreds of attempts. I think there must be some issues on the claimer end, instead of EGS end.

@Giingu
Copy link

Giingu commented Dec 17, 2021

Having the same issue :((

@ridai260
Copy link

Same issue, thought it was my token and refreshed several times. "Failed to claim Shenmue III (Error: Unable to acquire purchase token)."

@TovMachin
Copy link

I tried to claim the free game manually. It worked after several (<10) attempts, but the epicgames-freebies-claimer has never succeeded on any of the 3 accounts I setup after hundreds of attempts. I think there must be some issues on the claimer end, instead of EGS end.

Claiming it manually worked instantly for me.

@Revadike
Copy link
Owner

Revadike commented Dec 17, 2021

Another developer of a similar project said that epic has replaced a new order link, and the previous one seems to be unusable: luminoleon/epicgames-claimer#60 (comment)

You mean this?
luminoleon/epicgames-claimer@83d2707

This project uses a whole different approach, sadly. It uses a whole internet browser and automate user-actions. It's something I considered myself, but the approach I am currently (with just HTTP requests) using is way more lightweight and doesn't depend on the user interface.

@c90c90
Copy link

c90c90 commented Dec 17, 2021

Another developer of a similar project said that epic has replaced a new order link, and the previous one seems to be unusable: luminoleon/epicgames-claimer#60 (comment)

You mean this?

luminoleon/epicgames-claimer@83d2707

This project uses a whole different approach, sadly. It uses a whole internet browser and automate user-actions. It's something I considered myself, but the approach I am currently (with just HTTP requests) using is way more lightweight and doesn't depend on the user interface.

Yes, I quote this example mainly to confirm that Epic enables the new order address, which may lead to this error.

@CriticalE
Copy link

Hello guys, sorry for ask again, so no solution for this? got same message about token and no work to claim games :(

@Revadike
Copy link
Owner

I probably won't have any time to look into this, this weekend. Feel free to investigate yourself (and submit a PR). You could use debugger tools, http requests monitor or simple logging to figure out exactly what is going wrong. From what I've seen, it's something EGS changed in the purchase flow.

@zjbthomas
Copy link

Just did some debugging and I currently have a feeling that Epic blocks the access from node-epicgames-client, which is the underlying framework for this project.

When using this client to access ue-launcher-website-prod.ol.epicgames.com, Epic always returns Error 500 with We are currently doing some updates to the site., which is actually not the case - if you directly visit https://${ENDPOINT.PORTAL_ORIGIN}/purchase?showNavigation=true&namespace=${offer.namespace}&offers=${offer.id} with the same namespace and ID in any browser, the order page can be correctly shown. So Epic's servers should be fine.

I believe this requires some changes in the underlying node-epicgames-client to trick Epic. For those who are also interested in it, you can find where the purchaseToken is retrieved in lines 592 to 599 of this index.js file.

@XEGARE
Copy link

XEGARE commented Dec 18, 2021

With the help of @zjbthomas, I found that when manually navigating in the browser by
https://ue-launcher-website-prod.ol.epicgames.com/purchase?showNavigation=true&namespace=d5241c76f178492ea1540fce45616757&offers=a0bb13a219f747f88dff4c2a50b070c0 the page says a Error 500, but the purchaseToken is in the URL: https://payment-website-pci.ol.epicgames.com/purchase?showNavigation=true&namespace=d5241c76f178492ea1540fce45616757&offers=a0bb13a219f747f88dff4c2a50b070c0&purchaseToken=66c668c165aa47f8b5930e1e1bdbe874. I don't know if the token is valid.

@jackblk
Copy link
Contributor

jackblk commented Dec 18, 2021

@XEGARE I think your namespace is not correct, this works for me:

https://ue-launcher-website-prod.ol.epicgames.com/purchase?showNavigation=true&namespace=663e521f2a444199be58152fd93fa66e&offers=a0bb13a219f747f88dff4c2a50b070c0

@XEGARE
Copy link

XEGARE commented Dec 18, 2021

@jackblk This also worked for me, but I got my namespace like this:
console.log(namespace=${offer.namespace});
console.log(offers=${offer.id});

But one way or another, but the purchaseToken is in the URL of both variants

@zjbthomas
Copy link

Thanks @XEGARE for following up. I am now able to retrieve the purchaseToken, but the issue is more than that.

Just as a reference, my way to get the purchaseToken is:

async newPurchase(offer) {
    let { response: res } = await this.http.sendGet(`https://${ENDPOINT.PORTAL_ORIGIN}/purchase?showNavigation=true&namespace=${offer.namespace}&offers=${offer.id}`);
    let query = url.parse(res.request.href, true).query;
    const token = query['purchaseToken'];
    return {
      token,
    };
  }

In the next step, a post request should be sent to the order-preview page (see function purchaseOrderPreview() in line 601 of index.js). This will throw an error Error: There was a problem processing your request. Please try again later. in line 628.

I currently do not have enough spare Epic accounts to sniff the traffics for such step. Any help will be appreciated.

@XEGARE
Copy link

XEGARE commented Dec 18, 2021

@zjbthomas I don't know exactly, Remnant: From the Ashes has been handed out before. Today I picked up the game again by hand and was asked for confirmation. Perhaps you have something to do with this (if you have already taken the game before).

I have such an error ReferenceError: url is not defined

UPD:
I fix it:D
const url = require('url');

Exactly the same error as you got

@XEGARE
Copy link

XEGARE commented Dec 18, 2021

@zjbthomas My console.log (data); in purchaseOrderPreview issued a syncToken. I commented out throw new Error (data.orderResponse.message); in purchaseOrderPreview and got WARN | Remnant: From the Ashes was already claimed for this account

I will do so for now. I'll see what happens tomorrow

    let message = data.orderResponse.message;
    if (data.orderResponse && data.orderResponse.error && !message.includes('There was a problem processing your request.')) {
      throw new Error(message);
    }

@jackblk
Copy link
Contributor

jackblk commented Dec 18, 2021

Huh, I think I found the problem why server responds with 500 on our claimer, but not the browser.

Here's the actual curl to get purchaseToken for Remnant: From the Ashes, taken from the browser:

curl 'https://ue-launcher-website-prod.ol.epicgames.com/purchase?showNavigation=true&namespace=663e521f2a444199be58152fd93fa66e&offers=a0bb13a219f747f88dff4c2a50b070c0' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' \
  -H 'cookie: EPIC_BEARER_TOKEN=your_bearer_token_here;' \
  --compressed

Here's the curl in our claimer client (Authorization header is not needed):

curl 'https://ue-launcher-website-prod.ol.epicgames.com/purchase?showNavigation=true&namespace=d5241c76f178492ea1540fce45616757&offers=a0bb13a219f747f88dff4c2a50b070c0' \
  -H 'cookie: EPIC_BEARER_TOKEN=your_bearer_token_here;' \
  --compressed

Notice the diff? It's the namespace lol.

Apparently the namespace in freeGamesPromotions API is not correct.

What I did:

  • Put a breakpoint here:
    let purchased = await client.purchase(offer, 1);
  • In debug console, when it stops at that line, enter: offer.namespace = "663e521f2a444199be58152fd93fa66e"
  • Continue

Now it will respond with 200, the purchase token will load correctly.

I haven't tested fully to see if it can buy the game or not, because if I buy it, I will not have any account left to claim (lol). But I think this is the root cause, you can try it out yourself 😄

@Revadike
Copy link
Owner

@jackblk was right. The free games API is returning the wrong namespace. I'll soon release a workaround that grabs the correct namespace from another API result. That should fix it.

@Revadike
Copy link
Owner

https://github.com/Revadike/epicgames-freebies-claimer/releases/tag/V1.5.8

@jackblk
Copy link
Contributor

jackblk commented Dec 18, 2021

For Docker users, building here: https://github.com/jackblk/EFC-Docker-Image/actions/runs/1596868633

Should be available when this comment is ~10 mins old.

@antoinerzad1
Copy link

antoinerzad1 commented Dec 18, 2021

Hello i got a problem with the new version
image
He say already claimed but the game are not claim
image

@jackblk
Copy link
Contributor

jackblk commented Dec 18, 2021

@antoinerzad1 @Revadike I have the same problem. I created a new ticket here #172

I think it's a bug from epicgames-client, not from EFC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests