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.37k stars 93 forks source link

Ignoring cron schedule #26

Closed Gamewalker closed 4 years ago

Gamewalker commented 4 years ago

I dont know why, but my container is checking all day long and ignoring my schedule.

My Config:

{
    "accounts": [
        {
            "email": "x",
            "password": "x",
            "totp": "x"
        },
    ],
    "gcpConfigName": "x",
    "runOnStartup": true,
    "cronSchedule": "0 12 * * *",
    "runOnce": false,
    "logLevel": "info",
    "baseUrl": "x",
    "email": {
        "smtpHost": "x",
        "smtpPort": 587,
        "emailSenderAddress": "x",
        "emailSenderName": "Epic Games Captchas",
        "emailRecipientAddress": "x",
        "secure": true,
        "auth": {
            "user": "x",
            "pass": "x",
        },
    }
}

ENV: Unbenannt

tested with and without the env for the cron.

Log:

> epicgames-freegames-node@2.0.0 start /usr/app
> node dist/src/index.js

[2020-07-10 13:10:57.193 +0200] INFO  (17 on 0fd2d6b4bcb2): Checking free games for x
[2020-07-10 13:11:02.034 +0200] INFO  (17 on 0fd2d6b4bcb2): Successfully logged in fresh
    user: "x"
[2020-07-10 13:11:02.360 +0200] INFO  (17 on 0fd2d6b4bcb2): Available free games
    user: "x"
    availableGames: [
      "Lifeless Planet: Premier Edition",
      "Killing Floor 2",
      "The Escapists 2"
    ]
[2020-07-10 13:11:02.693 +0200] INFO  (17 on 0fd2d6b4bcb2): Unpurchased free games
    user: "x"
    purchasableGames: []

> epicgames-freegames-node@2.0.0 start /usr/app
> node dist/src/index.js

[2020-07-10 13:11:04.741 +0200] INFO  (17 on 0fd2d6b4bcb2): Checking free games for x
[2020-07-10 13:11:06.819 +0200] INFO  (17 on 0fd2d6b4bcb2): Successfully refreshed login
    user: "x"
[2020-07-10 13:11:06.831 +0200] INFO  (17 on 0fd2d6b4bcb2): Available free games
    user: "x"
    availableGames: [
      "Lifeless Planet: Premier Edition",
      "Killing Floor 2",
      "The Escapists 2"
    ]
[2020-07-10 13:11:07.151 +0200] INFO  (17 on 0fd2d6b4bcb2): Unpurchased free games
    user: "x"
    purchasableGames: []

> epicgames-freegames-node@2.0.0 start /usr/app
> node dist/src/index.js

[2020-07-10 13:11:09.619 +0200] INFO  (18 on 0fd2d6b4bcb2): Checking free games for x
[2020-07-10 13:11:11.666 +0200] INFO  (18 on 0fd2d6b4bcb2): Successfully refreshed login
    user: "x"
[2020-07-10 13:11:11.678 +0200] INFO  (18 on 0fd2d6b4bcb2): Available free games
    user: "x"
    availableGames: [
      "Lifeless Planet: Premier Edition",
      "Killing Floor 2",
      "The Escapists 2"
    ]
[2020-07-10 13:11:11.994 +0200] INFO  (18 on 0fd2d6b4bcb2): Unpurchased free games
    user: "x"
    purchasableGames: []
claabs commented 4 years ago

This one's tricky. There's a couple things I'd like to check:

  1. Can you post the log output immediately after starting? I'd like to see the log output from the entrypoint script. (Starts with Incoming env vars:)
  2. How is the container being started? If it's docker run, I'm concerned there's some command or entrypoint override happening.
Gamewalker commented 4 years ago

I dont know how plesk is starting the container, but it must be different to manually typing the command. PS shows:

56228b3e674c charlocharlie/epicgames-freegames "docker-entrypoint.s…" 5 hours ago Up 1 second 0.0.0.0:81->3000/tcp epicgames-freegames

and docker logs ... shows exactly what I posted.

If I run the container via command, its working fine and docker output is completly different.

claabs commented 4 years ago

I just pushed a new entrypoint method that's apparently backwards compatible to charlocharlie/epicgames-freegames-test:latest.

Can you try to run that image? You don't need to add any settings, or config. As long as you see Incoming env vars: on startup, that means it works. Let me know if that worked.

Gamewalker commented 4 years ago
Incoming env vars:
RUN_ON_STARTUP: 
CRON_SCHEDULE: 
RUN_ONCE: 
Getting settings from JSON: /usr/app/config/config.json5
Setting config variables
Run on startup: true
Run once: false

> epicgames-freegames-node@2.0.0 start /usr/app
> node dist/src/index.js

[2020-07-10 21:12:05.224 +0200] INFO  (39 on 979754a5cb40): Checking free games for x
[2020-07-10 21:12:07.656 +0200] INFO  (39 on 979754a5cb40): Successfully refreshed login
    user: "x"
[2020-07-10 21:12:07.998 +0200] INFO  (39 on 979754a5cb40): Available free games
    user: "x"
    availableGames: [
      "Lifeless Planet: Premier Edition",
      "Killing Floor 2",
      "The Escapists 2"
    ]
[2020-07-10 21:12:08.365 +0200] INFO  (39 on 979754a5cb40): Unpurchased free games
    user: "x"
    purchasableGames: []
Setting timezone: Europe/Berlin
Setting cron schedule as 0 12 * * *
claabs commented 4 years ago

Great news! Looks like Plesk just uses an older version of Docker. I'll push the changes to master so you can go back to the main repo charlocharlie/epicgames-freegames. Give it 20 minutes or so to build once I commit.

Gamewalker commented 4 years ago

fine, its Docker version 19.03.12, build 48a66213fe