AdguardTeam/AdGuardHome · error
duplicated values: %v
Error message
duplicated values: %v
What it means
This error is returned by the service manager's Refresh operation when it fails to rebuild its configuration manager before restarting services. Refresh creates a brand-new configmgr.New instance from s.confMgrConf, and any failure in that construction (config file unreadable, invalid YAML, bad settings) surfaces wrapped here. It aborts the reconfiguration before any services are restarted.
Source
Thrown at internal/aghalg/aghalg.go:66
return merged
}
// Validate returns an error enumerating all elements that aren't unique.
func (uc UniqChecker[T]) Validate() (err error) {
var dup []T
for elem, num := range uc {
if num > 1 {
dup = append(dup, elem)
}
}
if len(dup) == 0 {
return nil
}
slices.Sort(dup)
return fmt.Errorf("duplicated values: %v", dup)
}
View on GitHub (pinned to b41aefbe51)
Solutions
- Inspect the wrapped error with errors.Unwrap to find the real cause (usually a config parse or validation message)
- Validate the configuration file with a YAML linter or by running the config manager's validate path before refreshing
- Fix file permissions (chown/chmod) so the service account can read the config
- Restore the last known-good config backup and refresh again
Example fix
# before
err := srv.Refresh(ctx)
# after
err := srv.Refresh(ctx)
if err != nil {
log.Printf("refresh failed: %v", errors.Unwrap(err)) // real cause
} Defensive patterns
Strategy: try-catch
Validate before calling
// Validate config parses before refreshing
cfg, err := config.Load(path)
if err != nil { log.Fatal(err) } Try / catch
if err := svc.Refresh(ctx); err != nil {
if strings.Contains(err.Error(), "updating configuration manager") {
// config problem; inspect errors.Unwrap(err)
}
return fmt.Errorf("refresh: %w", err)
} Prevention
- Lint/validate config files before triggering refresh
- Keep config backups and diff before applying
- Run config validation as a pre-deploy step in CI
When it happens
Trigger: Calling serviceMgr.Refresh (e.g. on SIGHUP or after config edits) while the underlying configuration file is malformed, missing, unreadable (permissions), or contains values the config manager rejects during New().
Common situations: Editing the YAML config by hand and introducing a syntax error, then triggering a refresh; changing file ownership/permissions so the process cannot read the config; upgrading to a version with stricter config validation while keeping an old config file.
Related errors
- json duration is nil
- unmarshalling json data into aghalg.NullBool: bad value %q
- networksetup failed to set dns servers: %w
- found no dns servers in %s
- writing conf: %w
AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27).
Data as JSON: /api/errors/8540fa49c7d5ca8d.
Report an issue: GitHub.