janhq/jan · error
Failed to fetch releases
Error message
Failed to fetch releases
What it means
Thrown in useReleaseNotes.fetchLatestRelease when the GitHub API request to https://api.github.com/repos/janhq/jan/releases responds with a non-OK status. The hook needs the release list to compute the latest stable (non-prerelease, non-draft) release.
Solutions
- Check the response status; if 403, wait for the GitHub API rate-limit window to reset (see X-RateLimit-Reset header)
- Verify api.github.com is reachable (proxy/VPN/firewall) and retry
- Add an Authorization token to the request to raise the rate limit
- Check https://www.githubstatus.com for GitHub API incidents
Example fix
// before
const res = await fetch('https://api.github.com/repos/janhq/jan/releases')
if (!res.ok) throw new Error('Failed to fetch releases')
// after
const res = await fetch('https://api.github.com/repos/janhq/jan/releases')
if (!res.ok) {
if (res.status === 403) throw new Error('GitHub API rate limit exceeded; try again later')
throw new Error(`Failed to fetch releases (HTTP ${res.status})`)
} Defensive patterns
Strategy: retry
Try / catch
try {
const release = await fetchLatestRelease(includeBeta)
} catch (e) {
if (e.message === 'Failed to fetch releases') {
showCachedReleaseNotes()
} else {
throw e
}
} Prevention
- Cache the last successful releases response for offline fallback
- Retry with exponential backoff on failure
- Send a GitHub token to avoid anonymous rate limits
- Surface res.status in error messages for faster diagnosis
- Monitor X-RateLimit-Remaining before polling
When it happens
Trigger: fetch to the GitHub releases endpoint resolves but res.ok is false — 403 rate limiting, 404 if the repo moved, 5xx server errors, or blocked network/proxy responses.
Common situations: Unauthenticated GitHub API rate limit exceeded (60 req/hr per IP) on shared networks or CI; corporate proxy/VPN blocking api.github.com; GitHub incidents; repo renamed causing 404 with old hardcoded URL.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- API request failed with status
- Failed to fetch models from
- Failed to fetch HuggingFace repository
- Failed to fetch model catalog
- Failed to fetch repository files
AI-assisted analysis of janhq/jan@7205d770c1 (2026-09-17).
Data as JSON: /api/errors/33e0da01681c5501.
Report an issue: GitHub.
Appendix: source
Thrown at web-app/src/hooks/useReleaseNotes.ts:30
type ReleaseState = {
release: Release | null
loading: boolean
error: string | null
fetchLatestRelease: (includeBeta: boolean) => Promise<void>
}
export const useReleaseNotes = create<ReleaseState>((set) => ({
release: null,
loading: false,
error: null,
fetchLatestRelease: async (includeBeta: boolean) => {
set({ loading: true, error: null })
try {
const res = await fetch(
'https://api.github.com/repos/janhq/jan/releases'
)
if (!res.ok) throw new Error('Failed to fetch releases')
const releases = await res.json()
const stableRelease = releases.find(
(release: { prerelease: boolean; draft: boolean }) =>
!release.prerelease && !release.draft
)
const betaRelease = releases.find(
(release: { prerelease: boolean }) => release.prerelease
)
const selected = includeBeta
? (betaRelease ?? stableRelease)
: stableRelease
set({ release: selected, loading: false })
} catch (err: any) {
set({ error: err.message, loading: false })
}
},View on GitHub (pinned to 7205d770c1)