jesseduffield/lazygit · error
error while trying to download latest lazygit: %s
Error message
error while trying to download latest lazygit: %s
What it means
Returned by updates.go's download logic when the HTTP GET for the lazygit release tarball completes but the server responds with a non-200 status. The message embeds the HTTP status line (e.g. '404 Not Found'), so the cause is always server-side routing, rate limiting, or a bad URL — not a network failure (which would surface as the http.Get error instead).
Source
Thrown at pkg/updates/updates.go:276
}
// Create the zip file
out, err := os.Create(zipPath)
if err != nil {
return err
}
defer out.Close()
// Get the data
resp, err := http.Get(rawUrl)
if err != nil {
return err
}
defer resp.Body.Close()
// Check server response
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("error while trying to download latest lazygit: %s", resp.Status)
}
// Write the body to file
_, err = io.Copy(out, resp.Body)
if err != nil {
return err
}
u.Log.Info("untarring tarball/unzipping zip file")
err = u.OSCommand.Cmd.New([]string{"tar", "-zxf", zipPath, "lazygit"}).Run()
if err != nil {
return err
}
// the `tar` terminal cannot store things in a new location without permission
// so it creates it in the current directory. As such our path is fairly simple.
// You won't see it because it's gitignored.
tempLazygitFilePath := "lazygit"View on GitHub (pinned to c477a2959b)
Solutions
- Retry after a short wait — transient 403 rate limits and freshly-published-release 404s resolve themselves
- Check the status text in the message: 404 means the asset URL is wrong for your version/arch (report or wait for assets); 403 usually means GitHub rate limiting
- Download the release manually from GitHub releases and replace the binary, then verify with lazygit --version
- If behind a proxy, ensure HTTP(S)_PROXY env vars let the updater reach github.com
Defensive patterns
Strategy: retry
Validate before calling
curl -fsSI -o /dev/null -w '%{http_code}\n' "https://github.com/jesseduffield/lazygit/releases/latest" | grep -q 200 || echo 'release endpoint unreachable' Try / catch
Retry the update after a delay for 403/429 (rate limit); on 404 treat as a missing asset and fall back to manual download from the releases page instead of retrying.
Prevention
- Retry transient rate-limit failures once after ~60s before giving up
- Keep a manual install path ready (download tarball, replace binary) for CI or locked-down networks
When it happens
Trigger: Clicking 'upgrade' in lazygit (or self-update) when the computed release URL is wrong for the platform/version (404), GitHub rate-limits the request (403), or a proxy/redirect returns 3xx/5xx. resp.StatusCode != http.StatusOK triggers it, including 2xx variants like 206.
Common situations: Version metadata mismatch after a just-published release (asset not yet uploaded); corporate proxy intercepting the download; GitHub API rate limits from shared CI IPs; misconfigured OS/Arch in the update check.
Related errors
- Update failed: {{.errMessage}}
- Cannot change context while in patch building mode because w
- No patch created yet. To start building a patch, use 'space'
- Patch is still empty. Add some files or lines to your patch
- No config file found
AI-assisted analysis of jesseduffield/lazygit@c477a2959b (2026-08-15).
Data as JSON: /api/errors/d416da628bd84c4f.
Report an issue: GitHub.