{"record":{"id":"3c29636a105248f0","repo":"JuliusBrussee/caveman","slug":"githubapp-repo-installation-response-carried-no-i","errorCode":null,"errorMessage":"githubapp: repo installation response carried no id","messagePattern":"githubapp: repo installation response carried no id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/githubapp/githubapp.go","lineNumber":291,"sourceCode":"func (a *App) GetRepoInstallation(ctx context.Context, owner, name string) (Installation, error) {\n\tvar out Installation\n\tjwt, err := a.AppJWT()\n\tif err != nil {\n\t\treturn out, err\n\t}\n\tstatus, raw, err := a.do(ctx, \"Bearer \"+jwt, http.MethodGet,\n\t\t\"/repos/\"+url.PathEscape(owner)+\"/\"+url.PathEscape(name)+\"/installation\", nil)\n\tif err != nil {\n\t\treturn out, err\n\t}\n\tif status != http.StatusOK {\n\t\treturn out, fmt.Errorf(\"githubapp: get repo installation %s/%s: HTTP %d: %s\", owner, name, status, snippet(raw))\n\t}\n\tif err := json.Unmarshal(raw, &out); err != nil {\n\t\treturn out, fmt.Errorf(\"githubapp: decode repo installation: %w\", err)\n\t}\n\tif out.ID <= 0 {\n\t\treturn Installation{}, fmt.Errorf(\"githubapp: repo installation response carried no id\")\n\t}\n\treturn out, nil\n}\n\n// GetFileContent reads one repository file with an installation token. The\n// content endpoint returns base64; callers receive decoded bytes with a strict\n// 64 KiB post-decode ceiling because connection proofs are tiny text files.\nfunc (a *App) GetFileContent(ctx context.Context, token, owner, name, path, ref string) ([]byte, error) {\n\tsegments := strings.Split(strings.Trim(path, \"/\"), \"/\")\n\tif len(segments) == 0 || segments[0] == \"\" {\n\t\treturn nil, fmt.Errorf(\"githubapp: content path is required\")\n\t}\n\tfor i := range segments {\n\t\tsegments[i] = url.PathEscape(segments[i])\n\t}\n\tendpoint := \"/repos/\" + url.PathEscape(owner) + \"/\" + url.PathEscape(name) + \"/contents/\" + strings.Join(segments, \"/\")\n\tif strings.TrimSpace(ref) != \"\" {\n\t\tendpoint += \"?\" + url.Values{\"ref\": {ref}}.Encode()","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/shared/platform/githubapp/githubapp.go#L273-L309","documentation":"Post-decode check in GetRepoInstallation(): the decoded response has no positive ID, so GitHub returned an unusable installation object. The result is rejected to keep authorization decisions grounded in a verified installation id.","triggerScenarios":"Thrown at shared/platform/githubapp/githubapp.go:291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the lookup; inspect the raw response if it recurs","Treat as failure of the authorization proof and do not activate the binding"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}