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

Increase timeout and improve error message when reading rustc version #1118

Closed
rnleach opened this issue May 14, 2017 · 10 comments
Closed

Increase timeout and improve error message when reading rustc version #1118

rnleach opened this issue May 14, 2017 · 10 comments

Comments

@rnleach
Copy link

rnleach commented May 14, 2017

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

@Diggsey
Copy link
Contributor

Diggsey commented May 14, 2017

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

@rnleach
Copy link
Author

rnleach commented May 14, 2017 via email

@rnleach
Copy link
Author

rnleach commented May 15, 2017

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.

@Eh2406
Copy link

Eh2406 commented May 16, 2017

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.

@Diggsey
Copy link
Contributor

Diggsey commented May 16, 2017

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?

@crumblingstatue
Copy link
Contributor

crumblingstatue commented May 21, 2017

@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

@Diggsey Diggsey changed the title error reading rustc version Increase timeout and improve error message when reading rustc version May 21, 2017
@rnleach
Copy link
Author

rnleach commented May 21, 2017 via email

bors added a commit that referenced this issue May 22, 2017
Increase Rust detection timeout to 3 seconds

Fixes #1118

With 3 seconds timeout cold start isn't issue anymore.

To simulate cold start use:
```
sync ; echo 3 | sudo tee /proc/sys/vm/drop_caches
rustup update
```
bors added a commit that referenced this issue May 22, 2017
Increase Rust detection timeout to 3 seconds

Fixes #1118

With 3 seconds timeout cold start isn't issue anymore.

To simulate cold start use:
```
sync ; echo 3 | sudo tee /proc/sys/vm/drop_caches
rustup update
```
bors added a commit that referenced this issue May 22, 2017
Increase Rust detection timeout to 3 seconds

Fixes #1118

With 3 seconds timeout cold start isn't issue anymore.

To simulate cold start use:
```
sync ; echo 3 | sudo tee /proc/sys/vm/drop_caches
rustup update
```
@munael
Copy link

munael commented Jun 28, 2017

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

@Ronaldho80
Copy link

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

@NyxCode
Copy link

NyxCode commented Sep 17, 2018

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

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

No branches or pull requests

7 participants