Skip to content
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

curl needs --retry-all-errors #4062

Open
2 tasks done
lolbinarycat opened this issue Oct 24, 2024 · 6 comments
Open
2 tasks done

curl needs --retry-all-errors #4062

lolbinarycat opened this issue Oct 24, 2024 · 6 comments
Labels

Comments

@lolbinarycat
Copy link

Verification

Problem

"Connection Reset By Peer" is by-default treated as a fatal error by curl, but can be produced spuriously, either due to switching networks, or overly aggressive load-balancing by ISPs.

Steps

  1. use rustup, then switch between wifi connections.

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup 1.26.0 (1980-01-01)

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home: /home/binarycat/.rustup

installed toolchains

nightly-2024-06-10-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
stage1
1.80.1-x86_64-unknown-linux-gnu

active toolchain

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.83.0-nightly (2bd1e894e 2024-09-26)

OS version

NixOS 24.05 (Uakari)

@rami3l rami3l changed the title curl needs --retry-all-erros curl needs --retry-all-errors Oct 25, 2024
@rami3l rami3l changed the title curl needs --retry-all-errors curl needs --retry-all-errors Oct 25, 2024
@rami3l
Copy link
Member

rami3l commented Oct 25, 2024

@lolbinarycat Thanks for filing this issue!

However, I am not quite sure whether you referring to the rustup-init.sh part or the Rust part of the software... If it's the latter then we have two download backends to choose from, did you mean the libcurl backend specifically?

In other words, would you mind explaining more about when you usually encounter this error?

Many thanks in advance 🙇‍♀

@kyanha
Copy link

kyanha commented Dec 29, 2024

(Not original reporter, but am impacted)

Both could use some retry logic (I've had the problem in both phases, and the fact that neither handles it gracefully doesn't help the user understand what to do), bu for me the biggest pain point is the r6ustup-init.sh script.

The Veilid CI system has a higher than 25% rate of failure over the past months building nightly packages because of this issue. Output pasted:

+deps-rust | --> RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --default-toolchain=$RUST_VERSION -y -c clippy --no-modify-path --profile minimal
          +deps-rust | info: downloading installer
          +deps-rust | info: profile set to 'minimal'
          +deps-rust | info: default host triple is x86_64-unknown-linux-gnu
          +deps-rust | info: syncing channel updates for '1.81.0-x86_64-unknown-linux-gnu'
          +deps-rust | info: latest update on 2024-09-05, rust version 1.81.0 (eeb90cda1 2024-09-04)
          +deps-rust | info: downloading component 'cargo'
          +deps-rust | info: downloading component 'clippy'
          +deps-rust | info: downloading component 'rust-std'
          +deps-rust | info: downloading component 'rustc'
          +deps-rust | error: component download failed for rustc-x86_64-unknown-linux-gnu
          +deps-rust | Caused by:
          +deps-rust |     error decoding response body
          +deps-rust | Stack backtrace:
          +deps-rust |    0: rustup::dist::manifestation::Manifestation::update
          +deps-rust |    1: rustup::dist::dist::try_update_from_dist_
          +deps-rust |    2: rustup::install::InstallMethod::install
          +deps-rust |    3: rustup::toolchain::distributable::DistributableToolchain::install
          +deps-rust |    4: rustup::cli::self_update::install::{{closure}}
          +deps-rust |    5: rustup::cli::self_update::install
          +deps-rust |    6: rustup::cli::setup_mode::main
          +deps-rust |    7: rustup_init::main
          +deps-rust |    8: std::sys_common::backtrace::__rust_begin_short_backtrace
          +deps-rust |    9: main
          +deps-rust |   10: __libc_start_main
          +deps-rust |   11: <unknown>
          +deps-rust | ERROR Earthfile line 44:4
          +deps-rust |       The command
          +deps-rust |           RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --default-toolchain=$RUST_VERSION -y -c clippy --no-modify-path --profile minimal
          +deps-rust |       did not complete successfully. Exit code 1

@rami3l
Copy link
Member

rami3l commented Dec 29, 2024

@kyanha What you reported is rather #4132, I believe.

@lolbinarycat
Copy link
Author

@rami3l I've been having trouble with the rust half of the software.

more specifically, i've been having problems with it inside of nix flakes, where passing environment variables is prohibitively difficult.

also, i'm not sure the reqwest backend would do any better, i don't see any code for continuing downloads.

@rami3l
Copy link
Member

rami3l commented Dec 31, 2024

@lolbinarycat This is very interesting. We already have download resuming:

rustup/download/src/lib.rs

Lines 239 to 240 in ae210ce

if resume_from > 0 {
handle.resume_from(resume_from)?;

... we even have an issue specifically about this feature:

@rami3l
Copy link
Member

rami3l commented Jan 2, 2025

@lolbinarycat I do think there's a possibility that we need to fix our business logic WRT cache invalidation (#4132 (comment))... I'll find some time to investigate into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants