glanceapp/glance · error · errNoContent
%w: could not get repository details: %s
Error message
%w: could not get repository details: %s
What it means
Returned by fetchRepositoryDetailsFromGithub (internal/glance/widget-repository.go:175) when the primary request — GET api.github.com/repos/{repo} for the repo's stars/forks/name — failed to complete or decode. It is wrapped in errNoContent, so the repository widget shows no content rather than partial data, even though PR/issue/commit sub-requests may have succeeded. The underlying detailsErr is typically a non-200 (404 unknown repo, 401 bad token, 403 rate limit) or a JSON decode failure.
Source
Thrown at internal/glance/widget-repository.go:175
wg.Add(1)
go (func() {
defer wg.Done()
issuesResponse, issuesErr = decodeJsonFromRequest[githubTicketResponseJson](defaultHTTPClient, issuesRequest)
})()
}
if maxCommits > 0 {
wg.Add(1)
go (func() {
defer wg.Done()
commitsResponse, CommitsErr = decodeJsonFromRequest[[]gitHubCommitResponseJson](defaultHTTPClient, CommitsRequest)
})()
}
wg.Wait()
if detailsErr != nil {
return repository{}, fmt.Errorf("%w: could not get repository details: %s", errNoContent, detailsErr)
}
details := repository{
Name: repositoryResponse.Name,
Stars: repositoryResponse.Stars,
Forks: repositoryResponse.Forks,
PullRequests: make([]githubTicket, 0, len(PRsResponse.Tickets)),
Issues: make([]githubTicket, 0, len(issuesResponse.Tickets)),
Commits: make([]githubCommitDetails, 0, len(commitsResponse)),
}
err = nil
if maxPRs > 0 {
if PRsErr != nil {
err = fmt.Errorf("%w: could not get PRs: %s", errPartialContent, PRsErr)
} else {
details.OpenPullRequests = PRsResponse.CountView on GitHub (pinned to 91324e8de7)
Solutions
- Verify the repository exists: curl https://api.github.com/repos/{owner}/{repo}
- Set a GitHub token (GITHUB_TOKEN env or token key in config) to raise the rate limit to 5000/hr
- If rate-limited, wait for the limit window to reset and increase the widget's cache/update interval
- Fix owner/name spelling in glance.yml
Defensive patterns
Strategy: retry
Try / catch
if err != nil && errors.Is(err, errNoContent) && strings.Contains(err.Error(), "could not get repository details") {
// 404/401/403: fix name or token; rate limit: back off and retry next cycle
} Prevention
- Always configure a GitHub token for busy dashboards
- Verify repos exist before adding
- Raise refresh intervals to stay under API quotas
When it happens
Trigger: 404 for a typo'd/renamed/deleted repository; 401 with an invalid token; 403 with GitHub API rate limit exhausted (60/hr unauthenticated); network error or HTML error page that fails JSON decoding on the main repo endpoint.
Common situations: Anonymous Glance instances polling many GitHub repos hitting the 60 req/hr limit; expired PAT; repository renamed by upstream owner; GitHub incident serving 5xx HTML pages.
Related errors
- %w: could not get PRs: %s
- %w: could not get issues: %s
- %w: could not get commits: %s
- unexpected status code %d when requesting challenge page
- unexpected status code %d when submitting challenge solution
AI-assisted analysis of glanceapp/glance@91324e8de7 (2026-08-15).
Data as JSON: /api/errors/22a00e7185207cbb.
Report an issue: GitHub.