netbirdio/netbird · error
install service with new config: %w
Error message
install service with new config: %w
What it means
After removing the old registration, reconfigure could not install the new one. kardianos Install() failed, commonly because the old unit file is still present (the manager has not released it), privileges are missing, or the service name collides.
Source
Thrown at client/cmd/service_installer.go:250
if err != nil {
return fmt.Errorf("create service: %w", err)
}
if wasRunning {
cmd.Println("Stopping NetBird service...")
if err := s.Stop(); err != nil {
cmd.Printf("Warning: failed to stop service: %v\n", err)
}
}
cmd.Println("Removing existing service configuration...")
if err := s.Uninstall(); err != nil {
return fmt.Errorf("uninstall existing service: %w", err)
}
cmd.Println("Installing service with new configuration...")
if err := s.Install(); err != nil {
return fmt.Errorf("install service with new config: %w", err)
}
if err := saveServiceParams(currentServiceParams()); err != nil {
cmd.PrintErrf("Warning: failed to save service params: %v\n", err)
}
if wasRunning {
cmd.Println("Starting NetBird service...")
if err := s.Start(); err != nil {
return fmt.Errorf("start service after reconfigure: %w", err)
}
cmd.Println("NetBird service has been reconfigured and started")
} else {
cmd.Println("NetBird service has been reconfigured")
}
return nil
},View on GitHub (pinned to 93e97f4bf1)
Solutions
- Re-run elevated: sudo netbird service reconfigure
- Check for a leftover unit (ls /etc/systemd/system/netbird.service) and remove it if the manager says not-installed
- Run systemctl daemon-reload, then retry
- Fall back to explicit sudo netbird service uninstall && sudo netbird service install
Defensive patterns
Strategy: retry
Validate before calling
unit := filepath.Join("/etc/systemd/system", serviceName+".service")
if _, err := os.Stat(unit); err == nil {
_ = exec.Command("systemctl", "daemon-reload").Run()
} Try / catch
var err error
for attempt := 0; attempt < 2; attempt++ {
if attempt > 0 {
time.Sleep(500 * time.Millisecond) // give the manager time to release the unit
}
if err = s.Install(); err == nil {
break
}
}
if err != nil {
return fmt.Errorf("install service with new config: %w", err)
} Prevention
- Run systemctl daemon-reload between uninstall and install
- Leave a short settle delay when scripting reconfigure on slow managers
When it happens
Trigger: /etc/systemd/system/netbird.service still exists when Install runs after Uninstall; running reconfigure non-elevated; a same-named service owned by another principal on Windows.
Common situations: Reconfigure immediately after stop on slow managers; unit files left behind by earlier manual edits.
Related errors
- uninstall existing service: %w
- install service: %w
- uninstall service: %w
- start service after reconfigure: %w
- check service status: %w
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/29ed8ae062cd6993.
Report an issue: GitHub.