JuliusBrussee/caveman · error

githubapp: get repo installation %s/%s: HTTP %d: %s

Error message

githubapp: get repo installation %s/%s: HTTP %d: %s

What it means

Fires in GetRepoInstallation() when GET /repos/{owner}/{name}/installation (App-JWT authenticated) returns non-200 — typically 404 because this App is not installed on that repository. This check prevents treating public visibility as proof of authorization.

Source

Thrown at shared/platform/githubapp/githubapp.go:285

	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
	}
	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")
	}

View on GitHub (pinned to 766dce6b13)

Solutions

  1. If 404, the App is not installed on the repo: direct the user through the install flow
  2. Retry on transient 5xx; verify the owner/name are correct
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at shared/platform/githubapp/githubapp.go:285 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/f77727d0bc8e6c06. Report an issue: GitHub.