JuliusBrussee/caveman · error
githubapp: decode repo installation: %w
Error message
githubapp: decode repo installation: %w
What it means
GetRepoInstallation got a 200 from the /installation endpoint but the body did not decode into the Installation struct. The success response is not the documented installation JSON, so the installation id cannot be extracted.
Source
Thrown at shared/platform/githubapp/githubapp.go:288
// 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
}
if status != http.StatusOK {
return out, fmt.Errorf("githubapp: get repo installation %s/%s: HTTP %d: %s", owner, name, status, snippet(raw))
}
if err := json.Unmarshal(raw, &out); err != nil {
return out, fmt.Errorf("githubapp: decode repo installation: %w", err)
}
if out.ID <= 0 {
return Installation{}, fmt.Errorf("githubapp: repo installation response carried no id")
}
return out, nil
}
// GetFileContent reads one repository file with an installation token. The
// content endpoint returns base64; callers receive decoded bytes with a strict
// 64 KiB post-decode ceiling because connection proofs are tiny text files.
func (a *App) GetFileContent(ctx context.Context, token, owner, name, path, ref string) ([]byte, error) {
segments := strings.Split(strings.Trim(path, "/"), "/")
if len(segments) == 0 || segments[0] == "" {
return nil, fmt.Errorf("githubapp: content path is required")
}
for i := range segments {
segments[i] = url.PathEscape(segments[i])
}View on GitHub (pinned to 766dce6b13)
Solutions
- Retry the request; if persistent, inspect the raw body for API schema drift
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at shared/platform/githubapp/githubapp.go:288 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/63be767fb29b14bf.
Report an issue: GitHub.