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: Entitlements/cartOffersValidation: Request failed with status code 401 #371

Closed
Freekers opened this issue Jan 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Freekers
Copy link

Freekers commented Jan 2, 2024

Describe the bug

A game is available for grabs, but it fails to obtain it with ERROR: Entitlements/cartOffersValidation: Request failed with status code 401

Screenshots or Logs

> [email protected] entrypoint-config
> node dist/src/entrypoint-config.js
Setting timezone: UTC
Run on startup: true
[2024-01-02 20:31:06.248 +0000] INFO: Started epicgames-freegames-node
    COMMIT_SHA: "31392bfbb6f03bbbc1b6c8a660d71ec7f57bcf2f"
    BRANCH: "master"
    DISTRO: "alpine"
[2024-01-02 20:31:06.249 +0000] DEBUG: Performing version check
    PROJECT_NAME: "epicgames-freegames-node"
    BRANCH: "master"
    COMMIT_SHA: "31392bfbb6f03bbbc1b6c8a660d71ec7f57bcf2f"
[2024-01-02 20:31:06.489 +0000] DEBUG: Starting web server
[2024-01-02 20:31:06.492 +0000] INFO: Checking free games for [email protected] 
    user: "[email protected]"
[2024-01-02 20:31:06.493 +0000] DEBUG: Launching a new browser
    user: "[email protected]"
[2024-01-02 20:31:06.664 +0000] INFO: Dispatching notification
    user: "[email protected]"
    reason: "LOGIN"
    url: "https://my.domain.com/<REDACTED>"
[2024-01-02 20:31:12.726 +0000] DEBUG: Redirecting request to Epic Login URL
    user: "[email protected]"
    verificationUrl: "https://www.epicgames.com/activate?userCode=XXXXXXX"
[2024-01-02 20:31:33.608 +0000] DEBUG: Auth token response
    user: "[email protected]"
    authResp: {
      "access_token": "<REDACTED>",
      "expires_in": 7200,
      "expires_at": "2024-01-02T22:31:33.554Z",
      "token_type": "bearer",
      "refresh_token": "<REDACTED>",
      "refresh_expires": 28800,
      "refresh_expires_at": "2024-01-03T04:31:33.555Z",
      "account_id": "<REDACTED>",
      "client_id": "<REDACTED>",
      "internal_client": true,
      "client_service": "prod-fn",
      "displayName": "MyUserName",
      "app": "prod-fn",
      "in_app_id": "<REDACTED>",
      "product_id": "prod-fn",
      "application_id": "<REDACTED>",
      "acr": "urn:epic:loa:aal1",
      "auth_time": "2024-01-02T20:31:33.554Z"
    }
[2024-01-02 20:31:33.608 +0000] INFO: Successful login, saving auth token
    user: "[email protected]"
[2024-01-02 20:31:33.609 +0000] INFO: searchStrategy is `all`: searching for weekly and promotional games
    user: "[email protected]"
[2024-01-02 20:31:33.609 +0000] DEBUG: Getting current weekly free games list
    user: "[email protected]"
[2024-01-02 20:31:33.610 +0000] DEBUG: Setting auth from device auth
    user: "[email protected]"
    deviceAuth: {
      "access_token": "<REDACTED>",
      "expires_in": 7200,
      "expires_at": "2024-01-02T22:31:33.554Z",
      "token_type": "bearer",
      "refresh_token": "<REDACTED>",
      "refresh_expires": 28800,
      "refresh_expires_at": "2024-01-03T04:31:33.555Z",
      "account_id": "<REDACTED>",
      "client_id": "<REDACTED>",
      "internal_client": true,
      "client_service": "prod-fn",
      "displayName": "MyUserName",
      "app": "prod-fn",
      "in_app_id": "<REDACTED>",
      "product_id": "prod-fn",
      "application_id": "<REDACTED>",
      "acr": "urn:epic:loa:aal1",
      "auth_time": "2024-01-02T20:31:33.554Z"
    }
[2024-01-02 20:31:33.610 +0000] DEBUG: Logging in with puppeteer
    user: "[email protected]"
[2024-01-02 20:31:33.610 +0000] DEBUG: Launching a new browser
    user: "[email protected]"
[2024-01-02 20:31:33.699 +0000] DEBUG: Launching a new page
    user: "[email protected]"
[2024-01-02 20:31:36.316 +0000] DEBUG: Getting product info using pageSlug
    user: "[email protected]"
    pageSlug: "20-minutes-till-dawn-be3305"
