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 89 forks source link

config.json error "accounts must be an array" #239

Closed momszx closed 6 months ago

momszx commented 2 years ago

Describe the bug When i run the docker img i get this error in log.

Screenshots or Logs

> epicgames-freegames-node@4.0.0 entrypoint-config
> node dist/src/entrypoint-config.js

Error: Invalid config
    at Object.<anonymous> (/usr/app/src/common/config/setup.ts:110:9)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/app/src/common/config/index.ts:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
[2022-05-13 16:17:36.456 +0200] DEBUG:
    configPath: "/usr/app/config/config.json"
[2022-05-13 16:17:36.471 +0200] ERROR: Validation error(s)
    errors: [
      {
        "property": "accounts",
        "children": [],
        "constraints": {
          "arrayNotEmpty": "accounts should not be empty",
          "isArray": "accounts must be an array"
        }
      }
    ]

** Press ANY KEY to close this window ** 

Additional context My config.json :

{
  "accounts": [
    {
      "email": "xyz@gmail.com",
      "password": "xyz",
      "totp": "xyz"
    }
  ],
  "searchStrategy": "promotion",
  "runOnStartup": true,
  "cronSchedule": "5 16 * * *",
  "logLevel": "info",
  "webPortalConfig": {
    "baseUrl": "https://epic.exmaple.com"
  },
  "hcaptchaAccessibilityUrl": "https://accounts.hcaptcha.com/verify_email/xyz"
}
claabs commented 2 years ago

I can't know for sure, but it's likely your volume just isn't mounted correctly, so the config file isn't being picked up and it's generating the default one.

You can set the environment variable LOG_LEVEL=trace to hopefully get some more idea of what's happening.