{"record":{"id":"092fe6876b617db4","repo":"netbirdio/netbird","slug":"check-service-status-w","errorCode":null,"errorMessage":"check service status: %w","messagePattern":"check service status: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/service_installer.go","lineNumber":220,"sourceCode":"}\n\nvar reconfigureCmd = &cobra.Command{\n\tUse:   \"reconfigure\",\n\tShort: \"reconfigures NetBird service with new settings\",\n\tLong: `Reconfigures the NetBird service with new settings without manual uninstall/install.\nThis command will temporarily stop the service, update its configuration, and restart it if it was running.`,\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif err := setupServiceCommand(cmd); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err := loadAndApplyServiceParams(cmd); err != nil {\n\t\t\tcmd.PrintErrf(\"Warning: failed to load saved service params: %v\\n\", err)\n\t\t}\n\n\t\twasRunning, err := isServiceRunning()\n\t\tif err != nil && !errors.Is(err, ErrGetServiceStatus) {\n\t\t\treturn fmt.Errorf(\"check service status: %w\", err)\n\t\t}\n\n\t\tsvcConfig, err := createServiceConfigForInstall()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tctx, cancel := context.WithCancel(cmd.Context())\n\t\tdefer cancel()\n\n\t\ts, err := newSVC(newProgram(ctx, cancel), svcConfig)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"create service: %w\", err)\n\t\t}\n\n\t\tif wasRunning {\n\t\t\tcmd.Println(\"Stopping NetBird service...\")\n\t\t\tif err := s.Stop(); err != nil {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/service_installer.go#L202-L238","documentation":"During reconfigure, isServiceRunning failed for a reason other than querying status. Status errors are wrapped with ErrGetServiceStatus and tolerated by the caller; this wrap therefore comes from newSVCConfig (bad --service-env parse) or newSVC (service.New cannot find a supported service manager).","triggerScenarios":"`netbird service reconfigure --service-env BAD` (no '='); running reconfigure in an environment with no systemd/launchd/SCM/openrc so kardianos cannot select a backend.","commonSituations":"Reconfiguring inside a container or init-less VM; forwarding install flags to reconfigure with a typo in KEY=VALUE.","solutions":["Fix the --service-env format to KEY=VALUE","Run reconfigure elevated on a host with a real init system","Distinguish the wrapped text: 'parse service environment variables' means flags, an unsupported-system message means the manager","Re-run sudo netbird service reconfigure"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if len(serviceEnvVars) > 0 {\n\tif _, err := parseServiceEnvVars(serviceEnvVars); err != nil {\n\t\treturn err\n\t}\n}\nif _, err := os.Stat(\"/run/systemd/system\"); runtime.GOOS == \"linux\" && err != nil {\n\treturn errors.New(\"no systemd detected; reconfigure needs a supported init system\")\n}","typeGuard":"func isStatusProbeFailure(err error) bool {\n\treturn errors.Is(err, ErrGetServiceStatus)\n}","tryCatchPattern":"wasRunning, err := isServiceRunning()\nif err != nil && !errors.Is(err, ErrGetServiceStatus) {\n\treturn fmt.Errorf(\"check service status: %w\", err)\n}\n// Status-probe failures are tolerated; only config/manager construction errors abort.","preventionTips":["Validate --service-env entries before reconfigure","Run reconfigure on hosts with a real init system"],"tags":["service","reconfigure","environment-variables","init-system","go"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}