{"record":{"id":"3a060076480127f5","repo":"chenhg5/cc-connect","slug":"remove-plist-w","errorCode":null,"errorMessage":"remove plist: %w","messagePattern":"remove plist: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"daemon/launchd.go","lineNumber":86,"sourceCode":"\t}\n\n\tdomain := preferredLaunchdDomain()\n\tif out, err := runLaunchctl(\"bootstrap\", domain, plistPath); err != nil {\n\t\treturn fmt.Errorf(\"launchctl bootstrap: %s (%w)\", out, err)\n\t}\n\n\tif _, err := runLaunchctl(\"kickstart\", \"-kp\", launchdTarget(domain)); err != nil {\n\t\treturn fmt.Errorf(\"launchctl kickstart: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (m *launchdManager) Uninstall() error {\n\tbootoutLaunchdTargets()\n\n\tplistPath := launchdPlistPath()\n\tif err := os.Remove(plistPath); err != nil && !os.IsNotExist(err) {\n\t\treturn fmt.Errorf(\"remove plist: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (*launchdManager) Start() error {\n\tif _, target, _, ok := loadedLaunchdTarget(); ok {\n\t\tout, err := runLaunchctl(\"kickstart\", \"-kp\", target)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"start: %s (%w)\", out, err)\n\t\t}\n\t\treturn nil\n\t}\n\n\tdomain := preferredLaunchdDomain()\n\tplistPath := launchdPlistPath()\n\tvar out string\n\tif _, err := runLaunchctl(\"bootstrap\", domain, plistPath); err != nil {\n\t\t// already bootstrapped — try kickstart","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/daemon/launchd.go#L68-L104","documentation":"launchd Uninstall wraps os.Remove failure on the plist when the error is not 'not exists' (typically permission denied). A missing plist is tolerated by design; other removal failures abort the uninstall.","triggerScenarios":"Thrown at daemon/launchd.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check file ownership of the plist in ~/Library/LaunchAgents","Bootout the job before removing if launchd holds it open"],"exampleFix":null,"handlingStrategy":"try-catch","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-14T00:17:10.932Z"}