You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After downloading around 40MiB (the exact amount varies, but that might just be because the progress bar isn't updated one final time on error?) rustc always fails. All other downloads succeed, though I've seen sporadic failures in other components too.
The connection isn't stalling out, it's consistently going at 1.5MB/s
curl 'https://static.rust-lang.org/dist/2024-11-28/rustc-1.83.0-x86_64-unknown-linux-gnu.tar.xz' succeeds and downloads the entire 69.3MiB, so this is a Rustup issue, not a network one
I'm on a VPN so the crappy hotel WiFi can't be net-unneutral, and even if it was, it should also have failed on the curl, which it didn't
Curl was also done over the VPN so if the VPN was the problem, Curl shouldn't have worked
This is a pretty spotty internet connection -- when I say things like "Curl worked" I mean "Curl only fails like 1 in 20 times, and not always at the same spot, so it's exhibiting typical spotty internet behavior instead of this bug".
It's just Rustup having this issue. I can download crates and otherwise browse the internet just fine. But most files being pulled are less than 40MiB, so that might not be indicative of much.
Steps
Install Rustup
rustup default stable
Possible Solution(s)
Spitballing:
Cache previously downloaded files (this also has the nice benefit of, if it fails, letting you resume after all the completed downloads)
Keep partial downloads around and use Range requests to download the rest of the file
Maybe automatically resume the download if it errors out as part of retrying?
Though I didn't see any retries happening, so whatever the underlying error is, Rustup thinks it's permanent.
Notes
I got rustup working using my fileserver (mostly since i already had it lying around) and this mildly cursed setup across two terminals:
mkdir ~/tmp-rustup
cd ~/tmp-rustup
httpserv . | grep --line-buffered -Po '(?<=Serving ).*?(?= with 404)' | while read -r missing; do
[ -f ./"$missing" ] && continue
tmp="$(mktemp -u ./XXXXXXXX)"
echo "Getting $missing..."
if curl -# 'https://static.rust-lang.org'"$missing" -o "$tmp"; then
mkdir -p ./"$(dirname "$missing")"
mv "$tmp" ./"$missing"
else
rm "$tmp"
fi
done
while ! RUSTUP_DIST_SERVER=http://localhost:8080 rustup install stable; do sleep 10; done
Not sure what the difference would be but I do know I built httpserv to be the minimum viable HTTP server, so it ignores a lot of potential complicating factors like Connection or Range headers.
Rustup version
rustup 1.27.1 (2024-05-07)
Installed toolchains
Default host: x86_64-unknown-linux-gnurustup home: /home/user/.rustupno active toolchain
OS version
Arch Linux, updated today (2024-12-29)
The text was updated successfully, but these errors were encountered:
Just noting in case anyone else is having this issue: It hasn't happened while I've been on more stable internet, but it does keep happening on the unstable one. If you're experiencing this, your best fix is getting a more reliable internet connection. If you can't, you can use the workaround I did by downloading with Curl and locally serving files with any random HTTP server, including python -m http.server, if you fiddle with the regex.
Without knowing anything about how Rustup works internally, I think the best code fix here is to either figure out why Curl isn't being interrupted but Rustup is, or just add download caching, including partial downloads, using Range to retry just the missing parts of files. That also adds the benefit of not having to redownload every file when one component breaks...
@nic-hartley Just to clarify, we do have download resuming in Rustup today. However, I think you might have encountered a case where that cache got invalidated, and if so, we would need to fix that part of the business logic.
Huh! Testing again and looking more carefully: You're right! If I ctrl+c a rustup install it does resume partway through, and it is reusing old files. Serves me right for not checking closer.
Verification
Problem
After downloading around 40MiB (the exact amount varies, but that might just be because the progress bar isn't updated one final time on error?) rustc always fails. All other downloads succeed, though I've seen sporadic failures in other components too.
For example, after a fresh reinstall:
Of note:
curl 'https://static.rust-lang.org/dist/2024-11-28/rustc-1.83.0-x86_64-unknown-linux-gnu.tar.xz'
succeeds and downloads the entire 69.3MiB, so this is a Rustup issue, not a network oneSteps
rustup default stable
Possible Solution(s)
Spitballing:
Range
requests to download the rest of the fileThough I didn't see any retries happening, so whatever the underlying error is, Rustup thinks it's permanent.
Notes
I got rustup working using my fileserver (mostly since i already had it lying around) and this mildly cursed setup across two terminals:
Not sure what the difference would be but I do know I built httpserv to be the minimum viable HTTP server, so it ignores a lot of potential complicating factors like
Connection
orRange
headers.Rustup version
rustup 1.27.1 (2024-05-07)
Installed toolchains
OS version
Arch Linux, updated today (2024-12-29)
The text was updated successfully, but these errors were encountered: