{"record":{"id":"9a4a66f0c9bb2400","repo":"portainer/portainer","slug":"github-api-returned-status-d-s","errorCode":null,"errorMessage":"GitHub API returned status %d: %s","messagePattern":"GitHub API returned status (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":500,"severity":"error","filePath":"api/http/proxy/factory/github/client.go","lineNumber":70,"sourceCode":"\turl := fmt.Sprintf(\"%s/%s/packages?package_type=container\", c.baseURL, namespace)\n\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create request: %w\", err)\n\t}\n\n\tresp, err := c.httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to execute request: %w\", err)\n\t}\n\tdefer func() {\n\t\tif err := resp.Body.Close(); err != nil {\n\t\t\tlog.Warn().Err(err).Msg(\"failed to close response body\")\n\t\t}\n\t}()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"GitHub API returned status %d: %s\", resp.StatusCode, resp.Status)\n\t}\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read response body: %w\", err)\n\t}\n\n\tvar packages []Package\n\tif err := json.Unmarshal(body, &packages); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse response: %w\", err)\n\t}\n\n\t// Extract repository names in the form \"owner/name\"\n\trepositories := make([]string, len(packages))\n\tfor i, pkg := range packages {\n\t\trepositories[i] = fmt.Sprintf(\"%s/%s\", strings.ToLower(pkg.Owner.Login), strings.ToLower(pkg.Name))\n\t}\n","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/http/proxy/factory/github/client.go#L52-L88","documentation":"Error \"GitHub API returned status %d: %s\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/http/proxy/factory/github/client.go:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}