-
Notifications
You must be signed in to change notification settings - Fork 951
Rustup doesn't handle HTTP 416 errors when downloading toolchains #2071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We've merged some code to remove spurious or broken |
Tested this. The partial file is actually removed after the build finishes, but you have to re-run rustup again manually to actually download the release. It'd be awesome if rustup could just retry the request on its own. |
I had this same error in what seems to be an old version of rustup. Running $ rustup install stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2019-11-07, rust version 1.39.0 (4560ea788 2019-11-04)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
error: component download failed for rust-std-x86_64-unknown-linux-gnu
error: caused by: could not download file from 'https://static.rust-lang.org/dist/2019-11-07/rust-std-1.39.0-x86_64-unknown-linux-gnu.tar.xz' to '/home/joshua/.rustup/downloads/b629952ec9e3e750137d7b8a922de145c97c1dc372dd616e86e4e501da13910b.partial'
error: caused by: http request returned an unsuccessful status code: 416
$ rustup --version
rustup 1.20.2 (13979c968 2019-10-16)
$ rustup self update
info: checking for self-updates
$ rustup --version
rustup 1.20.2 (13979c968 2019-10-16) |
@jyn514 Yes, this is slated to be fixed by 1.21.0 (see the milestone) but that's not released yet (see the milestone) :D |
Problem
While setting up a Crater agent the container running Crater was killed for reasons in the middle of a rustup download. After starting the container again rustup kept failing with this error message:
Steps
Note that these steps didn't cause the original bug, but they reproduce the same symptoms.
.partial
file to 1 GB, way above the total size of the file:Possible Solution(s)
The HTTP 416 status code means the
content-range
requested to the server was not satisfiable, which in our case means a corrupted (or overly large like in my repro steps) partial file. Rustup could handle this better by ignoring the partial and starting to download from scratch when it receives a 416 status code.Notes
Output of
rustup --version
:Output of
rustup show
: not relevantThe text was updated successfully, but these errors were encountered: