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

Timezone Variable Required #1

Open
yousefmansy1 opened this issue Sep 1, 2024 · 0 comments
Open

Timezone Variable Required #1

yousefmansy1 opened this issue Sep 1, 2024 · 0 comments

Comments

@yousefmansy1
Copy link

yousefmansy1 commented Sep 1, 2024

Hey I know this is a small project but these two issues led me here
AdguardTeam/AdGuardHome#4645
AdguardTeam/AdGuardHome#2290

When using the docker image you provided I was getting these errors.

[16:22:00.377] ERROR (1): Error
[16:22:00.377] ERROR (1): Cannot read properties of undefined (reading 'valueOf')
[16:22:00.377] ERROR (1): TypeError: Cannot read properties of undefined (reading 'valueOf')
    at /usr/src/app/outputs/loki.js:20:90
    at Array.map (<anonymous>)
    at LokiApi.push (/usr/src/app/outputs/loki.js:19:34)
    at /usr/src/app/index.js:107:39
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async AdguardApi.getLogs (/usr/src/app/adguard/index.js:60:24)
    at async syncLogs (/usr/src/app/index.js:104:5)

There's quite a few "Undocumented" (in the readme) args. And I think the timezone arg is required because otherwise it cant generate the timestamp for the log when sending it to loki.

program
.option('-aurl, --adguard-url <char>', 'Adguard URL (http://127.0.0.1:8080)', process.env.ADGUARD_URL)
.option('-auser, --adguard-user <char>', 'Adguard user', process.env.ADGUARD_USER)
.option('-apass, --adguard-password <char>', 'Adguard password', process.env.ADGUARD_PASSWORD)
.option('-lurl --loki-url <char>', 'Loki url (http://127.0.0.1:3100)', process.env.LOKI_URL)
.option('-hurl --http-url <char>', 'http url (http://127.0.0.1:12203)', process.env.HTTP_URL)
.option('-tz --timezone <char>', 'Set timezone for message to loki', process.env.TIMEZONE)
.option('-cron --cron-schedule <char>', 'Corn Job schedule', process.env.CRON_SCHEDULE || '* * * * *')
.option('-port --api-port <char>', 'API Port', process.env.API_PORT || '8080')
.option('-p --pointer-path <char>', 'The pointer path', process.env.POINTER_PATH);

I passed in the TIMEZONE arg and it started to work again, a default value here is probably helpful.

@yousefmansy1 yousefmansy1 changed the title Timezon Variable Required Timezone Variable Required Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant