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

0.6.0: Error syncing DHCP server config #272

Closed
golles opened this issue Jan 12, 2024 · 16 comments
Closed

0.6.0: Error syncing DHCP server config #272

golles opened this issue Jan 12, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@golles
Copy link
Contributor

golles commented Jan 12, 2024

What happened?

After updating from version 0.5.4 to 0.6.0 I see this error.
Rolling back doesn't show this error.

AdguardHome-Sync Version

0.6.0

AdguardHome Version

v0.107.43

Configuration

# cron expression to run in daemon mode. (default; "" = runs only once)
cron: "*/10 * * * *"

# runs the synchronisation on startup
runOnStart: true

origin:
  # url of the origin instance
  url: http://redacted:8085
  # apiPath: define an api path if other than "/control"
  insecureSkipVerify: true # disable tls check
  username: redacted
  password: redacted

# replica instance (optional, if only one)
replica:
  # url of the replica instance
  url: http://redacted:8085
  username: redacted
  password: redacted

# Configure the sync API server, disabled if api port is 0
api:
  # Port, default 8080
  port: 8080
  # if username and password are defined, basic auth is applied to the sync API 
  # username: username
  # password: password

# Configure sync features; by default all features are enabled.
# features:
#   generalSettings: true
#   queryLogConfig: true
#   statsConfig: true
#   clientSettings: true
#   services: true
#   filters: true
#   dhcp:
#     serverConfig: true
#     staticLeases: true
#   dns:
#     serverConfig: true
#     accessLists: true
#     rewrites: true

Relevant log output

