netbirdio/netbird · error
change name %q -> %q: %w
Error message
change name %q -> %q: %w
What it means
rename() renames the freshly created interface with `ifconfig <old> name <new>` and wraps any non-zero exit. Typical kernel causes: the target name is already used by another interface, the new name exceeds the FreeBSD interface-name limit (IFNAMSIZ-1 = 15 characters), or the process lacks privileges.
Source
Thrown at client/iface/freebsd/link.go:152
return "", fmt.Errorf("create %s interface: %w", groupName, err)
}
interfaceName, err := parseIFName(output)
if err != nil {
return "", fmt.Errorf("parse interface name: %w", err)
}
return interfaceName, nil
}
func (l *Link) rename(oldName, newName string) (string, error) {
cmd := exec.Command("ifconfig", oldName, "name", newName)
output, err := cmd.CombinedOutput()
if err != nil {
log.Debugf("ifconfig out: %s", output)
return "", fmt.Errorf("change name %q -> %q: %w", oldName, newName, err)
}
interfaceName, err := parseIFName(output)
if err != nil {
return "", fmt.Errorf("parse new name: %w", err)
}
return interfaceName, nil
}
func (l *Link) del(name string) error {
var stderr bytes.Buffer
cmd := exec.Command("ifconfig", name, "destroy")
cmd.Stderr = &stderr
err := cmd.Run()
if err != nil {View on GitHub (pinned to 93e97f4bf1)
Solutions
- Check the target name is free: `ifconfig <name>` should report 'does not exist'
- Destroy the stale holder with `sudo ifconfig <name> destroy`, then retry netbird up
- Keep the configured interface name at or under 15 characters
- Run the agent as root
Example fix
# before $ ifconfig wg0 name wt0 ifconfig: SIOCSIFNAME: File exists # after $ sudo ifconfig wt0 destroy $ sudo ifconfig wg0 name wt0
Defensive patterns
Strategy: validation
Validate before calling
if len(newName) > 15 {
return fmt.Errorf("interface name %s exceeds FreeBSD IFNAMSIZ-1 (15 chars)", newName)
}
if _, err := freebsd.LinkByName(newName); err == nil {
return fmt.Errorf("target interface name %s already exists", newName)
} Prevention
- Verify target name availability before renaming
- Cap configured interface names at 15 characters
- Run netbird down after crashes so stale names are released before the next up
When it happens
Trigger: Add() after create() when the parsed name differs from the configured one; fails when l.name already exists, when the configured interface name is longer than 15 chars, or when run unprivileged.
Common situations: A leftover interface from a crashed run still holds the target name; custom interface name in configuration that is too long; two agents racing to take the same name.
Related errors
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/cf4d24a49adc8290.
Report an issue: GitHub.