netbirdio/netbird · error
start service
Error message
start service: %w
What it means
The service-control start command could not start the netbird service via the OS service manager. Setup and JSON-socket validation had already passed; the failure is at the manager level — insufficient privileges, an uninstalled service, or an init-system error.
Solutions
- Run with elevated privileges (root/administrator)
- Install the service first if it is not present
- Check the init system journal / Event Log for the manager's own error
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at client/cmd/service_controller.go:278 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of netbirdio/netbird@93e97f4bf1 (2026-08-16).
Data as JSON: /api/errors/a0d874c4dc5f0fbf.
Report an issue: GitHub.
Appendix: source
Thrown at client/cmd/service_controller.go:278
return s.Run()
},
}
var startCmd = &cobra.Command{
Use: "start",
Short: "starts NetBird service",
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithCancel(cmd.Context())
s, err := setupServiceControlCommand(cmd, ctx, cancel, false)
if err != nil {
return err
}
if err := validateJSONSocketFlags(); err != nil {
return err
}
if err := s.Start(); err != nil {
return fmt.Errorf("start service: %w", err)
}
cmd.Println("NetBird service has been started")
return nil
},
}
var stopCmd = &cobra.Command{
Use: "stop",
Short: "stops NetBird service",
RunE: func(cmd *cobra.Command, args []string) error {
ctx, cancel := context.WithCancel(cmd.Context())
s, err := setupServiceControlCommand(cmd, ctx, cancel, false)
if err != nil {
return err
}
if err := s.Stop(); err != nil {
return fmt.Errorf("stop service: %w", err)View on GitHub (pinned to 93e97f4bf1)