{"record":{"id":"d416da628bd84c4f","repo":"jesseduffield/lazygit","slug":"error-while-trying-to-download-latest-lazygit-s","errorCode":null,"errorMessage":"error while trying to download latest lazygit: %s","messagePattern":"error while trying to download latest lazygit: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/updates/updates.go","lineNumber":276,"sourceCode":"\t}\n\n\t// Create the zip file\n\tout, err := os.Create(zipPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer out.Close()\n\n\t// Get the data\n\tresp, err := http.Get(rawUrl)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer resp.Body.Close()\n\n\t// Check server response\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"error while trying to download latest lazygit: %s\", resp.Status)\n\t}\n\n\t// Write the body to file\n\t_, err = io.Copy(out, resp.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tu.Log.Info(\"untarring tarball/unzipping zip file\")\n\terr = u.OSCommand.Cmd.New([]string{\"tar\", \"-zxf\", zipPath, \"lazygit\"}).Run()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// the `tar` terminal cannot store things in a new location without permission\n\t// so it creates it in the current directory. As such our path is fairly simple.\n\t// You won't see it because it's gitignored.\n\ttempLazygitFilePath := \"lazygit\"","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/updates/updates.go#L258-L294","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"curl -fsSI -o /dev/null -w '%{http_code}\\n' \"https://github.com/jesseduffield/lazygit/releases/latest\" | grep -q 200 || echo 'release endpoint unreachable'","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["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"],"tags":["lazygit","self-update","http","github-releases","download"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}