AdguardTeam/AdGuardHome · error
invalid value %q: expected one slash
Error message
invalid value %q: expected one slash
What it means
Each ipset configuration line must have the form 'host1,host2/ipset1,ipset2'. This error means the line did not contain exactly one '/' separator after trimming.
Source
Thrown at internal/ipset/ipset_linux.go:235
m.ipv4Conn, err = m.dial(netfilter.ProtoIPv4, conf)
if err != nil {
return fmt.Errorf("dialing v4: %w", err)
}
m.ipv6Conn, err = m.dial(netfilter.ProtoIPv6, conf)
if err != nil {
return fmt.Errorf("dialing v6: %w", err)
}
return nil
}
// parseIpsetConfigLine parses one ipset configuration line.
func parseIpsetConfigLine(confStr string) (hosts, ipsetNames []string, err error) {
confStr = strings.TrimSpace(confStr)
hostsAndNames := strings.Split(confStr, "/")
if len(hostsAndNames) != 2 {
return nil, nil, fmt.Errorf("invalid value %q: expected one slash", confStr)
}
hosts = strings.Split(hostsAndNames[0], ",")
ipsetNames = strings.Split(hostsAndNames[1], ",")
if len(ipsetNames) == 0 {
return nil, nil, nil
}
for i := range ipsetNames {
ipsetNames[i] = strings.TrimSpace(ipsetNames[i])
if len(ipsetNames[i]) == 0 {
return nil, nil, fmt.Errorf("invalid value %q: empty ipset name", confStr)
}
}
for i := range hosts {
hosts[i] = strings.ToLower(strings.TrimSpace(hosts[i]))View on GitHub (pinned to b41aefbe51)
Solutions
- Rewrite the line as 'domain[,domain...]/ipsetname[,ipsetname...]'
- Remove stray slashes or empty lines that aren't blank
- Reload/restart the service after fixing the config
Example fix
# before - example.org # after - example.org/myset
Defensive patterns
Strategy: validation
Validate before calling
func validIpsetLine(line string) bool {
parts := strings.Split(strings.TrimSpace(line), "/")
return len(parts) == 2
} Prevention
- Validate every config line with a split-on-slash check before passing Lines
- Add config schema tests in CI
When it happens
Trigger: parseIpsetConfigLine is called with a conf.Lines entry like 'example.org' (no slash), 'a/b/c' (two slashes), or 'a / b / c'.
Common situations: YAML config typo: using spaces instead of a slash, forgetting the ipset part, or including a URL-like value in the ipset config line.
Related errors
- invalid value %q: empty ipset name
- networksetup failed to set dns servers: %w
- found no dns servers in %s
- writing conf: %w
- invalid pattern %q: %w
AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27).
Data as JSON: /api/errors/228b992de1b2e805.
Report an issue: GitHub.