{"record":{"id":"0060b6cf645f66fa","repo":"JanDeDobbeleer/oh-my-posh","slug":"failed-to-download-asset-s","errorCode":null,"errorMessage":"failed to download asset: %s","messagePattern":"failed to download asset: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/upgrade/config.go","lineNumber":108,"sourceCode":"\nfunc (cfg *Config) Download(url string) ([]byte, error) {\n\treq, err := httplib.NewRequestWithContext(context.Background(), \"GET\", url, nil)\n\tif err != nil {\n\t\tlog.Debugf(\"failed to create request for url: %s\", url)\n\t\treturn nil, err\n\t}\n\n\treq.Header.Add(\"User-Agent\", \"oh-my-posh\")\n\treq.Header.Add(\"Cache-Control\", \"max-age=0\")\n\n\tresp, err := http.HTTPClient.Do(req)\n\tif err != nil {\n\t\tlog.Debugf(\"failed to execute HTTP request: %s\", url)\n\t\treturn nil, err\n\t}\n\n\tif resp.StatusCode != httplib.StatusOK {\n\t\treturn nil, fmt.Errorf(\"failed to download asset: %s\", url)\n\t}\n\n\tdefer resp.Body.Close()\n\n\treader := &downloadProgressReader{reader: resp.Body, total: resp.ContentLength}\n\n\tdata, err := io.ReadAll(reader)\n\tif err != nil {\n\t\tlog.Debugf(\"failed to read response body: %s\", url)\n\t\treturn nil, err\n\t}\n\n\treturn data, nil\n}\n","sourceCodeStart":90,"sourceCodeEnd":123,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/cli/upgrade/config.go#L90-L123","documentation":"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).","triggerScenarios":"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.","commonSituations":"GitHub API rate limiting without auth token; the release or asset name changed/removed; corporate proxy returning an error page; network appliance intercepting TLS.","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"],"exampleFix":"// before\noh-my-posh upgrade\n// after (avoid rate limiting / flaky self-update)\nGITHUB_TOKEN=ghp_xxx oh-my-posh upgrade\n# or\nwinget upgrade JanDeDobbeleer.OhMyPosh","handlingStrategy":"retry","validationCode":"// pre-check release availability\nresp, _ := http.Head(assetURL)\nif resp == nil || resp.StatusCode != 200 { /* abort or warn before invoking updater */ }","typeGuard":null,"tryCatchPattern":"if err := cli.Upgrade(); err != nil {\n    if strings.Contains(err.Error(), \"failed to download asset\") {\n        // wait and retry with backoff; check GITHUB_TOKEN is set\n    }\n}","preventionTips":["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"],"tags":["network","http","upgrade","github"],"backgroundTag":"http-non-200-response","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}