rust-lang / rust-lang/rustup

Rustup fails to download files

Open
#924 12 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Rustup seems unable to download files on my system:

$ ./rustup.sh -v --default-toolchain nightly
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust programming 
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin 
directory, located at:

  /home/ajr/.cargo/bin

This path will then be added to your PATH environment variable by modifying the
profile file located at:

  /home/ajr/.profile

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: nightly
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
1

verbose: installing toolchain 'nightly-x86_64-unknown-linux-gnu'
verbose: toolchain directory: '/home/ajr/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
verbose: creating temp file: /home/ajr/.rustup/tmp/5ow4nv7ga952c6gd_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256'
verbose: downloading with curl
verbose: removing toolchain directory: '/home/ajr/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/ajr/.rustup/tmp/5ow4nv7ga952c6gd_file
info: caused by: error during download
info: caused by: [6] Couldn't resolve host name (Couldn't resolve host 'static.rust-lang.org')
rustup: command failed: /tmp/tmp.1idI66A40j/rustup-init -v --default-toolchain nightly

However, I think the "Couldn't resolve host name" error is a red herring. I can download the file manually:

$ curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256 -o /home/ajr/.rustup/tmp/5ow4nv7ga952c6gd_file
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    92  100    92    0     0    619      0 --:--:-- --:--:-- --:--:--   617
$ cat ~/.rustup/tmp/5ow4nv7ga952c6gd_file 
cc1911a14ebe4b8c7cae05351c11072f605752d2dba7464d6ca69c861142edd0  channel-rust-nightly.toml

And I can definitely resolve the hostname "static.rust-lang.org":

$ dig static.rust-lang.org
 
; <<>> DiG 9.10.4-P4 <<>> static.rust-lang.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46648
;; flags: qr rd ra; QUERY: 1, ANSWER: 9, AUTHORITY: 13, ADDITIONAL: 16
 
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;static.rust-lang.org.          IN      A
 
;; ANSWER SECTION:
static.rust-lang.org.   9359    IN      CNAME   d3ah34wvbudrdd.cloudfront.net.
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.130
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.42
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.245
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.163
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.75
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.151
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.240
d3ah34wvbudrdd.cloudfront.net. 25 IN    A       54.192.147.56
 
;; AUTHORITY SECTION:
net.                    50427   IN      NS      k.gtld-servers.net.
net.                    50427   IN      NS      i.gtld-servers.net.
net.                    50427   IN      NS      h.gtld-servers.net.
net.                    50427   IN      NS      a.gtld-servers.net.
net.                    50427   IN      NS      c.gtld-servers.net.
net.                    50427   IN      NS      g.gtld-servers.net.
net.                    50427   IN      NS      j.gtld-servers.net.                                                            
net.                    50427   IN      NS      f.gtld-servers.net.                                                            
net.                    50427   IN      NS      l.gtld-servers.net.                                                            
net.                    50427   IN      NS      e.gtld-servers.net.                                                            
net.                    50427   IN      NS      m.gtld-servers.net.                                                            
net.                    50427   IN      NS      b.gtld-servers.net.                                                            
net.                    50427   IN      NS      d.gtld-servers.net.                                                            
                                                                                                                               
;; ADDITIONAL SECTION:                                                                                                          
h.gtld-servers.net.     50427   IN      A       192.54.112.30                                                                  
d.gtld-servers.net.     28232   IN      A       192.31.80.30                                                                    
i.gtld-servers.net.     50427   IN      A       192.43.172.30                                                                  
b.gtld-servers.net.     50427   IN      A       192.33.14.30                                                                    
k.gtld-servers.net.     50427   IN      A       192.52.178.30                                                                  
e.gtld-servers.net.     37229   IN      A       192.12.94.30                                                                    
m.gtld-servers.net.     50427   IN      A       192.55.83.30                                                                    
j.gtld-servers.net.     50427   IN      A       192.48.79.30                                                                    
g.gtld-servers.net.     39512   IN      A       192.42.93.30                                                                    
a.gtld-servers.net.     50427   IN      A       192.5.6.30                                                                      
l.gtld-servers.net.     50427   IN      A       192.41.162.30                                                                  
c.gtld-servers.net.     50427   IN      A       192.26.92.30                                                                    
f.gtld-servers.net.     50427   IN      A       192.35.51.30                                                                    
b.gtld-servers.net.     50427   IN      AAAA    2001:503:231d::2:30                                                            
a.gtld-servers.net.     50427   IN      AAAA    2001:503:a83e::2:30                                                            
                                                                                                                               
;; Query time: 0 msec                                                                                                          
;; SERVER: 10.10.0.2#53(10.10.0.2)                                                                                              
;; WHEN: Sat Jan 14 23:22:12 PST 2017                                                                                          
;; MSG SIZE  rcvd: 705

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using ./rustup.sh -v --default-toolchain nightly and inspect the download path that reports the DNS error. Compare it with the successful manual curl request for channel-rust-nightly.toml.sha256. Done means rustup can download the nightly channel file and proceed with installation in the reported environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.