JuliusBrussee/caveman · error
githubapp: decode repo: %w
Error message
githubapp: decode repo: %w
What it means
GetRepo received a 200 from the GitHub repos endpoint but the body failed to decode into the Repo struct (node id, default branch, etc.). The success-status payload is not the documented repository JSON — a GitHub API change or an interfering proxy.
Source
Thrown at shared/platform/githubapp/githubapp.go:265
FullName string `json:"full_name"`
DefaultBranch string `json:"default_branch"`
}
// GetRepo verifies that the installation token can see owner/name and returns the
// repo's stable node id + default branch. Used by select-repo to confirm the repo
// truly belongs to the installation before the binding goes 'active'.
func (a *App) GetRepo(ctx context.Context, token, owner, name string) (Repo, error) {
status, raw, err := a.do(ctx, "Bearer "+token, http.MethodGet,
"/repos/"+url.PathEscape(owner)+"/"+url.PathEscape(name), nil)
if err != nil {
return Repo{}, err
}
if status != http.StatusOK {
return Repo{}, fmt.Errorf("githubapp: get repo %s/%s: HTTP %d: %s", owner, name, status, snippet(raw))
}
var r Repo
if err := json.Unmarshal(raw, &r); err != nil {
return Repo{}, fmt.Errorf("githubapp: decode repo: %w", err)
}
return r, nil
}
// GetRepoInstallation asks GitHub which installation of this App owns access to
// a repository. This avoids treating public repository visibility as proof that
// a caller-supplied installation id is authorized for that repository.
func (a *App) GetRepoInstallation(ctx context.Context, owner, name string) (Installation, error) {
var out Installation
jwt, err := a.AppJWT()
if err != nil {
return out, err
}
status, raw, err := a.do(ctx, "Bearer "+jwt, http.MethodGet,
"/repos/"+url.PathEscape(owner)+"/"+url.PathEscape(name)+"/installation", nil)
if err != nil {
return out, err
}View on GitHub (pinned to 766dce6b13)
Solutions
- Retry the request; inspect the raw body if it persists to check for API schema changes
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at shared/platform/githubapp/githubapp.go:265 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18).
Data as JSON: /api/errors/48295ffee77cc045.
Report an issue: GitHub.