{"record":{"id":"b6791db18b4959f9","repo":"netbirdio/netbird","slug":"create-service-w","errorCode":null,"errorMessage":"create service: %w","messagePattern":"create service: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/service_installer.go","lineNumber":233,"sourceCode":"\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 {\n\t\t\t\tcmd.Printf(\"Warning: failed to stop service: %v\\n\", err)\n\t\t\t}\n\t\t}\n\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}","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/service_installer.go#L215-L251","documentation":"service.New() refused to construct the service handle during reconfigure. kardianos detects the platform service manager at construction and errors when none is supported, so the daemon cannot be managed on this system.","triggerScenarios":"Reconfigure in a minimal container, chroot, or init-less environment where no systemd/launchd/Windows SCM/openrc backend is detectable.","commonSituations":"Trying to manage the service from inside docker; CI scripts invoking reconfigure in scratch containers.","solutions":["Run reconfigure on the host with its real init system","If containerized, ensure systemd runs as PID 1 (privileged container with /sbin/init)","Confirm the platform is supported by kardianos/service","Fall back to explicit sudo netbird service uninstall && sudo netbird service install on the host"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if runtime.GOOS == \"linux\" {\n\tif _, err := os.Stat(\"/run/systemd/system\"); err != nil {\n\t\treturn errors.New(\"systemd not detected; cannot manage the service here\")\n\t}\n}","typeGuard":null,"tryCatchPattern":"s, err := newSVC(newProgram(ctx, cancel), svcConfig)\nif err != nil {\n\treturn fmt.Errorf(\"create service: %w\", err)\n}\n// Unsupported-manager errors are environmental: fix the environment (run on the host, systemd as PID 1), do not retry.","preventionTips":["Never manage the service from inside init-less containers","Verify the service manager exists before scripting reconfigure"],"tags":["service","reconfigure","init-system","containers","go"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}