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

Confusing error message toolchain "stable-x86_64-unknown-linux-gnu" is not installable #3885

Closed
2 tasks done
Pierremalle opened this issue Jun 17, 2024 · 9 comments · Fixed by #3923
Closed
2 tasks done
Milestone

Comments

@Pierremalle
Copy link

Pierremalle commented Jun 17, 2024

Verification

Problem

Hi,

My bug occurs when using the command "rustup default stable".

rustup default stable

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: update not yet available, sorry! try again later
error: toolchain 'stable-x86_64-unknown-linux-gnu' is not installable
T0301518@W604431:~/projet_stage/switchctrl_rust (master #)$ rustup --verbose toolchain install --force stable
verbose: read metadata version: '12'
verbose: installing toolchain 'stable-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/users/T0301518/.rustup/toolchains/stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
verbose: creating temp file: /users/T0301518/.rustup/tmp/zg3wk2z9s5h3ep5g_file
verbose: downloading file from: 'https://t0301518:cmVmdGtuOjAxOjE3NDk2NTA3NjQ6SlVhT1p3a3lnb2xmNjZKSFNuaDA2ZFlOOThK@artifactory.thalesdigital.io/ui/repos/tree/General/cargo-external/dist/channel-rust-stable.toml.sha256'
verbose: downloading with curl
verbose: deleted temp file: /users/T0301518/.rustup/tmp/zg3wk2z9s5h3ep5g_file
verbose: no update hash at: '/users/T0301518/.rustup/update-hashes/stable-x86_64-unknown-linux-gnu'
verbose: creating temp file: /users/T0301518/.rustup/tmp/prfg38jg21h320wm_file.toml
verbose: downloading file from: 'https://t0301518:cmVmdGtuOjAxOjE3NDk2NTA3NjQ6SlVhT1p3a3lnb2xmNjZKSFNuaDA2ZFlOOThK@artifactory.thalesdigital.io/ui/repos/tree/General/cargo-external/dist/channel-rust-stable.toml'
verbose: downloading with curl
verbose: deleted temp file: /users/T0301518/.rustup/tmp/prfg38jg21h320wm_file.toml
info: update not yet available, sorry! try again later
verbose: toolchain is already up to date
error: toolchain 'stable-x86_64-unknown-linux-gnu' is not installable

rustup show

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

no active toolchain

As you may see, i'm trying to install the latest rust version. My rustup path is changed through a Artifactory path mirroring the official one through a proxy.
What i don't understand is the "version is not installable" as if i don't have the rights or it can't connect to the repository.
Can you please help me ?

Steps

  1. Set up a artifactory mirror to Rust depository
  2. Install rustup through rustup-init.sh (seems to be working)
  3. use "rustup default stable" or any other version install.

Possible Solution(s)

As i thought the problem may be two things :

  • I didn't properly setup artifactory mirroring (but i can download rustup through .sh so weird)
  • I don't have sudo privilegies (can't do anything about it sorry)

Notes

No response

Rustup version

rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.

Installed toolchains

None

OS version

Redhat 7.3 x86_64
@rami3l
Copy link
Member

rami3l commented Jun 17, 2024

@Pierremalle Salut, and thanks for filing this issue!

The aforementioned error comes from here:

rustup/src/dist/mod.rs

Lines 1119 to 1124 in 1eb4de7

