Rustup: Increase timeout and improve error message when reading rustc version

Created on 14 May 2017  Â·  10Comments  Â·  Source: rust-lang/rustup

When I run rustup update I see..
screen shot 2017-05-13 at 10 38 57 pm

E-easy bug help wanted

Most helpful comment

@Diggsey That is exactly the problem here on my side.

I have an old hard drive, 1 second for the timeout isn't quite enough.

Reading the version actually succeeds if I spam the command enough times to completely warm up the cache.

I suggest increasing the timeout to at least 3 seconds, and actually show in the error that a timeout occured.

Ref #1071

All 10 comments

What OS are you running? This error is expected if the toolchain you have installed does not run on your system.

The screen shot is from my mac, and it is running OS X 10.9.5.

On Sun, May 14, 2017 at 5:01 AM, Diggory Blake notifications@github.com
wrote:

What OS are you running? This error is expected if the toolchain you have
installed does not run on your system.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rust-lang-nursery/rustup.rs/issues/1118#issuecomment-301304864,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJSF1sC2K3CRHmxab5W_dhBN-76jiXq5ks5r5t71gaJpZM4NaRfj
.

Update: I also have a ubuntu laptop. I uninstalled rustup last night and reinstalled it (and all my cargo binaries, like rustfmt) just to check if my caches had got messed up somehow, and everything was working fine. I just ran rustup update to see if the new nightly was available yet, and I'm getting the same error on that one now, but only for the stable channel and not the nightly. This just happened overnight, literally.

I also removed and reinstalled on my mac. Same thing there now.

I'm using rustup version 1.3.0 2017-05-09.

same hear on windows 10.

C:\rust_things>rustup -V
rustup 1.3.0 (124170c 2017-05-09)
C:\rust_things>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: syncing channel updates for '1.0.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.2.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.4.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.8.0-x86_64-pc-windows-gnu'
info: checking for self-updates

                          stable unchanged - (error reading rustc version)
                     stable-msvc unchanged - (error reading rustc version)
    stable-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
   stable-x86_64-pc-windows-msvc unchanged - (error reading rustc version)
                         nightly unchanged - (error reading rustc version)
   nightly-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.19.0-nightly (75b056812 2017-05-15)
     1.0.0-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
     1.2.0-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
     1.4.0-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
     1.8.0-x86_64-pc-windows-gnu unchanged - (error reading rustc version)

Ok this is odd. Just re-ran it 30sec later this time I get:

C:\rust_things>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: syncing channel updates for '1.0.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.2.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.4.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.8.0-x86_64-pc-windows-gnu'
info: checking for self-updates

                          stable unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
                     stable-msvc unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
    stable-x86_64-pc-windows-gnu unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
   stable-x86_64-pc-windows-msvc unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
                         nightly unchanged - (error reading rustc version)
   nightly-x86_64-pc-windows-gnu unchanged - rustc 1.19.0-nightly (75b056812 2017-05-15)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.19.0-nightly (75b056812 2017-05-15)
     1.0.0-x86_64-pc-windows-gnu unchanged - rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
     1.2.0-x86_64-pc-windows-gnu unchanged - rustc 1.2.0 (082e47636 2015-08-03)
     1.4.0-x86_64-pc-windows-gnu unchanged - rustc 1.4.0 (8ab8581f6 2015-10-27)
     1.8.0-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
C:\rust_things>rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: syncing channel updates for '1.0.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.2.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.4.0-x86_64-pc-windows-gnu'
info: downloading component 'rust'
info: syncing channel updates for '1.8.0-x86_64-pc-windows-gnu'
info: checking for self-updates

                          stable unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
                     stable-msvc unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
    stable-x86_64-pc-windows-gnu unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
   stable-x86_64-pc-windows-msvc unchanged - rustc 1.17.0 (56124baa9 2017-04-24)
                         nightly unchanged - rustc 1.19.0-nightly (75b056812 2017-05-15)
   nightly-x86_64-pc-windows-gnu unchanged - rustc 1.19.0-nightly (75b056812 2017-05-15)
  nightly-x86_64-pc-windows-msvc unchanged - rustc 1.19.0-nightly (75b056812 2017-05-15)
     1.0.0-x86_64-pc-windows-gnu unchanged - rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)
     1.2.0-x86_64-pc-windows-gnu unchanged - rustc 1.2.0 (082e47636 2015-08-03)
     1.4.0-x86_64-pc-windows-gnu unchanged - rustc 1.4.0 (8ab8581f6 2015-10-27)
     1.8.0-x86_64-pc-windows-gnu unchanged - rustc 1.8.0 (db2939409 2016-04-11)

So that is odd.

Ah, it looks like a timing issue - some historic versions of rust are known to hang on new systems, so rustup recently introduced a timeout of one second when it runs rustc --version.

Perhaps if you are using a hard drive from a cold-start, or if a virus scanner is operating, it causes the startup time to exceed one second? Maybe we need to increase the timeout, and show a different error message if times out vs if it fails?

@Diggsey That is exactly the problem here on my side.

I have an old hard drive, 1 second for the timeout isn't quite enough.

Reading the version actually succeeds if I spam the command enough times to completely warm up the cache.

I suggest increasing the timeout to at least 3 seconds, and actually show in the error that a timeout occured.

Ref #1071

Same here.

On Sun, May 21, 2017 at 12:04 AM, Mika Attila notifications@github.com
wrote:

@Diggsey https://github.com/diggsey That is exactly the problem here on
my side.

I have an old hard drive, 1 second for the timeout isn't quite enough.

Reading the version actually succeeds if I spam the command enough times
to completely warm up the cache.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rust-lang-nursery/rustup.rs/issues/1118#issuecomment-302917401,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJSF1tZ5whX3URlQo2JSmJZ-DIt_SUUSks5r79PrgaJpZM4NaRfj
.

Windows 8.1 64bit; Rust nightly gnu.

This also happens with rustup show _for the first time after an update_, consistently.

$ time rustc --version
rustc 1.20.0-nightly (f590a44ce 2017-06-27)

real    0m0.159s
user    0m0.000s
sys     0m0.015s

Windows 7 64 bit; Rust nightly gnu.

Same problem here, after rustup update

$ rustup update
info: syncing channel updates for 'stable-x86_64-pc-windows-gnu'
info: syncing channel updates for 'nightly-x86_64-pc-windows-gnu'
info: checking for self-updates

   stable-x86_64-pc-windows-gnu unchanged - rustc 1.25.0 (84203cac6 2018-03-25)
  nightly-x86_64-pc-windows-gnu unchanged - (error reading rustc version)
$ time rustc --version

real    0m0.031s
user    0m0.000s
sys     0m0.015s

arch 4.14.69-1 64bit

rustup toolchain install stable-x86_64-apple-darwin
info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: latest update on 2018-09-13, rust version 1.29.0 (aa3ca1994 2018-09-11)
info: downloading component 'rustc'
 57.7 MiB /  57.7 MiB (100 %)   4.0 MiB/s ETA:   0 s                
info: downloading component 'rust-std'
 45.8 MiB /  45.8 MiB (100 %)   4.1 MiB/s ETA:   0 s                
info: downloading component 'cargo'
  3.3 MiB /   3.3 MiB (100 %)   2.1 MiB/s ETA:   0 s                
info: downloading component 'rust-docs'
  8.2 MiB /   8.2 MiB (100 %)   2.5 MiB/s ETA:   0 s                
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'

  stable-x86_64-apple-darwin installed - (error reading rustc version)

edit: same happening with beta and nightly

Was this page helpful?
0 / 5 - 0 ratings