[2024-01-02 20:31:36.444 +0000] DEBUG: Page slug response
    user: "[email protected]"
    pageSlug: "20-minutes-till-dawn-be3305"
    storePageMapping: {
      "pageSlug": "20-minutes-till-dawn-be3305",
      "pageType": "productHome",
      "sandboxId": "ee9fad7056a94957b3a4d8c457000337",
      "productId": "e35e2b0c2411423fb6cd97c1dda51e07",
      "createdDate": "2023-12-31T13:18:42.328Z",
      "updatedDate": "2023-12-31T13:18:42.384Z",
      "mappings": {
        "cmsSlug": null,
        "offerId": "9758dccdbda54c1387f732d0d7d03b3b",
        "offer": {
          "id": "9758dccdbda54c1387f732d0d7d03b3b",
          "namespace": "ee9fad7056a94957b3a4d8c457000337",
          "effectiveDate": "2024-01-02T16:00:00.000Z",
          "expiryDate": null
        },
        "prePurchaseOfferId": null,
        "prePurchaseOffer": null,
        "pageId": null
      }
    }
[2024-01-02 20:31:36.610 +0000] DEBUG: Getting global free games
    user: "[email protected]"
[2024-01-02 20:32:01.449 +0000] DEBUG: Retrieved catalog data for 1480 games
    user: "[email protected]"
[2024-01-02 20:32:01.449 +0000] DEBUG: Found 1 unique free games in catalog
    user: "[email protected]"
[2024-01-02 20:32:01.450 +0000] INFO: Available free games
    user: "[email protected]"
    availableGames: [
      "20 Minutes Till Dawn"
    ]
[2024-01-02 20:32:01.450 +0000] DEBUG: Checking ownership and prerequesites on available games
    user: "[email protected]"
[2024-01-02 20:32:01.450 +0000] DEBUG: Getting offers validation info
    user: "[email protected]"
    offerId: "9758dccdbda54c1387f732d0d7d03b3b"
    namespace: "ee9fad7056a94957b3a4d8c457000337"
[2024-01-02 20:32:01.889 +0000] DEBUG:
    0: {
      "message": "Entitlements/cartOffersValidation: Request failed with status code 401",
      "locations": [
�      
{
          "line": 3,
          "column": 5
�      
}
      ],
      "correlationId": "",
      "serviceResponse": "{\"errorCode\":\"errors.com.epicgames.common.authentication.authentication_failed\",\"errorMessage\":\"Authentication failed for /api/public/purchase/cart/offers\",\"messageVars\":[\"/api/public/purchase/cart/offers\"],\"numericErrorCode\":1032,\"originatingService\":\"com.epicgames.entitlement.public\",\"intent\":\"prod\",\"errorStatus\":401}",
      "stack": null,
      "path": [
        "Entitlements",
        "cartOffersValidation"
      ]
    }
    user: "[email protected]"
[2024-01-02 20:32:01.889 +0000] ERROR: Entitlements/cartOffersValidation: Request failed with status code 401
    user: "[email protected]"
    err: {
      "type": "Error",
      "message": "Entitlements/cartOffersValidation: Request failed with status code 401",
      "stack":
          Error: Entitlements/cartOffersValidation: Request failed with status code 401
              at PuppetFreeGames.canPurchase (/usr/app/src/puppet/free-games.ts:303:13)
              at processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async Promise.all (index 0)
              at PuppetFreeGames.getPurchasableFreeGames (/usr/app/src/puppet/free-games.ts:319:28)
              at PuppetFreeGames.getAllFreeGames (/usr/app/src/puppet/free-games.ts:419:30)
              at redeemAccount (/usr/app/src/index.ts:48:20)
              at run (/usr/app/node_modules/p-queue/dist/index.js:163:29)
    }
[2024-01-02 20:32:01.910 +0000] WARN: Current version
    COMMIT_SHA: "31392bfbb6f03bbbc1b6c8a660d71ec7f57bcf2f"
    BRANCH: "master"
    DISTRO: "alpine"
[2024-01-02 20:32:01.910 +0000] INFO: Exiting successfully
Run once: false
Setting cron schedule as 0 0,6,12,18 * * *

Additional context

Contents of config.json

{
  "runOnStartup": true,
  "cronSchedule": "0 0,6,12,18 * * *",
  "logLevel": "debug",
  "webPortalConfig": {
    "baseUrl": "https://my.domain.com",
  },
  "accounts": [
    {
      "email": "[email protected]",
    },
  ],
  "notifiers": [
    {
      "type": "telegram",
      "token": "<REDACTED>",
      "chatId": "<REDACTED>",
    },
  ],
}

Thanks :)

@Freekers Freekers added the bug Something isn't working label Jan 2, 2024
@rcourtman
Copy link

+1, getting this as well

@claabs claabs pinned this issue Feb 7, 2024
@claabs claabs closed this as completed in 00a97bf Feb 8, 2024
@claabs claabs unpinned this issue Feb 15, 2024
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

2 participants