{"record":{"id":"b5545ec758a40974","repo":"chenhg5/cc-connect","slug":"restart-s-w","errorCode":null,"errorMessage":"restart: %s (%w)","messagePattern":"restart: (.+?) \\(%w\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"daemon/launchd.go","lineNumber":154,"sourceCode":"\tbootoutLaunchdTargets()\n\n\tplistPath := launchdPlistPath()\n\n\t// launchd bootout is asynchronous; retry bootstrap with backoff\n\t// to avoid \"Bootstrap failed: 5\" race condition.\n\tvar out string\n\tvar err error\n\tfor i := 0; i < 3; i++ {\n\t\tif i > 0 {\n\t\t\ttime.Sleep(500 * time.Millisecond)\n\t\t}\n\t\tout, err = runLaunchctl(\"bootstrap\", domain, plistPath)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"restart: %s (%w)\", out, err)\n\t}\n\tif _, err := runLaunchctl(\"kickstart\", \"-kp\", target); err != nil {\n\t\treturn fmt.Errorf(\"restart kickstart: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (*launchdManager) Status() (*Status, error) {\n\tst := &Status{Platform: \"launchd\"}\n\n\tplistPath := launchdPlistPath()\n\tif _, err := os.Stat(plistPath); err != nil {\n\t\treturn st, nil\n\t}\n\tst.Installed = true\n\n\t_, _, out, ok := loadedLaunchdTarget()\n\tif !ok {","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/daemon/launchd.go#L136-L172","documentation":"launchdManager.Restart wraps the final bootstrap failure after 3 attempts with 500ms backoff (bootout is asynchronous, causing 'Bootstrap failed: 5' races); the restart aborts before kickstart, leaving the service unloaded.","triggerScenarios":"Thrown at daemon/launchd.go:154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the restart; the async bootout usually completes shortly","Verify with Status/bootout list that the job actually unloaded"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}