2024-01-12T18:36:16.790+0100	INFO	root	cmd/root.go:119	Using config file:/config/adguardhome-sync.yaml
2024-01-12T18:36:16.806+0100	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.6.0", "build": "2024-01-10T18:53:37Z", "os": "linux", "arch": "arm64"}
2024-01-12T18:36:16.808+0100	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "*/10 * * * *", "next-execution": "2024-01-12T18:40:00.000+0100"}
2024-01-12T18:36:16.809+0100	INFO	sync	sync/sync.go:75	Running sync on startup
2024-01-12T18:36:16.810+0100	INFO	sync	sync/http.go:57	Starting API server	{"port": 8080}
2024-01-12T18:36:16.827+0100	INFO	sync	sync/sync.go:172	Connected to origin	{"from": "redacted:8085", "version": "v0.107.43"}
2024-01-12T18:36:16.920+0100	INFO	sync	sync/sync.go:271	Start sync	{"from": "redacted:8085", "to": ""}
2024-01-12T18:36:17.396+0100	INFO	sync	sync/sync.go:279	Connected to replica	{"from": "redacted:8085", "to": "", "version": "v0.107.43"}
2024-01-12T18:36:19.807+0100	INFO	client	client/client.go:337	Set stats config	{"host": "", "interval": 7}
2024-01-12T18:36:20.262+0100	INFO	client	client/client.go:269	Toggle filtering	{"host": "", "enabled": true, "interval": 24}
2024-01-12T18:36:21.348+0100	INFO	client	client/client.go:396	Set dhcp server config	{"host": ""}
2024-01-12T18:36:21.505+0100	ERROR	sync	sync/sync.go:300	Error syncing DHCP server config	{"from": "redacted:8085", "to": "", "error": "400 Bad Request(bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
	/go/src/app/pkg/sync/sync.go:300
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
	/go/src/app/pkg/sync/sync.go:259
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
	/go/src/app/pkg/sync/sync.go:76

Anything else?

In the log, some to and host seem to be empty.

@golles golles added the bug Something isn't working label Jan 12, 2024
@golles
Copy link
Contributor Author

golles commented Jan 12, 2024

If I update my config from replica to replicas, I do see the to and host containing the correct value, however still this error.

Config

# replicas instances (optional, if more than one)
replicas:
  # url of the replica instance
  - url: http://redacted:8085
    username: redacted
    password: redacted

Log

2024-01-12T18:45:29.103+0100	INFO	root	cmd/root.go:119	Using config file:/config/adguardhome-sync.yaml
2024-01-12T18:45:29.111+0100	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.6.0", "build": "2024-01-10T18:53:37Z", "os": "linux", "arch": "arm64"}
2024-01-12T18:45:29.112+0100	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "*/10 * * * *", "next-execution": "2024-01-12T18:50:00.000+0100"}
2024-01-12T18:45:29.112+0100	INFO	sync	sync/http.go:57	Starting API server	{"port": 8080}
2024-01-12T18:45:29.112+0100	INFO	sync	sync/sync.go:75	Running sync on startup
2024-01-12T18:45:29.122+0100	INFO	sync	sync/sync.go:172	Connected to origin	{"from": "redacted:8085", "version": "v0.107.43"}
2024-01-12T18:45:29.176+0100	INFO	sync	sync/sync.go:271	Start sync	{"from": "redacted:8085", "to": "redacted:8085"}
2024-01-12T18:45:29.325+0100	INFO	sync	sync/sync.go:279	Connected to replica	{"from": "redacted:8085", "to": "redacted:8085", "version": "v0.107.43"}
2024-01-12T18:45:30.349+0100	INFO	client	client/client.go:337	Set stats config	{"host": "redacted:8085", "interval": 7}
2024-01-12T18:45:30.806+0100	INFO	client	client/client.go:269	Toggle filtering	{"host": "redacted:8085", "enabled": true, "interval": 24}
2024-01-12T18:45:33.162+0100	INFO	client	client/client.go:396	Set dhcp server config	{"host": "redacted:8085"}
2024-01-12T18:45:33.538+0100	ERROR	sync	sync/sync.go:300	Error syncing DHCP server config	{"from": "redacted:8085", "to": "redacted:8085", "error": "400 Bad Request(bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
	/go/src/app/pkg/sync/sync.go:300
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
	/go/src/app/pkg/sync/sync.go:259
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
	/go/src/app/pkg/sync/sync.go:76

@bakito
Copy link
Owner

bakito commented Jan 14, 2024

Hi @golles can you please provide debug logs of the second configuration?
And secondly provide the config printed, when PRINT_CONFIG_ONLY is enabled?
See https://github.com/bakito/adguardhome-sync/wiki/FAQ

@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

With the second configuration, do you mean the adguard home replica?

❯ dcl adguardhome-sync 
Attaching to adguardhome-sync
adguardhome-sync    | 2024-01-14T12:35:38.713+0100      INFO    root    cmd/root.go:119 Using config file:/config/adguardhome-sync.yaml
adguardhome-sync    | 2024-01-14T12:35:38.719+0100      INFO    run     cmd/run.go:35   Printing adguardhome-sync config (THE APPLICATION WILL NOT START IN THIS MODE): 
adguardhome-sync    | origin:
adguardhome-sync    |     url: http://redacted:8085
adguardhome-sync    |     webURL: http://redacted:8085
adguardhome-sync    |     apiPath: /control
adguardhome-sync    |     username: redacted
adguardhome-sync    |     password: redacted
adguardhome-sync    |     insecureSkipVerify: false
adguardhome-sync    |     autoSetup: false
adguardhome-sync    | replicas:
adguardhome-sync    |     - url: http://redacted:8085
adguardhome-sync    |       webURL: http://redacted:8085
adguardhome-sync    |       username: redacted
adguardhome-sync    |       password: redacted
adguardhome-sync    |       insecureSkipVerify: false
adguardhome-sync    |       autoSetup: false
adguardhome-sync    | cron: '*/10 * * * *'
adguardhome-sync    | runOnStart: true
adguardhome-sync    | printConfigOnly: true
adguardhome-sync    | api:
adguardhome-sync    |     port: 8080
adguardhome-sync    | features:
adguardhome-sync    |     dns:
adguardhome-sync    |         accessLists: true
adguardhome-sync    |         serverConfig: true
adguardhome-sync    |         rewrites: true
adguardhome-sync    |     dhcp:
adguardhome-sync    |         serverConfig: true
adguardhome-sync    |         staticLeases: true
adguardhome-sync    |     generalSettings: true
adguardhome-sync    |     queryLogConfig: true
adguardhome-sync    |     statsConfig: true
adguardhome-sync    |     clientSettings: true
adguardhome-sync    |     services: true
adguardhome-sync    |     filters: true
adguardhome-sync    | 

Myabe I should mention that I've got 2 servers, the main AGH is running on the 1st, the 2nd AGH and sync are running on the 2nd server. All applications run in docker containers.

@bakito
Copy link
Owner

bakito commented Jan 14, 2024

2nd is the config with replicas.
Please also add the debug logs.

@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

debug logs

Attaching to adguardhome-sync
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.601+0100	INFO	root	cmd/root.go:119	Using config file:/config/adguardhome-sync.yaml
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.609+0100	INFO	sync	sync/sync.go:38	AdGuardHome sync	{"version": "v0.6.0", "build": "2024-01-10T18:53:37Z", "os": "linux", "arch": "arm64"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.611+0100	DEBUG	sync	types/types.go:73	Using config	{"config": {"origin":{"url":"http://srv1:8085","webURL":"http://srv1:8085","apiPath":"/control","username":"g***s","password":"r***w","insecureSkipVerify":false,"autoSetup":false},"replicas":[{"url":"http://srv2:8085","webURL":"http://srv2:8085","username":"g***s","password":"r***w","insecureSkipVerify":false,"autoSetup":false}],"cron":"*/10 * * * *","runOnStart":true,"api":{"port":8080},"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}}}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.611+0100	INFO	sync	sync/sync.go:65	Setup cronjob	{"cron": "*/10 * * * *", "next-execution": "2024-01-14T12:50:00.000+0100"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.612+0100	INFO	sync	sync/http.go:57	Starting API server	{"port": 8080}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.613+0100	INFO	sync	sync/sync.go:75	Running sync on startup
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.614+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.626+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.19\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.627+0100	INFO	sync	sync/sync.go:172	Connected to origin	{"from": "srv1:8085", "version": "v0.107.43"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.627+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/profile", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.637+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/profile", "username": "redacted", "status": 200, "body": "{\"name\":\"redacted\",\"language\":\"\",\"theme\":\"auto\"}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.637+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/parental/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.644+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/parental/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.645+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/safesearch/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.650+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/safesearch/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false,\"bing\":true,\"duckduckgo\":true,\"google\":true,\"pixabay\":true,\"yandex\":true,\"youtube\":true}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.651+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/safebrowsing/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.656+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/safebrowsing/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.656+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/rewrite/list", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.660+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/rewrite/list", "username": "redacted", "status": 200, "body": "[{\"domain\":\"*.rg23.nl\",\"answer\":\"srv1\"}]\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.661+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/blocked_services/list", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.664+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/blocked_services/list", "username": "redacted", "status": 200, "body": "[]\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.665+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/blocked_services/get", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.670+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/blocked_services/get", "username": "redacted", "status": 200, "body": "{\"schedule\":{\"time_zone\":\"Europe/Amsterdam\"},\"ids\":[]}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.671+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/filtering/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.678+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/filtering/status", "username": "redacted", "status": 200, "body": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.680+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/clients", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.690+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/clients", "username": "redacted", "status": 200, "body": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.690+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/querylog_info", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.694+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/querylog_info", "username": "redacted", "status": 200, "body": "{\"interval\":7,\"enabled\":true,\"anonymize_client_ip\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.695+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/stats_info", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.699+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/stats_info", "username": "redacted", "status": 200, "body": "{\"interval\":7}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.699+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/access/list", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.703+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/access/list", "username": "redacted", "status": 200, "body": "{\"allowed_clients\":[],\"disallowed_clients\":[],\"blocked_hosts\":[\"version.bind\",\"id.server\",\"hostname.bind\"]}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.703+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/dns_info", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.710+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/dns_info", "username": "redacted", "status": 200, "body": "{\"upstream_dns\":[\"https://dns.google/dns-query\",\"tls://dns.google\",\"8.8.8.8\",\"8.8.4.4\",\"https://dns.cloudflare.com/dns-query\",\"tls://1.1.1.1\",\"1.1.1.1\",\"1.0.0.1\",\"https://dns.quad9.net/dns-query\",\"tls://dns.quad9.net\",\"9.9.9.9\"],\"upstream_dns_file\":\"\",\"bootstrap_dns\":[\"9.9.9.10\",\"149.112.112.10\",\"2620:fe::10\",\"2620:fe::fe:10\"],\"fallback_dns\":[],\"protection_enabled\":true,\"ratelimit\":0,\"ratelimit_subnet_len_ipv4\":24,\"ratelimit_subnet_len_ipv6\":56,\"ratelimit_whitelist\":[],\"blocking_mode\":\"default\",\"edns_cs_enabled\":false,\"edns_cs_use_custom\":false,\"dnssec_enabled\":true,\"disable_ipv6\":false,\"upstream_mode\":\"parallel\",\"blocked_response_ttl\":10,\"cache_size\":64000000,\"cache_ttl_min\":0,\"cache_ttl_max\":0,\"cache_optimistic\":false,\"resolve_clients\":true,\"use_private_ptr_resolvers\":true,\"local_ptr_upstreams\":[],\"blocking_ipv4\":\"\",\"blocking_ipv6\":\"\",\"protection_disabled_until\":null,\"edns_cs_custom_ip\":\"\"}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.710+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "/dhcp/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.715+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "/dhcp/status", "username": "redacted", "status": 200, "body": "{\"interface_name\":\"\",\"v4\":{\"gateway_ip\":\"\",\"subnet_mask\":\"\",\"range_start\":\"\",\"range_end\":\"\",\"lease_duration\":0},\"v6\":{\"range_start\":\"\",\"lease_duration\":86400},\"leases\":[],\"static_leases\":[],\"enabled\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.716+0100	INFO	sync	sync/sync.go:271	Start sync	{"from": "srv1:8085", "to": "srv2:8085"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:43.716+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:44.088+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.3\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:44.088+0100	INFO	sync	sync/sync.go:279	Connected to replica	{"from": "srv1:8085", "to": "srv2:8085", "version": "v0.107.43"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:44.088+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/profile", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:44.822+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/profile", "username": "redacted", "status": 200, "body": "{\"name\":\"redacted\",\"language\":\"\",\"theme\":\"auto\"}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:44.823+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/parental/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.196+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/parental/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.196+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/safesearch/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.561+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/safesearch/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false,\"bing\":true,\"duckduckgo\":true,\"google\":true,\"pixabay\":true,\"yandex\":true,\"youtube\":true}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.561+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/safebrowsing/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.760+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/safebrowsing/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.761+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/querylog_info", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.906+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/querylog_info", "username": "redacted", "status": 200, "body": "{\"interval\":7,\"enabled\":true,\"anonymize_client_ip\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:45.906+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/stats_info", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.052+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/stats_info", "username": "redacted", "status": 200, "body": "{\"interval\":7}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.052+0100	INFO	client	client/client.go:337	Set stats config	{"host": "srv2:8085", "interval": 7}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.052+0100	DEBUG	client	client/client-methods.go:50	do post	{"host": "srv2:8085", "method": "POST", "path": "/stats_config", "username": "redacted", "body": "{\"interval\":7}"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.223+0100	DEBUG	client	client/client-methods.go:63	got response	{"host": "srv2:8085", "method": "POST", "path": "/stats_config", "username": "redacted", "status": 200, "body": "", "content-type": ""}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.223+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/rewrite/list", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.369+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/rewrite/list", "username": "redacted", "status": 200, "body": "[{\"domain\":\"*.rg23.nl\",\"answer\":\"srv1\"}]\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.369+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/filtering/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.518+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/filtering/status", "username": "redacted", "status": 200, "body": "redacted content"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.518+0100	INFO	client	client/client.go:269	Toggle filtering	{"host": "srv2:8085", "enabled": true, "interval": 24}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.518+0100	DEBUG	client	client/client-methods.go:50	do post	{"host": "srv2:8085", "method": "POST", "path": "/filtering/config", "username": "redacted", "body": "{\"enabled\":true,\"interval\":24}"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.681+0100	DEBUG	client	client/client-methods.go:63	got response	{"host": "srv2:8085", "method": "POST", "path": "/filtering/config", "username": "redacted", "status": 200, "body": "", "content-type": ""}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.681+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/list", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.840+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/list", "username": "redacted", "status": 200, "body": "[]\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:46.840+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/get", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:47.179+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/get", "username": "redacted", "status": 200, "body": "{\"schedule\":{\"time_zone\":\"Europe/Amsterdam\"},\"ids\":[]}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:47.179+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/clients", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:47.559+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/clients", "username": "redacted", "status": 200, "body": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:47.560+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/access/list", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:47.935+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/access/list", "username": "redacted", "status": 200, "body": "{\"allowed_clients\":[],\"disallowed_clients\":[],\"blocked_hosts\":[\"version.bind\",\"id.server\",\"hostname.bind\"]}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:47.935+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/dns_info", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:48.701+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/dns_info", "username": "redacted", "status": 200, "body": "{\"upstream_dns\":[\"1.0.0.1\",\"1.1.1.1\",\"8.8.4.4\",\"8.8.8.8\",\"9.9.9.9\",\"https://dns.cloudflare.com/dns-query\",\"https://dns.google/dns-query\",\"https://dns.quad9.net/dns-query\",\"tls://1.1.1.1\",\"tls://dns.google\",\"tls://dns.quad9.net\"],\"upstream_dns_file\":\"\",\"bootstrap_dns\":[\"149.112.112.10\",\"2620:fe::10\",\"2620:fe::fe:10\",\"9.9.9.10\"],\"fallback_dns\":[],\"protection_enabled\":true,\"ratelimit\":0,\"ratelimit_subnet_len_ipv4\":24,\"ratelimit_subnet_len_ipv6\":56,\"ratelimit_whitelist\":[],\"blocking_mode\":\"default\",\"edns_cs_enabled\":false,\"edns_cs_use_custom\":false,\"dnssec_enabled\":true,\"disable_ipv6\":false,\"upstream_mode\":\"parallel\",\"blocked_response_ttl\":10,\"cache_size\":64000000,\"cache_ttl_min\":0,\"cache_ttl_max\":0,\"cache_optimistic\":false,\"resolve_clients\":true,\"use_private_ptr_resolvers\":true,\"local_ptr_upstreams\":[],\"blocking_ipv4\":\"\",\"blocking_ipv6\":\"\",\"protection_disabled_until\":null,\"edns_cs_custom_ip\":\"\"}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:48.703+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/dhcp/status", "username": "redacted"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:49.436+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/dhcp/status", "username": "redacted", "status": 200, "body": "{\"interface_name\":\"0\",\"v4\":{\"gateway_ip\":\"\",\"subnet_mask\":\"\",\"range_start\":\"\",\"range_end\":\"\",\"lease_duration\":0},\"v6\":{\"range_start\":\"\",\"lease_duration\":86400},\"leases\":[],\"static_leases\":[],\"enabled\":false}\n", "content-type": ["application/json"]}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:49.436+0100	INFO	client	client/client.go:396	Set dhcp server config	{"host": "srv2:8085"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:49.437+0100	DEBUG	client	client/client-methods.go:50	do post	{"host": "srv2:8085", "method": "POST", "path": "/dhcp/set_config", "username": "redacted", "body": "{\"enabled\":false,\"interface_name\":\"\",\"leases\":[],\"static_leases\":[],\"v4\":{\"gateway_ip\":\"\",\"lease_duration\":0,\"range_end\":\"\",\"range_start\":\"\",\"subnet_mask\":\"\"},\"v6\":{\"lease_duration\":86400,\"range_start\":\"\"}}"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:50.158+0100	DEBUG	client	client/client-methods.go:63	got response	{"host": "srv2:8085", "method": "POST", "path": "/dhcp/set_config", "username": "redacted", "status": 400, "body": "bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n", "content-type": "text/plain; charset=utf-8"}
�[36madguardhome-sync    |�[0m 2024-01-14T12:43:50.158+0100	ERROR	sync	sync/sync.go:300	Error syncing DHCP server config	{"from": "srv1:8085", "to": "srv2:8085", "error": "400 Bad Request(bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n)"}
�[36madguardhome-sync    |�[0m github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
�[36madguardhome-sync    |�[0m 	/go/src/app/pkg/sync/sync.go:300
�[36madguardhome-sync    |�[0m github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
�[36madguardhome-sync    |�[0m 	/go/src/app/pkg/sync/sync.go:259
�[36madguardhome-sync    |�[0m github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
�[36madguardhome-sync    |�[0m 	/go/src/app/pkg/sync/sync.go:76

@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

Logs from 2nd instance

adguardhome         | 2024/01/13 23:13:39.105977 [info] filtering: saving contents of filter 1 into "/opt/adguardhome/work/data/filters/1.txt"
adguardhome         | 2024/01/13 23:13:39.148134 [info] filtering: updated filter 1: 1212897 bytes, 61330 rules
adguardhome         | 2024/01/13 23:15:48.742833 [error] filtering: updating filter from url "https://www.malwaredomainlist.com/hostslist/hosts.txt": reading from url: Get "https://www.malwaredomainlist.com/hostslist/hosts.txt": dial tcp 192.64.119.254:443: connect: connection timed out
adguardhome         | 
adguardhome         | 2024/01/13 23:15:51.370809 [info] filtering: saving contents of filter 1651592608 into "/opt/adguardhome/work/data/filters/1651592608.txt"
adguardhome         | 2024/01/13 23:15:52.301703 [info] filtering: updated filter 1651592608: 5021961 bytes, 213508 rules
adguardhome         | 2024/01/13 23:15:52.301746 [info] filtering: updated filter 1; rule count: 61330 (was 61274)
adguardhome         | 2024/01/13 23:15:52.301761 [info] filtering: updated filter 1651592608; rule count: 213508 (was 212959)
adguardhome         | 2024/01/13 23:20:03.677438 [error] POST srv2:8085 /control/dhcp/set_config: bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address

The last line repeats many times after that

@bakito
Copy link
Owner

bakito commented Jan 14, 2024

Do you have dhcp configuration enabled in you AdguatdHome master?

If not, try disabling the DHCP feautures.

  features:
    dhcp:
      serverConfig: false
      staticLeases: false

@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

I don't have DHCP configured. With hat config I get the same error:

adguardhome-sync    | 2024-01-14T13:17:20.992+0100      DEBUG   client  client/client-methods.go:63     got response    {"host": "srv2:8085", "method": "POST", "path": "/dhcp/set_config", "username": "redacted", "status": 400, "body": "bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n", "content-type": "text/plain; charset=utf-8"}
adguardhome-sync    | 2024-01-14T13:17:20.992+0100      ERROR   sync    sync/sync.go:300        Error syncing DHCP server config        {"from": "srv1:8085", "to": "srv2:8085", "error": "400 Bad Request(bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n)"}
adguardhome-sync    | github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
adguardhome-sync    |   /go/src/app/pkg/sync/sync.go:300
adguardhome-sync    | github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
adguardhome-sync    |   /go/src/app/pkg/sync/sync.go:259
adguardhome-sync    | github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
adguardhome-sync    |   /go/src/app/pkg/sync/sync.go:76

bakito added a commit that referenced this issue Jan 14, 2024
* correct config issues #271 #272

* rename type tags

* replace env lib

* move to config module

* read flags

* show e2e logs on error

* extract env

* replace deprecated env var

* increment index

* check replica numbers do not start with 0

* remove test suite

* error handling

* refactor flags

* flags test

* file test

* file test

* config tests

* extend tests

* test mixed mode

* simplify

* simplify

* test mask

* correct uniqe replicas

* Update types_test.go

* e2e test with file mode
@bakito
Copy link
Owner

bakito commented Jan 14, 2024

Can you please try your config with the newest main image ghcr.io/bakito/adguardhome-sync:main

bakito added a commit that referenced this issue Jan 14, 2024
@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

The main looks good, with no errors. Thanks!

@bakito bakito closed this as completed Jan 14, 2024
@bakito
Copy link
Owner

bakito commented Jan 14, 2024

@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

Without this config

features:
  dhcp:
    serverConfig: false
    staticLeases: false

The error persists in 0.6.1

adguardhome-sync    | 2024-01-14T15:34:19.031+0100      ERROR   sync    sync/sync.go:300        Error syncing DHCP server config        {"from": "srv1:8085", "to": "srv2:8085", "error": "400 Bad Request(bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n)"}
adguardhome-sync    | github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
adguardhome-sync    |   /go/src/app/pkg/sync/sync.go:300
adguardhome-sync    | github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
adguardhome-sync    |   /go/src/app/pkg/sync/sync.go:259
adguardhome-sync    | github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
adguardhome-sync    |   /go/src/app/pkg/sync/sync.go:76

@bakito
Copy link
Owner

bakito commented Jan 14, 2024

It's the the same as you tested in main.
How are the debug logs

@bakito bakito reopened this Jan 14, 2024
@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

I had that config still there when testing on main, with that config it is working fine.

AGH logs:

adguardhome         | 2024/01/14 15:40:02.962821 [error] POST srv2:8085 /control/dhcp/set_config: bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address

Sync:

2024-01-14T15:40:00.694+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/safesearch/status", "username": "redacted"}
2024-01-14T15:40:00.840+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/safesearch/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false,\"bing\":true,\"duckduckgo\":true,\"google\":true,\"pixabay\":true,\"yandex\":true,\"youtube\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:40:00.840+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/safebrowsing/status", "username": "redacted"}
2024-01-14T15:40:00.987+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/safebrowsing/status", "username": "redacted", "status": 200, "body": "{\"enabled\":false}\n", "content-type": ["application/json"]}
2024-01-14T15:40:00.987+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/querylog_info", "username": "redacted"}
2024-01-14T15:40:01.133+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/querylog_info", "username": "redacted", "status": 200, "body": "{\"interval\":7,\"enabled\":true,\"anonymize_client_ip\":false}\n", "content-type": ["application/json"]}
2024-01-14T15:40:01.133+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/stats_info", "username": "redacted"}
2024-01-14T15:40:01.279+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/stats_info", "username": "redacted", "status": 200, "body": "{\"interval\":7}\n", "content-type": ["application/json"]}
2024-01-14T15:40:01.279+0100	INFO	client	client/client.go:337	Set stats config	{"host": "srv2:8085", "interval": 7}
2024-01-14T15:40:01.279+0100	DEBUG	client	client/client-methods.go:50	do post	{"host": "srv2:8085", "method": "POST", "path": "/stats_config", "username": "redacted", "body": "{\"interval\":7}"}
2024-01-14T15:40:01.439+0100	DEBUG	client	client/client-methods.go:63	got response	{"host": "srv2:8085", "method": "POST", "path": "/stats_config", "username": "redacted", "status": 200, "body": "", "content-type": ""}
2024-01-14T15:40:01.440+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/rewrite/list", "username": "redacted"}
2024-01-14T15:40:01.586+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/rewrite/list", "username": "redacted", "status": 200, "body": "[{\"domain\":\"*.rg23.nl\",\"answer\":\"srv1\"}]\n", "content-type": ["application/json"]}
2024-01-14T15:40:01.586+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/filtering/status", "username": "redacted"}
2024-01-14T15:40:01.732+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/filtering/status", "username": "redacted", "status": 200, "body": "redacted"}
2024-01-14T15:40:01.733+0100	INFO	client	client/client.go:269	Toggle filtering	{"host": "srv2:8085", "enabled": true, "interval": 24}
2024-01-14T15:40:01.733+0100	DEBUG	client	client/client-methods.go:50	do post	{"host": "srv2:8085", "method": "POST", "path": "/filtering/config", "username": "redacted", "body": "{\"enabled\":true,\"interval\":24}"}
2024-01-14T15:40:01.895+0100	DEBUG	client	client/client-methods.go:63	got response	{"host": "srv2:8085", "method": "POST", "path": "/filtering/config", "username": "redacted", "status": 200, "body": "", "content-type": ""}
2024-01-14T15:40:01.895+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/list", "username": "redacted"}
2024-01-14T15:40:02.046+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/list", "username": "redacted", "status": 200, "body": "[]\n", "content-type": ["application/json"]}
2024-01-14T15:40:02.046+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/get", "username": "redacted"}
2024-01-14T15:40:02.205+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/blocked_services/get", "username": "redacted", "status": 200, "body": "{\"schedule\":{\"time_zone\":\"Europe/Amsterdam\"},\"ids\":[]}\n", "content-type": ["application/json"]}
2024-01-14T15:40:02.205+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/clients", "username": "redacted"}
2024-01-14T15:40:02.358+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/clients", "username": "redacted", "status": 200, "body": "redacted"}
2024-01-14T15:40:02.358+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/access/list", "username": "redacted"}
2024-01-14T15:40:02.506+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/access/list", "username": "redacted", "status": 200, "body": "{\"allowed_clients\":[],\"disallowed_clients\":[],\"blocked_hosts\":[\"version.bind\",\"id.server\",\"hostname.bind\"]}\n", "content-type": ["application/json"]}
2024-01-14T15:40:02.506+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/dns_info", "username": "redacted"}
2024-01-14T15:40:02.654+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/dns_info", "username": "redacted", "status": 200, "body": "{\"upstream_dns\":[\"1.0.0.1\",\"1.1.1.1\",\"8.8.4.4\",\"8.8.8.8\",\"9.9.9.9\",\"https://dns.cloudflare.com/dns-query\",\"https://dns.google/dns-query\",\"https://dns.quad9.net/dns-query\",\"tls://1.1.1.1\",\"tls://dns.google\",\"tls://dns.quad9.net\"],\"upstream_dns_file\":\"\",\"bootstrap_dns\":[\"149.112.112.10\",\"2620:fe::10\",\"2620:fe::fe:10\",\"9.9.9.10\"],\"fallback_dns\":[],\"protection_enabled\":true,\"ratelimit\":0,\"ratelimit_subnet_len_ipv4\":24,\"ratelimit_subnet_len_ipv6\":56,\"ratelimit_whitelist\":[],\"blocking_mode\":\"default\",\"edns_cs_enabled\":false,\"edns_cs_use_custom\":false,\"dnssec_enabled\":true,\"disable_ipv6\":false,\"upstream_mode\":\"parallel\",\"blocked_response_ttl\":10,\"cache_size\":64000000,\"cache_ttl_min\":0,\"cache_ttl_max\":0,\"cache_optimistic\":false,\"resolve_clients\":true,\"use_private_ptr_resolvers\":true,\"local_ptr_upstreams\":[],\"blocking_ipv4\":\"\",\"blocking_ipv6\":\"\",\"protection_disabled_until\":null,\"edns_cs_custom_ip\":\"\"}\n", "content-type": ["application/json"]}
2024-01-14T15:40:02.655+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "/dhcp/status", "username": "redacted"}
2024-01-14T15:40:02.806+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "/dhcp/status", "username": "redacted", "status": 200, "body": "{\"interface_name\":\"0\",\"v4\":{\"gateway_ip\":\"\",\"subnet_mask\":\"\",\"range_start\":\"\",\"range_end\":\"\",\"lease_duration\":0},\"v6\":{\"range_start\":\"\",\"lease_duration\":86400},\"leases\":[],\"static_leases\":[],\"enabled\":false}\n", "content-type": ["application/json"]}
2024-01-14T15:40:02.807+0100	INFO	client	client/client.go:396	Set dhcp server config	{"host": "srv2:8085"}
2024-01-14T15:40:02.807+0100	DEBUG	client	client/client-methods.go:50	do post	{"host": "srv2:8085", "method": "POST", "path": "/dhcp/set_config", "username": "redacted", "body": "{\"enabled\":false,\"interface_name\":\"\",\"leases\":[],\"static_leases\":[],\"v4\":{\"gateway_ip\":\"\",\"lease_duration\":0,\"range_end\":\"\",\"range_start\":\"\",\"subnet_mask\":\"\"},\"v6\":{\"lease_duration\":86400,\"range_start\":\"\"}}"}
2024-01-14T15:40:02.964+0100	DEBUG	client	client/client-methods.go:63	got response	{"host": "srv2:8085", "method": "POST", "path": "/dhcp/set_config", "username": "redacted", "status": 400, "body": "bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n", "content-type": "text/plain; charset=utf-8"}
2024-01-14T15:40:02.964+0100	ERROR	sync	sync/sync.go:300	Error syncing DHCP server config	{"from": "srv1:8085", "to": "srv2:8085", "error": "400 Bad Request(bad dhcpv4 configuration: dhcpv4: invalid IP is not an IPv4 address\n)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
	/go/src/app/pkg/sync/sync.go:300
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
	/go/src/app/pkg/sync/sync.go:259
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
	/go/src/app/pkg/sync/sync.go:59
github.com/robfig/cron/v3.FuncJob.Run
	/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
	/go/pkg/mod/github.com/robfig/cron/v3@v3.0.1/cron.go:312
2024-01-14T15:46:17.265+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:46:17.278+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.19\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:46:17.278+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:46:17.425+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.3\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:46:17.588+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:46:17.600+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.19\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:46:17.600+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:46:17.747+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.3\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:46:27.030+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:46:27.041+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.19\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:46:27.041+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:46:27.190+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.3\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:48:36.486+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:48:36.495+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv1:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.19\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}
2024-01-14T15:48:36.495+0100	DEBUG	client	client/client-methods.go:17	do get	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted"}
2024-01-14T15:48:36.642+0100	DEBUG	client	client/client-methods.go:37	got response	{"host": "srv2:8085", "method": "GET", "path": "status", "username": "redacted", "status": 200, "body": "{\"version\":\"v0.107.43\",\"language\":\"\",\"dns_addresses\":[\"127.0.0.1\",\"172.19.0.3\"],\"dns_port\":53,\"http_port\":80,\"protection_disabled_duration\":0,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true}\n", "content-type": ["application/json"]}

Config:

# cron expression to run in daemon mode. (default; "" = runs only once)
cron: "*/10 * * * *"

# runs the synchronisation on startup
runOnStart: true

origin:
  # url of the origin instance
  url: http://srv1:8085
  # apiPath: define an api path if other than "/control"
  insecureSkipVerify: true # disable tls check
  username: redacted
  password: redacted

# replicas instances (optional, if more than one)
replicas:
  # url of the replica instance
  - url: http://srv2:8085
    username: redacted
    password: redacted

# Configure the sync API server, disabled if api port is 0
api:
  # Port, default 8080
  port: 8080
  # if username and password are defined, basic auth is applied to the sync API 
  # username: username
  # password: password

# Configure sync features; by default all features are enabled.
# features:
#   generalSettings: true
#   queryLogConfig: true
#   statsConfig: true
#   clientSettings: true
#   services: true
#   filters: true
#   dhcp:
#     serverConfig: true
#     staticLeases: true
#   dns:
#     serverConfig: true
#     accessLists: true
#     rewrites: true

bakito added a commit that referenced this issue Jan 14, 2024
bakito added a commit that referenced this issue Jan 14, 2024
@bakito
Copy link
Owner

bakito commented Jan 14, 2024

Please try v0.6.2 - I could reproduce the issue and fix it in my tests

@golles
Copy link
Contributor Author

golles commented Jan 14, 2024

v0.6.2 looks good, thank you!

@golles golles closed this as completed Jan 14, 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