I tried installing Rust through rustup
and after several attempts, I noticed installation always failed because rustup
was trying to download rustc
within 30 seconds so it would often fail my attempt at 90-98%. After doing a bunch of -h
among the commands, I didn't find anything to prolong this timeout. I was lucky with internet option at the time so I change my connection and finished downloading rustc
within 30s. Now I'm merely curious, is there a config or command to extend this 30s timeout? Thanks.
P.S.: Pardon if I break any forum rule; I've looked around including the similar topic recommendation when I typed this and found nothing similar. I'm not a forum person per se.
Edit: Added a screenshot from one of the earlier attempts
This seems relevant…
opened 01:59AM - 04 Mar 25 UTC
closed 11:46AM - 04 Mar 25 UTC
bug
### Verification
- [x] I searched for recent similar issues at https://github.c… om/rust-lang/rustup/issues?q=is%3Aissue+is%3Aopen%2Cclosed and found no duplicates.
- [x] I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.
### Problem
After updating to `1.28` I got an `operation timed out` when installing a toolchain
```
info: syncing channel updates for '1.85-x86_64-unknown-linux-gnu'
info: latest update on 2025-02-20, rust version 1.85.0 (4d91de4e4 2025-02-17)
info: downloading component 'cargo'
8.7 MiB / 8.7 MiB (100 %) 944.0 KiB/s in 11s
info: downloading component 'clippy'
2.8 MiB / 2.8 MiB (100 %) 974.7 KiB/s in 3s
info: downloading component 'rust-std' for 'aarch64-apple-darwin'
24.3 MiB / 24.3 MiB (100 %) 827.8 KiB/s in 27s
info: downloading component 'rust-std' for 'wasm32-wasip1'
20.4 MiB / 20.4 MiB (100 %) 945.4 KiB/s in 23s
info: downloading component 'rust-std' for 'x86_64-apple-darwin'
25.9 MiB / 25.9 MiB (100 %) 939.8 KiB/s in 28s
info: downloading component 'rust-std' for 'x86_64-pc-windows-msvc'
22.3 MiB / 22.3 MiB (100 %) 946.6 KiB/s in 24s
info: downloading component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 952.4 KiB/s in 29s
info: downloading component 'rustc'
27.2 MiB / 69.5 MiB ( 39 %) 951.4 KiB/s in 30s ETA: 45s
info: retrying download for 'https://static.rust-lang.org/dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.xz'
27.2 MiB / 69.5 MiB ( 39 %) 950.1 KiB/s in 30s ETA: 45s
info: retrying download for 'https://static.rust-lang.org/dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.xz'
27.2 MiB / 69.5 MiB ( 39 %) 942.8 KiB/s in 30s ETA: 45s
info: retrying download for 'https://static.rust-lang.org/dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.xz'
27.2 MiB / 69.5 MiB ( 39 %) 945.7 KiB/s in 30s ETA: 45s
info: retrying download for 'https://static.rust-lang.org/dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.xz'
error: component download failed for rustc-x86_64-unknown-linux-gnu: could not download file from 'https://static.rust-lang.org/dist/2025-02-20/rustc-1.85.0-x86_64-unknown-linux-gnu.tar.xz' to '/home/nlehmann/.rustup/downloads/7436f13797475082cd87aa65547449e01659d6a810b4cd5f8aedc48bb9f89dfb.partial': error decoding response body: request or response body error: operation timed out
````
I have a somewhat slow connection, but I've never had a problem before. I tried several times and got the timeout consistently. I finally managed to install the toolchain by setting `RUSTUP_USE_CURL`.
It may be related to https://github.com/rust-lang/rustup/issues/3486, but I'm posting it as a new issue because I never had a problem before updating.
### Steps
I'm not sure if you only need a slow connection or if there's something particular about my network, but I get the error when I do `rustup toolchain install`. My toolchain file has
```toml
[toolchain]
channel = "1.85"
profile = "minimal"
components = [ "rustfmt", "clippy" ]
targets = [ "x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "wasm32-wasip1", "x86_64-pc-windows-msvc" ]
```
### Possible Solution(s)
_No response_
### Notes
_No response_
### Rustup version
```console
rustup 1.28.0 (6e19fbec7 2025-03-02)
```
### Installed toolchains
```console
Default host: x86_64-unknown-linux-gnu
rustup home: /home/nlehmann/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu (default)
nightly-2024-07-08-x86_64-unknown-linux-gnu
nightly-2024-08-20-x86_64-unknown-linux-gnu
nightly-2024-11-03-x86_64-unknown-linux-gnu
nightly-2024-12-15-x86_64-unknown-linux-gnu
nightly-2025-01-20-x86_64-unknown-linux-gnu
nightly-2025-01-26-x86_64-unknown-linux-gnu
nightly-2025-01-27-x86_64-unknown-linux-gnu
nightly-2025-02-22-x86_64-unknown-linux-gnu
1.85-x86_64-unknown-linux-gnu (active)
miri
active toolchain
----------------
name: 1.85-x86_64-unknown-linux-gnu
active because: overridden by '/home/nlehmann/github/zed/rust-toolchain.toml'
installed targets:
aarch64-apple-darwin
wasm32-wasip1
x86_64-apple-darwin
x86_64-pc-windows-msvc
x86_64-unknown-linux-gnu
```
### OS version
```console
Fedora Linux 41 (6.12.13-200.fc41.x86_64)
```
…and sounds like a fix is already on its way.
Nevertheless, as far as I can tell it should also be the case that an unsuccessful partial download should be able to be continued if you try again; so – assuming that works properly – you shouldn’t be all that limited.
A configurable timeout isn’t really necessary, because the goal of this timeout really only is to detect if your connection got cut completely … as long as any progress keeps being made at all. The fact that it didn’t work that way was a bug, apparently (wrong flavor of “timeout” function being called).
1 Like
You should use a vpn proxy , like " set http_proxy=http://127.0.0.1:7890 set https_proxy=http://127.0.0.1:7890 "
What does this have to do with the rest of this?