Err(any) => {
if let Some(RustupError::ChecksumFailed { .. }) = any.downcast_ref::<RustupError>() {
// Checksum failed - issue warning to try again later
(download.notify_handler)(Notification::ManifestChecksumFailedHack);
}
Err(any)

... which was introduced in #562 back in 2016 (!!). This message should indicate a checksum mismatch, however since this error is very rare, the last few lines of the expected error message have clearly gone missing over the years without anyone noticing until today:

[rust]$ rustup update
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: update not yet available, sorry! try again later
error: checksum failed, expected: 'afac5aec3145de8a551e930980045d4e7867c83aa5909246087e451bf0038aed', calculated: 'd411ebefe2ceb819fc78423e0cc6425b05d84b5c370ad9aeb19bffea9949dd53'
info: checking for self-updates

  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.15.0-nightly (ba872f270 2016-11-17)

#524 (comment)

Unless indicated otherwise, I suspect this would have something to do with the upstream release server(s) (the one within Thales rather than the official one), see #346 for more context on this.

That said, it seems reasonable for us to make the error message clearer so that you might feel lost less often.

@rami3l rami3l added this to the 1.28.0 milestone Jun 17, 2024
@rami3l
Copy link
Member

rami3l commented Jun 17, 2024

Can confirm that somehow the output has deviated from the expected one in the v1.27 series: #3390 (comment).

@Pierremalle
Copy link
Author

Thank you a lot.
i'll check that with Artifactory. Since i changed instance due to a network problem i must have forgotten to regenerate a API token so it just don't find me.

Want me to consider this as close or keep that feed until i can make it work in case of anything ?
Thanks again.

@rami3l
Copy link
Member

rami3l commented Jun 17, 2024

Want me to consider this as close or keep that feed until i can make it work in case of anything ? Thanks again.

@Pierremalle I'd like to leave it open to track the missing output that made you confused :)

@Pierremalle
Copy link
Author

Oh, it begins to be fun.

i've looked at Artifactory configuration. I regenerated an API key and verified the proxy.
I can curl the page, however, i face a HTTP 304 code from the source which probably means that my Artifactory is somehow messed up.

I'll tell more when i find more about it.

@Pierremalle
Copy link
Author

Pierremalle commented Jun 18, 2024

Well, as it turned out.

The first error message was coming from the fact that my artifactory path to RUSTUP_UPDATE_ROOT didn't exist.

Despite that i can't make Rustup work through Artifactory since :

  • It uses curl but without the power of deactivate SSL check, seems fair.
  • The way rustup download rust by using the official site as his own repo would mean that we need to mirror the entire site which is hard to keep in security condition.

After asking to a senior dev knowing a bit more with Artifactory, he basically told me :
Ask to sys admin to do it for you (not kind)
Build rust from source.

So i think my next move will be to force it with the rust standalone version or with the sources and link anything needed.

Wish me luck lads.

@rami3l
Copy link
Member

rami3l commented Jun 18, 2024

@Pierremalle Wait, you're still on the curl backend? We've been on reqwest by default since a while ago now and we're planning to move to reqwest+rustls (#3806). Is there a particular reason for still using curl?

Hmmm if you need to install Rust manually, maybe you can still use Rustup with the instructions in https://rust-lang.github.io/rustup/installation/already-installed-rust.html.

@Pierremalle
Copy link
Author

No not really.
I was taking an example from a procedure to install Rust on Windows that supposedly work, and yes it sounds weird now that i say it 🤔

But doesn't the problem would be the same if i'm with curl or reqwest ?
Both check SSL no ?

@rami3l
Copy link
Member

rami3l commented Jul 7, 2024

@Pierremalle You're right. I've made the following update to the error messages nonetheless:

Before

    info: syncing channel updates for 'nightly-aarch64-apple-darwin'
    info: update not yet available, sorry! try again later
    error: toolchain 'nightly-aarch64-apple-darwin' is not installable

After

    info: syncing channel updates for 'nightly-aarch64-apple-darwin'
    warn: checksum failed for <SNIP>, expected: 'aaaaaaaaaa0f87d2df5e0cff356df307b6649a7b0b4effdf4b6dbd15070206de', calculated: '907f97b96e0f87d2df5e0cff356df307b6649a7b0b4effdf4b6dbd15070206de'
    info: if you are on the official release server, this is most likely due to an update happening right now, please try again later
    info: if you are on a third-party release server, this might indicate a problem with the server's configuration
    error: toolchain 'nightly-aarch64-apple-darwin' is not installable

I'll make this a PR real soon.

@rami3l rami3l changed the title toolchain "stable-x86_64-unknown-linux-gnu" is not installable Confusing error message toolchain "stable-x86_64-unknown-linux-gnu" is not installable Jul 7, 2024
@rami3l rami3l added enhancement and removed bug labels Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants