matryer/xbar · error
download asset
Error message
download asset
What it means
The HTTP GET of the release asset failed at the transport level; the underlying error is wrapped as 'download asset'. This happens before any bytes are read, when u.Client.Get cannot complete the request (DNS failure, connection refused, TLS error, invalid URL, etc.).
Source
Thrown at pkg/update/update.go:190
// semver failed - just check tags
if latest == current {
return false
}
}
return true
}
func (u *Updater) downloadAndReplaceApp(asset Asset) error {
filename := path.Base(asset.BrowserDownloadURL)
switch {
case strings.HasSuffix(filename, ".zip"):
// fine
default:
return errors.Errorf("file not supported: %s", filename)
}
resp, err := u.Client.Get(asset.BrowserDownloadURL)
if err != nil {
return errors.Wrap(err, "download asset")
}
defer resp.Body.Close()
const defaultTempDir = ""
f, err := os.CreateTemp(defaultTempDir, "*-"+filename)
if err != nil {
return errors.Wrap(err, "create temp file")
}
_, err = io.Copy(f, io.LimitReader(resp.Body, u.DownloadBytesLimit))
if err != nil {
f.Close()
return errors.Wrap(err, "download asset")
}
f.Close()
executable, err := u.GetExecutable()
if err != nil {
return errors.Wrap(err, "get executable")
}
appPath, err := appPathFromExecutable(executable)View on GitHub (pinned to d624239058)
Solutions
- Check network connectivity and that the asset URL is reachable (curl -I the BrowserDownloadURL).
- Inspect the wrapped underlying error for DNS/proxy/TLS specifics and fix the client or proxy config.
- Ensure the release/asset still exists and the URL is not stale after deleting and re-publishing a release.
- Add retry logic with backoff for transient network failures.
Defensive patterns
Strategy: retry
Validate before calling
resp, err := http.Head(asset.BrowserDownloadURL)
if err != nil || resp.StatusCode != http.StatusOK {
return fmt.Errorf("asset URL not reachable: %v", err)
} Try / catch
err := u.Update()
if err != nil && strings.Contains(err.Error(), "download asset") {
time.Sleep(2 * time.Second)
err = u.Update() // retry once on transient network failure
} Prevention
- Configure u.Client with sane timeouts and a working proxy
- Verify asset URLs are reachable with curl before releases
- Add automatic retry with backoff around Update()
When it happens
Trigger: Calling Update() when the asset's BrowserDownloadURL is unreachable or malformed, or the custom u.Client fails the request.
Common situations: Offline machine or restrictive firewall; GitHub redirects to objects.githubusercontent.com blocked by a proxy; asset URL points to a deleted release; custom http.Client with a bad proxy configuration.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
AI-assisted analysis of matryer/xbar@d624239058 (2026-09-02).
Data as JSON: /api/errors/2bb70a91cacc5d8e.
Report an issue: GitHub.