AdguardTeam/AdGuardHome · error
another client %q uses the same IP %q
Error message
another client %q uses the same IP %q
What it means
Thrown when a new or updated client's IP address collides with another client's IP in the storage index. Each persistent client must have a unique IP. The error reports the existing client's name and the clashing IP.
Source
Thrown at internal/client/index.go:123
// clashes returns an error if the index contains a different persistent client
// with at least a single identifier contained by c. c must be non-nil.
func (ci *index) clashes(c *Persistent) (err error) {
if p := ci.clashesName(c); p != nil {
return fmt.Errorf("another client uses the same name %q", p.Name)
}
for _, id := range c.ClientIDs {
existing, ok := ci.clientIDToUID[id]
if ok && existing != c.UID {
p := ci.uidToClient[existing]
return fmt.Errorf("another client %q uses the same ClientID %q", p.Name, id)
}
}
p, ip := ci.clashesIP(c)
if p != nil {
return fmt.Errorf("another client %q uses the same IP %q", p.Name, ip)
}
p, s := ci.clashesSubnet(c)
if p != nil {
return fmt.Errorf("another client %q uses the same subnet %q", p.Name, s)
}
p, mac := ci.clashesMAC(c)
if p != nil {
return fmt.Errorf("another client %q uses the same MAC %q", p.Name, mac)
}
return nil
}
// clashesName returns existing persistent client with the same name as c or
// nil. c must be non-nil.
func (ci *index) clashesName(c *Persistent) (existing *Persistent) {View on GitHub (pinned to b41aefbe51)
Solutions
- Find the client named in the message and change one of the two IPs to a free address
- If the same device is being re-added, use Update on the existing client by name instead of Add
- Validate IPs for uniqueness before loading InitialClients into NewStorage
Example fix
// before client.IP = "192.168.1.10" // already used by "printer" s.Add(ctx, client) // after client.IP = "192.168.1.42" s.Add(ctx, client)
Defensive patterns
Strategy: validation
Validate before calling
for _, p := range existing {
if p.UID != c.UID && p.IP == c.IP { /* clash */ }
} Try / catch
if err := s.Add(ctx, c); err != nil && strings.Contains(err.Error(), "uses the same IP") { /* reassign IP or Update */ } Prevention
- Allocate client IPs from a managed pool
- Deduplicate IPs when generating InitialClients
When it happens
Trigger: Calling Storage.Add or Storage.Update with a client whose IP (or whose IP is matched by clashesIP) equals the IP of a different already-stored client.
Common situations: Static-IP client lists where two devices were assigned the same address, DHCP reservations duplicated across clients, importing YAML configs with copy-pasted IP fields.
Related errors
- another client %q uses the same ClientID %q
- another client %q uses the same subnet %q
- another client %q uses the same MAC %q
- invalid upstream servers: %w
- invalid tag: %q
AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27).
Data as JSON: /api/errors/ca1614d9939d3ed8.
Report an issue: GitHub.