{"record":{"id":"6d2fd775152e4419","repo":"chenhg5/cc-connect","slug":"acp-probe-start-s-w","errorCode":null,"errorMessage":"acp: probe start %s: %w","messagePattern":"acp: probe start (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/acp/list_sessions.go","lineNumber":87,"sourceCode":"func (a *Agent) probeSpawn(ctx context.Context, cwd string) (*transport, *bytes.Buffer, func(), error) {\n\tallArgs := append(append([]string{}, a.cliExtraArgs...), a.args...)\n\tcmd := exec.CommandContext(ctx, a.cmd, allArgs...)\n\tcmd.Dir = cwd\n\tcmd.Env = core.MergeEnv(os.Environ(), a.extraEnv)\n\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"acp: probe stdin pipe: %w\", err)\n\t}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"acp: probe stdout pipe: %w\", err)\n\t}\n\tvar stderrBuf bytes.Buffer\n\tcmd.Stderr = io.MultiWriter(&stderrBuf)\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"acp: probe start %s: %w\", a.cmd, err)\n\t}\n\n\t// The server-request handler needs to reference `tr` itself in order\n\t// to respondError; declare via var so the closure captures the\n\t// variable (which is assigned to a *transport below) rather than an\n\t// uninitialised copy.\n\tvar tr *transport\n\ttr = newTransport(stdout, stdin,\n\t\tfunc(method string, _ json.RawMessage) {\n\t\t\tslog.Debug(\"acp-probe: notification\", \"method\", method)\n\t\t},\n\t\tfunc(_ string, id json.RawMessage, _ json.RawMessage) {\n\t\t\t_ = tr.respondError(id, -32601, \"probe: method not implemented\")\n\t\t},\n\t)\n\n\treadCtx, cancelRead := context.WithCancel(ctx)\n\tgo tr.readLoop(readCtx)","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/acp/list_sessions.go#L69-L105","documentation":"probeSpawn calls cmd.Start() to launch the ACP agent binary for session enumeration. If the OS cannot start the process, this error wraps the exec failure with the binary name. Unlike errors 27/28, pipe creation succeeded and the failure is in process creation itself.","triggerScenarios":"cmd.Start() returns an error in probeSpawn: the binary path exists via LookPath earlier but is not executable (ENOEXEC/EACCES), the working directory (cmd.Dir = cwd) no longer exists, interpreter shebang missing, or fork/exec limits (pid/memory) are exhausted.","commonSituations":"Binary is a script without a shebang or without +x; configured work_dir was deleted or is unreadable by the daemon user; running out of PIDs/memory in constrained containers; macOS Gatekeeper blocking the unsigned binary.","solutions":["chmod +x the binary and, if it's a script, add a shebang line (e.g. #!/usr/bin/env node).","Verify the configured work_dir exists and is accessible to the user running cc-connect.","Run the binary manually with the same args from the same cwd to see the raw exec error.","Check process/memory limits (fork failures) in containers; on macOS, clear Gatekeeper quarantine with `xattr -d com.apple.quarantine <bin>`."],"exampleFix":"// before\n$ ls -l my-agent\n-rw-r--r-- my-agent   # not executable\n// after\n$ chmod +x my-agent && cc-connect  # probe start succeeds","handlingStrategy":"validation","validationCode":"func checkStartable(cmd string, args []string, cwd string) error {\n    p, err := exec.LookPath(cmd)\n    if err != nil {\n        return err\n    }\n    if fi, err := os.Stat(p); err != nil || fi.IsDir() || fi.Mode()&0o111 == 0 {\n        return fmt.Errorf(\"%s is not executable\", p)\n    }\n    if fi, err := os.Stat(cwd); err != nil || !fi.IsDir() {\n        return fmt.Errorf(\"work_dir %q is not a directory\", cwd)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"probe start \") {\n    var ee *exec.ExitError\n    if !errors.As(err, &ee) { // not exit-error: process never started\n        slog.Error(\"acp agent binary cannot be launched; check exec bit, shebang and work_dir\", \"err\", err)\n    }\n    return err\n}","preventionTips":["chmod +x the agent binary and ensure scripts have a shebang","Verify work_dir exists and is readable by the daemon user","Test-launch the binary manually with the same args/cwd before configuring","On macOS clear Gatekeeper quarantine; in containers check pid/memory limits"],"tags":["acp","process-spawn","exec","permissions"],"backgroundTag":"process-spawn-failed","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"}