{"record":{"id":"9a640aed7fbc994e","repo":"jdx/mise","slug":"http-download-timed-out-after-for-attempt","errorCode":null,"errorMessage":"HTTP download timed out after {} for {} (attempt {}, {} bytes received; change with `http_download_timeout` or env `MISE_HTTP_DOWNLOAD_TIMEOUT`)","messagePattern":"HTTP download timed out after (.+?) for (.+?) \\(attempt (.+?), (.+?) bytes received; change with `http_download_timeout` or env `MISE_HTTP_DOWNLOAD_TIMEOUT`\\)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/http.rs","lineNumber":1048,"sourceCode":"            let partial = partial.clone();\n            async move {\n                attempt.fetch_add(1, Ordering::Relaxed);\n                bytes_received.store(0, Ordering::Relaxed);\n                self.download_file_attempt(request_url, headers, &partial, pr, &bytes_received)\n                    .await\n            }\n        });\n\n        let metadata = match tokio::time::timeout(total_timeout, download).await {\n            Ok(result) => result?,\n            Err(_) => {\n                // A timeout cancels the transfer future before its normal cleanup\n                // runs. Loading the sidecar removes an unvalidated partial while\n                // preserving a resumable one.\n                if let Err(err) = partial.load() {\n                    debug!(\"failed to validate partial download after timeout: {err:#}\");\n                }\n                bail!(\n                    \"HTTP download timed out after {} for {} (attempt {}, {} bytes received; change with `http_download_timeout` or env `MISE_HTTP_DOWNLOAD_TIMEOUT`)\",\n                    format_duration(total_timeout),\n                    url,\n                    attempt.load(Ordering::Relaxed),\n                    bytes_received.load(Ordering::Relaxed),\n                )\n            }\n        };\n\n        // Complete the atomic rename after the cancellable transfer budget. A\n        // blocking task cannot be cancelled once it starts, so keeping it out\n        // of `timeout` prevents us from returning an error while it can still\n        // install the destination in the background.\n        let path = path.to_path_buf();\n        tokio::task::spawn_blocking(move || partial.persist(&path)).await??;\n        Ok(metadata)\n    }\n","sourceCodeStart":1030,"sourceCodeEnd":1066,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/http.rs#L1030-L1066","documentation":"mise's HTTP downloader enforces a total timeout per download attempt (configurable via the `http_download_timeout` setting / `MISE_HTTP_DOWNLOAD_TIMEOUT` env). When a transfer exceeds it, the partial download is validated/handled and this error reports the elapsed timeout, URL, attempt number, and bytes received so far.","triggerScenarios":"Downloading a large artifact over a slow or stalled connection where total elapsed time exceeds the configured http_download_timeout; a hung server that stops sending data mid-transfer.","commonSituations":"Large tool archives on slow corporate networks or flaky Wi-Fi; proxies throttling long transfers; CI runners with constrained bandwidth hitting the default timeout.","solutions":["Increase the timeout: set `http_download_timeout` in settings or export MISE_HTTP_DOWNLOAD_TIMEOUT (e.g. to a larger duration) and retry.","Retry the download — it resumes from the validated partial instead of starting over.","Check network/proxy throughput; try a different mirror or network if transfers stall repeatedly."],"exampleFix":"// before\n$ mise install node@22\n// after (allow longer downloads)\n$ MISE_HTTP_DOWNLOAD_TIMEOUT=30m mise install node@22\n// or in settings.toml\n[settings]\nhttp_download_timeout = \"30m\"","handlingStrategy":"retry","validationCode":"[ -n \"$MISE_HTTP_DOWNLOAD_TIMEOUT\" ] && echo \"timeout: $MISE_HTTP_DOWNLOAD_TIMEOUT\" || echo \"using default; large downloads may need more\"","typeGuard":null,"tryCatchPattern":"for i in 1 2 3; do\n  MISE_HTTP_DOWNLOAD_TIMEOUT=30m mise install node@22 && break\n  echo \"download timed out (attempt $i); retrying\"\ndone","preventionTips":["Raise http_download_timeout/MISE_HTTP_DOWNLOAD_TIMEOUT on slow links or big artifacts","Ensure downloads resume (validated partials) so retries are cheap","Avoid throttling proxies for large tool downloads"],"tags":["http","timeout","download","network"],"backgroundTag":"request-timeout","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}