{"record":{"id":"a891bcfa6a57a023","repo":"netbirdio/netbird","slug":"start-service-after-reconfigure-w","errorCode":null,"errorMessage":"start service after reconfigure: %w","messagePattern":"start service after reconfigure: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/service_installer.go","lineNumber":260,"sourceCode":"\n\t\tcmd.Println(\"Removing existing service configuration...\")\n\t\tif err := s.Uninstall(); err != nil {\n\t\t\treturn fmt.Errorf(\"uninstall existing service: %w\", err)\n\t\t}\n\n\t\tcmd.Println(\"Installing service with new configuration...\")\n\t\tif err := s.Install(); err != nil {\n\t\t\treturn fmt.Errorf(\"install service with new config: %w\", err)\n\t\t}\n\n\t\tif err := saveServiceParams(currentServiceParams()); err != nil {\n\t\t\tcmd.PrintErrf(\"Warning: failed to save service params: %v\\n\", err)\n\t\t}\n\n\t\tif wasRunning {\n\t\t\tcmd.Println(\"Starting NetBird service...\")\n\t\t\tif err := s.Start(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"start service after reconfigure: %w\", err)\n\t\t\t}\n\t\t\tcmd.Println(\"NetBird service has been reconfigured and started\")\n\t\t} else {\n\t\t\tcmd.Println(\"NetBird service has been reconfigured\")\n\t\t}\n\n\t\treturn nil\n\t},\n}\n\nfunc isServiceRunning() (bool, error) {\n\tcfg, err := newSVCConfig()\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/service_installer.go#L242-L278","documentation":"The reconfigured service was reinstalled but s.Start() failed, leaving it installed-but-stopped. The wrapped manager error (systemd job result, SCM code) identifies the start failure; the daemon's own logs usually hold the real reason.","triggerScenarios":"The ExecStart binary path no longer exists (manually moved/upgraded binary); the service exits immediately due to a bad flag such as an invalid --daemon-addr; systemd start job timed out; Windows start access denied.","commonSituations":"Replacing the netbird binary out from under an installed service; reconfiguring with a flag combination the daemon rejects at startup.","solutions":["Check why it failed: journalctl -u netbird -e (or Windows event log) and systemctl status netbird","Verify the ExecStart path in the unit points to an existing netbird binary","Fix the flags passed to reconfigure (valid --daemon-addr, valid log level) and re-run","Start manually with sudo netbird service start after correcting the cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if _, err := exec.LookPath(\"netbird\"); err != nil {\n\treturn errors.New(\"netbird binary not on PATH for the service ExecStart\")\n}","typeGuard":null,"tryCatchPattern":"if err := s.Start(); err != nil {\n\tlog.Warnf(\"start failed, inspecting: %v\", err)\n\tif out, jerr := exec.Command(\"journalctl\", \"-u\", serviceName, \"-n\", \"50\", \"--no-pager\").CombinedOutput(); jerr == nil {\n\t\tlog.Debugf(\"service log tail: %s\", out)\n\t}\n\ttime.Sleep(2 * time.Second)\n\tif retryErr := s.Start(); retryErr != nil {\n\t\treturn fmt.Errorf(\"start service after reconfigure: %w\", retryErr)\n\t}\n}","preventionTips":["Keep the binary path stable across upgrades","Check journalctl -u netbird before assuming a code bug","Validate flags passed to reconfigure the same way install would"],"tags":["service","reconfigure","startup","systemd","go"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}