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

Run on start ignored when API disabled #473

Closed
danieletorelli opened this issue Dec 23, 2024 · 7 comments · Fixed by #474
Closed

Run on start ignored when API disabled #473

danieletorelli opened this issue Dec 23, 2024 · 7 comments · Fixed by #474
Labels
bug Something isn't working

Comments

@danieletorelli
Copy link

What happened?

The sync doesn't happen on start but only in the next cron window.
If the API is enabled though, the sync happens on start.

AdguardHome-Sync Version

0.6.16

AdguardHome Version

0.107.55

OS Information

Docker environment on Linux

Configuration

CRON=0 */6 * * *
API_PORT=0
API_METRICS_ENABLED=false

Current Applied Configuration

No response

Relevant log output

2024-12-20T21:37:51.733Z	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.6.16", "build": "2024-12-18T07:35:37Z", "os": "linux", "arch": "arm64"}
2024-12-20T21:37:51.734Z	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "0 */6 * * *", "next-execution": "2024-12-21T00:00:00.000Z"}

Anything else?

No response

@danieletorelli danieletorelli added the bug Something isn't working label Dec 23, 2024
@bakito
Copy link
Owner

bakito commented Dec 23, 2024

Is RUN_ON_START: "true" set?

@danieletorelli
Copy link
Author

Is RUN_ON_START: "true" set?

Yes sorry, that part was unclear. Defining an explicit env variable in the config:

CRON=0 */6 * * *
API_PORT=0
API_METRICS_ENABLED=false
RUN_ON_START=true

still leads to:

2024-12-23T05:55:25.326Z	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.6.16", "build": "2024-12-18T07:35:37Z", "os": "linux", "arch": "arm64"}
2024-12-23T05:55:25.328Z	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "0 */6 * * *", "next-execution": "2024-12-23T06:00:00.000Z"}

but with:

CRON=0 */6 * * *
API_PORT=8080
API_METRICS_ENABLED=false
RUN_ON_START=true

it triggers correctly:

2024-12-23T05:57:56.672Z	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.6.16", "build": "2024-12-18T07:35:37Z", "os": "linux", "arch": "arm64"}
2024-12-23T05:57:56.674Z	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "0 */6 * * *", "next-execution": "2024-12-23T06:00:00.000Z"}
2024-12-23T05:57:56.674Z	INFO	sync	sync/http.go:86	Starting API server	{"port": 8080}
2024-12-23T05:57:56.674Z	INFO	sync	sync/sync.go:75	Running sync on startup
2024-12-23T05:57:57.180Z	INFO	sync	sync/sync.go:174	Connected to origin	{"from": "ns1.mydomain.com", "version": "v0.107.55"}
2024-12-23T05:57:59.308Z	INFO	sync	sync/sync.go:267	Start sync	{"from": "ns1.mydomain.com", "to": "ns2.mydomain.com"}

@bakito
Copy link
Owner

bakito commented Dec 23, 2024

can you please provide tie full applied config?
Check here how to get it: https://github.com/bakito/adguardhome-sync/wiki/FAQ#how-to-print-the-current-applied-configuration

@danieletorelli
Copy link
Author

can you please provide tie full applied config? Check here how to get it: https://github.com/bakito/adguardhome-sync/wiki/FAQ#how-to-print-the-current-applied-configuration

origin:
    url: https://ns1.mydomain.com
    webURL: https://ns1.mydomain.com
    apiPath: /control
    username: myusername
    password: mypassword
    insecureSkipVerify: false
    autoSetup: false
replicas:
    - url: https://ns2.mydomain.com
      webURL: https://ns2.mydomain.com
      apiPath: /control
      username: myusername
      password: mypassword
      insecureSkipVerify: false
      autoSetup: false
cron: 0 */6 * * *
runOnStart: true
printConfigOnly: true
features:
    dns:
        accessLists: true
        serverConfig: true
        rewrites: true
    dhcp:
        serverConfig: true
        staticLeases: true
    generalSettings: true
    queryLogConfig: true
    statsConfig: true
    clientSettings: true
    services: true
    filters: true
    theme: true

@bakito
Copy link
Owner

bakito commented Dec 23, 2024

@danieletorelli I think I've found the issue, thank you for finding it.

@danieletorelli
Copy link
Author

@danieletorelli I think I've found the issue, thank you for finding it.

Thanks to you for the quick fix!

@bakito
Copy link
Owner

bakito commented Dec 23, 2024

is fixed in release https://github.com/bakito/adguardhome-sync/releases/tag/v0.6.17 (images are currently building https://github.com/bakito/adguardhome-sync/actions/runs/12463078959)

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

Successfully merging a pull request may close this issue.

2 participants