JanDeDobbeleer/oh-my-posh · error
failed to download asset: %s
Error message
failed to download asset: %s
What it means
During upgrade, the updater downloads a release asset over HTTP. If the response status is not 200 OK, the download is abandoned and this error is returned with the requested URL. The underlying request error path is separate (that one logs and returns the transport error directly).
Source
Thrown at src/cli/upgrade/config.go:108
func (cfg *Config) Download(url string) ([]byte, error) {
req, err := httplib.NewRequestWithContext(context.Background(), "GET", url, nil)
if err != nil {
log.Debugf("failed to create request for url: %s", url)
return nil, err
}
req.Header.Add("User-Agent", "oh-my-posh")
req.Header.Add("Cache-Control", "max-age=0")
resp, err := http.HTTPClient.Do(req)
if err != nil {
log.Debugf("failed to execute HTTP request: %s", url)
return nil, err
}
if resp.StatusCode != httplib.StatusOK {
return nil, fmt.Errorf("failed to download asset: %s", url)
}
defer resp.Body.Close()
reader := &downloadProgressReader{reader: resp.Body, total: resp.ContentLength}
data, err := io.ReadAll(reader)
if err != nil {
log.Debugf("failed to read response body: %s", url)
return nil, err
}
return data, nil
}
View on GitHub (pinned to 0976794618)
Solutions
- Retry later — transient GitHub 5xx or rate-limit (403) usually clears
- Set a GITHUB_TOKEN so authenticated requests avoid the 60 req/h anonymous rate limit
- Verify the target release/version and asset name still exist on GitHub
- Check proxy/firewall settings if behind a corporate network
- Update oh-my-posh manually (installer script or package manager) if the self-updater is broken
Example fix
// before oh-my-posh upgrade // after (avoid rate limiting / flaky self-update) GITHUB_TOKEN=ghp_xxx oh-my-posh upgrade # or winget upgrade JanDeDobbeleer.OhMyPosh
Defensive patterns
Strategy: retry
Validate before calling
// pre-check release availability
resp, _ := http.Head(assetURL)
if resp == nil || resp.StatusCode != 200 { /* abort or warn before invoking updater */ } Try / catch
if err := cli.Upgrade(); err != nil {
if strings.Contains(err.Error(), "failed to download asset") {
// wait and retry with backoff; check GITHUB_TOKEN is set
}
} Prevention
- Set GITHUB_TOKEN to avoid anonymous rate limits
- Use a stable network path (no TLS-intercepting proxy) for upgrades
- Confirm the target version/asset exists before upgrading
When it happens
Trigger: Calling Download/DownloadAsset against a GitHub release asset URL that returns a non-200 status: 404 (asset/release missing), 403 (rate limit), 5xx (server error), or a proxy error page.
Common situations: GitHub API rate limiting without auth token; the release or asset name changed/removed; corporate proxy returning an error page; network appliance intercepting TLS.
Related errors
- the wasm build renders from data only and cannot make reques
- Withings API error: <status>
- failed to download zip file: %s → %s
- unable to get data for team %s
- no assets found
AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31).
Data as JSON: /api/errors/0060b6cf645f66fa.
Report an issue: GitHub.