{"record":{"id":"156074bc37aaac09","repo":"chenhg5/cc-connect","slug":"no-releases-found","errorCode":null,"errorMessage":"no releases found","messagePattern":"no releases found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/update.go","lineNumber":238,"sourceCode":"\treq.Header.Set(\"Accept\", \"application/vnd.github.v3+json\")\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"request failed: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != 200 {\n\t\treturn nil, fmt.Errorf(\"GitHub API returned HTTP %d\", resp.StatusCode)\n\t}\n\n\tvar releases []githubRelease\n\tif err := json.NewDecoder(resp.Body).Decode(&releases); err != nil {\n\t\treturn nil, fmt.Errorf(\"parse releases: %w\", err)\n\t}\n\n\tif len(releases) == 0 {\n\t\treturn nil, fmt.Errorf(\"no releases found\")\n\t}\n\n\t// Return the first (newest) release, which may be a pre-release\n\treturn &releases[0], nil\n}\n\n// fetchLatestStableRelease fetches the latest stable release (no pre-releases).\nfunc fetchLatestStableRelease() (*githubRelease, error) {\n\tclient := &http.Client{Timeout: 15 * time.Second}\n\treq, _ := http.NewRequest(\"GET\", githubAPI, nil)\n\treq.Header.Set(\"Accept\", \"application/vnd.github.v3+json\")\n\n\tresp, err := client.Do(req)\n\tif err == nil {\n\t\tdefer resp.Body.Close()\n\t\tif resp.StatusCode == 200 {\n\t\t\tvar release githubRelease\n\t\t\tif err := json.NewDecoder(resp.Body).Decode(&release); err == nil {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/update.go#L220-L256","documentation":"A sentinel from fetchLatestPreRelease: the GitHub releases API responded successfully with valid JSON but an empty array — the repository genuinely exposes no releases, so there is nothing to update or install.","triggerScenarios":"The GET .../releases?per_page=10 succeeded with HTTP 200 and valid JSON, but len(releases) == 0: the target repository has zero published releases.","commonSituations":"Building from a fork or a repo that has never published a GitHub release; all releases deleted or drafts-only (drafts are not returned by the public API); updater pointed at a staging/dev mirror instead of the release repo; migration where releases weren't imported.","solutions":["Verify the repository actually has published releases on its GitHub Releases page","If using a fork/mirror, point githubAllAPI at the upstream repo that publishes releases","Check that releases aren't only drafts — publish them so the API returns them","Skip auto-update and install the binary manually"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// check the repo has releases before enabling auto-update:\nresp, _ := http.Get(\"https://api.github.com/repos/<owner>/<repo>/releases?per_page=1\")\nvar first []json.RawMessage\njson.NewDecoder(resp.Body).Decode(&first)\nif len(first) == 0 { fmt.Println(\"upstream repo has no published releases; auto-update unavailable\") }","typeGuard":null,"tryCatchPattern":"// Go: treat empty release list as non-fatal\nrel, err := fetchRelease()\nif err != nil {\n    if strings.Contains(err.Error(), \"no releases found\") {\n        log.Println(\"no upstream releases; skipping update check\")\n        return nil // graceful skip instead of failing the command\n    }\n    return err\n}","preventionTips":["Verify the release repo URL matches the repo that actually publishes binaries","Remember drafts and private releases are invisible to the public API","Publish releases before shipping versions that enable self-update","Keep a manual install path documented for when auto-update finds nothing"],"tags":["github-api","empty-response","update-checker","releases"],"backgroundTag":"empty-result-set","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}