{"record":{"id":"de128032a90f36c3","repo":"gastownhall/beads","slug":"gh-run-view-failed-s","errorCode":null,"errorMessage":"gh run view failed: %s","messagePattern":"gh run view failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/gate.go","lineNumber":1080,"sourceCode":"\nfunc checkGHRunStatusInRepoWithRunner(runID, repo string, runGH ghCommandRunner) (resolved, escalated bool, reason string, err error) {\n\t// Run: gh run view <id> --json status,conclusion,name\n\targs := []string{\"run\", \"view\", runID, \"--json\", \"status,conclusion,name\"}\n\tif repo != \"\" {\n\t\targs = append(args, \"--repo\", repo)\n\t}\n\tstdout, stderr, runErr := runGH(args...)\n\tif runErr != nil {\n\t\t// Check if gh CLI is not found\n\t\tif strings.Contains(string(stderr), \"command not found\") ||\n\t\t\tstrings.Contains(runErr.Error(), \"executable file not found\") {\n\t\t\treturn false, false, \"\", fmt.Errorf(\"gh CLI not installed\")\n\t\t}\n\t\t// Check if run not found\n\t\tif strings.Contains(string(stderr), \"not found\") {\n\t\t\treturn false, true, \"workflow run not found\", nil\n\t\t}\n\t\treturn false, false, \"\", fmt.Errorf(\"gh run view failed: %s\", string(stderr))\n\t}\n\n\tvar status ghRunStatus\n\tif parseErr := json.Unmarshal(stdout, &status); parseErr != nil {\n\t\treturn false, false, \"\", fmt.Errorf(\"failed to parse gh output: %w\", parseErr)\n\t}\n\n\t// Evaluate status\n\tswitch status.Status {\n\tcase \"completed\":\n\t\tswitch status.Conclusion {\n\t\tcase \"success\":\n\t\t\treturn true, false, fmt.Sprintf(\"workflow '%s' succeeded\", status.Name), nil\n\t\tcase \"failure\":\n\t\t\treturn false, true, fmt.Sprintf(\"workflow '%s' failed\", status.Name), nil\n\t\tcase \"cancelled\", \"canceled\":\n\t\t\treturn false, true, fmt.Sprintf(\"workflow '%s' was canceled\", status.Name), nil\n\t\tcase \"skipped\":","sourceCodeStart":1062,"sourceCodeEnd":1098,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/gate.go#L1062-L1098","documentation":"Returned when `gh run view <id> --json ...` exits non-zero for a reason other than missing CLI or missing run (cmd/bd/gate.go:1080). The message carries gh's raw stderr so the developer can see the actual gh failure.","triggerScenarios":"checkGHRunStatusInRepoWithRunner runs `gh run view` and it fails with stderr that contains neither 'command not found' nor 'not found' — e.g. auth errors, rate limits, invalid repo, permission denial.","commonSituations":"Token lacks access to the target repo (cross-repo gate), GitHub API 403/rate limit, gh not authenticated, invalid --repo slug, network/proxy failure.","solutions":["Inspect the stderr text embedded in this error for the exact gh message","Run the same command manually: `gh run view <id> --repo <owner/repo>`","Re-authenticate: `gh auth status` then `gh auth login`","Check repo permissions for the token and confirm the repo slug is correct"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"gh auth status && gh repo view <owner/repo> --json name","typeGuard":null,"tryCatchPattern":"if _, _, _, err := checkGHRunStatus(runID); err != nil && strings.HasPrefix(err.Error(), \"gh run view failed:\") {\n    // inspect embedded stderr; retry with backoff for transient 5xx/rate-limit\n}","preventionTips":["Keep gh authenticated with adequate token scopes","Respect rate limits; add backoff on repeated gate checks","Verify repo slugs in gate metadata"],"tags":["gh-cli","github-actions","stderr"],"backgroundTag":"gh-cli-command-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}