{"record":{"id":"abd7e516e9a8b3a6","repo":"larksuite/cli","slug":"exec-provider-exited-with-error-w","errorCode":null,"errorMessage":"exec provider exited with error: %w","messagePattern":"exec provider exited with error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/binding/secret_resolve_exec.go","lineNumber":183,"sourceCode":"//   - empty trimmed stdout → typed error\nfunc runExecCommand(prep *execRun) ([]byte, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), prep.Timeout)\n\tdefer cancel()\n\n\tcmd := exec.CommandContext(ctx, prep.Path, prep.Args...)\n\tcmd.Dir = filepath.Dir(prep.Path)\n\tcmd.Env = prep.Env // always set — leaving nil would inherit the parent env\n\tcmd.Stdin = bytes.NewReader(prep.Request)\n\n\tvar stdout, stderr bytes.Buffer\n\tcmd.Stdout = &stdout\n\tcmd.Stderr = &stderr\n\n\tif err := cmd.Run(); err != nil {\n\t\tif ctx.Err() == context.DeadlineExceeded {\n\t\t\treturn nil, fmt.Errorf(\"exec provider timed out after %dms\", int(prep.Timeout/time.Millisecond))\n\t\t}\n\t\treturn nil, fmt.Errorf(\"exec provider exited with error: %w\", err)\n\t}\n\n\tif stdout.Len() > prep.MaxOut {\n\t\treturn nil, fmt.Errorf(\"exec provider output exceeded maxOutputBytes (%d)\", prep.MaxOut)\n\t}\n\n\ttrimmed := bytes.TrimSpace(stdout.Bytes())\n\tif len(trimmed) == 0 {\n\t\treturn nil, fmt.Errorf(\"exec provider returned empty stdout\")\n\t}\n\treturn trimmed, nil\n}\n\n// extractExecSecret parses stdout as a JSON execResponse and returns the\n// string value at refID. When jsonOnly is false and the response is not valid\n// JSON (or the value is not a string), it falls back to the raw stdout or the\n// JSON encoding of the value respectively — mirroring OpenClaw's resolve.ts.\nfunc extractExecSecret(stdout []byte, refID string, jsonOnly bool) (string, error) {","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/binding/secret_resolve_exec.go#L165-L201","documentation":"cmd.Run returned a non-nil error and the context deadline had NOT expired, so the provider process itself failed - virtually always a non-zero exit wrapped as *exec.ExitError. The provider command, not the harness or a timeout, is at fault.","triggerScenarios":"Thrown at internal/binding/secret_resolve_exec.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the provider command manually with the same stdin payload to see its exit status and stderr","Fix the provider script so it exits 0 and emits the protocol response on stdout"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}