Rustup: error: could not download file from ...

Created on 4 Jan 2018  ·  38Comments  ·  Source: rust-lang/rustup

Arch linux
Internet connection has no problem

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/alex/.rustup/tmp/n6b91922kkyrvmlh_file'
info: syncing channel updates for '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/alex/.rustup/tmp/mb54blu9ah_jdzen_file'

   stable-x86_64-unknown-linux-gnu update failed - rustc 1.22.1 (05e2e1c41 2017-11-22)
  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.24.0-nightly (687d3d15b 2018-01-02)

Most helpful comment

windows10
Internet connection has no problem

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:

  C:\Users\xxxx\.cargo\bin

This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.

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

Current installation options:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

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

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\Enyala\.rustup\tmp\3yj89lchh3vfhemb_file'
info: caused by: error during download
info: caused by: [28] Timeout was reached
Press the Enter key to continue.

that's my first install the Rust program language and I can assess to the office website.but this problem still exist.

All 38 comments

$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/home/alex/.rustup/tmp/n6b91922kkyrvmlh_file
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/channel-rust-stable.toml.sha256to/home/alex/.rustup/tmp/n6b91922kkyrvmlh_file</Key><RequestId>84E2EE4A96B2FB85</RequestId><HostId>s5mhaDJJ7MX1Luf096u7qCvAHYqB0TlBpJLERe0BxNGY+glWMuV45Vev4QYEGFVcbnlS/EdafWg=</HostId></Error>


$ curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/home/alex/.rustup/tmp/mb54blu9ah_jdzen_file
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/channel-rust-nightly.toml.sha256to/home/alex/.rustup/tmp/mb54blu9ah_jdzen_file</Key><RequestId>D3A7574FEF0E8854</RequestId><HostId>9rg8TebkQ3mPrVE265Hy1rWE0cm4Vgw6iG/p9PhqXenxwJh2utaRivn8FEz6iniVpE+yAMoFIo8=</HostId></Error>

Have this problem solved? I meet the same issue........

Any word on this? I'm running into the same issue and I can't figure out what's wrong.

@GildedHonour When you copied and pasted that URL into curl, you copied some extra text as well, which caused your error.

When I run curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256 I get what looks like a valid sha256 file:

$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
10da11872e920f56826d8a6ba63712a24f4d44d3f31d800c311d9ae9207cf28e  channel-rust-stable.toml

In #1400, @jneumann writes "When I ran the command with --verbose, the file it was trying to download was the *.toml.sha256 file, which I can manually download via curl without issue."

For me, both rustup and curl work, so we might need some more information from those for whom it doesn't work to debug the issue.

To debug such a problem, it would be useful for someone seeing the problem to try doing a packet capture during the rustup command and the curl command to see how the HTTP request and reply differ. If you are on a linux system and have tcpdump installed, you should be able to run tcpdump -s0 -w rustup-issue-1328.pcap -i <your-ethernet-or-wifi-device> tcp port 443 or udp port 53, and while that is running try the download with both curl and rustup. It will be helpful if you don't have anything else running which might be doing HTTPS or DNS requsts, so you only capture traffic generated by these two commands.

That resulting rustup-issue-1328.pcap file can be viewed in Wireshark or posted on CloudShark to see what is going on differently between rustup and curl when accessing this file.

A few other things that I might use to debug the issue: run strace on rustup and curl to see what files they are each opening; it could be possible that they are using different certificate stores, or different proxy settings, or the like.

@lambda Thanks for the tips. I narrowed it down to an issue with my ISP's DNS. Unfortunately, I don't know enough about how the Internet works to narrow it down further.

@GildedHonour @sgy1993 can you confirm whether changing your DNS fixes the problem? (eg. try google's DNS on 8.8.8.8)

When install 1.28 on macos, this problem occurs.

rustup --verbose default stable
verbose: read metadata version: '12'
verbose: looking for installed toolchain 'stable-x86_64-apple-darwin'
verbose: installing toolchain 'stable-x86_64-apple-darwin'
verbose: toolchain directory: '/Users/chmin/.rustup/toolchains/stable-x86_64-apple-darwin'
info: syncing channel updates for 'stable-x86_64-apple-darwin'
verbose: creating temp file: /Users/cmin/.rustup/tmp/48wps64tthrowyfd_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with curl
verbose: deleted temp file: /Users/cmin/.rustup/tmp/48wps64tthrowyfd_file
verbose: removing toolchain directory: '/Users/cmin/.rustup/toolchains/stable-x86_64-apple-darwin'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/Users/cmin/.rustup/tmp/48wps64tthrowyfd_file'
info: caused by: error during download
info: caused by: [28] Timeout was reached (Operation timed out after 30004 milliseconds with 0 out of 0 bytes received)

windows10
Internet connection has no problem

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:

  C:\Users\xxxx\.cargo\bin

This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.

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

Current installation options:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

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

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\Enyala\.rustup\tmp\3yj89lchh3vfhemb_file'
info: caused by: error during download
info: caused by: [28] Timeout was reached
Press the Enter key to continue.

that's my first install the Rust program language and I can assess to the office website.but this problem still exist.

I meet the same issue.

Current installation options:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

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

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\DH\.rustup\tmp\f7xa5i_g2dy72jtm_file'
info: caused by: error during download
info: caused by: [35] SSL connect error

Press the Enter key to continue.

me too

try again...

Having this exact problem on a fresh Ubuntu 18.04 install no it's not my router or DNS, other machines on the same network and DNS work fine

I have the same issue on https://build.snapcraft.io.
There are 5 architecture environments (armhf/arm64/ppc64el/i386/amd64).
This issue occurred on armhf only.

info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/root/.cargo/tmp/299821akh41mwhqi_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out

Full build log is below:
https://build.snapcraft.io/user/dalance/procs/577559

@dalance Is there a non-standard network setup in the snapcraft build environment? Rustup defaults to making direct connections unless there's an appropriate proxy configured in the environment. If snapcraft relies on an altered curl library or somesuch then rustup won't be able to work there.

@kinnison Thank you for your suggestion. Snapcraft environment seems to use proxy.
I ran some test script on the environment. rustup with curl-backend is OK, and rustup with reqwest-backend is NG.

$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
e6118276ddab3e00a967e11583685e3205564e31e4007968056ffd0878db19c0  channel-rust-stable.toml
$ echo $http_proxy
http://10.10.10.1:8222/
$ echo $https_proxy
http://10.10.10.1:8222/
$ ~/.cargo/bin/rustup install stable
info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/root/.cargo/tmp/299821akh41mwhqi_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out
$ RUSTUP_USE_CURL=1 ~/.cargo/bin/rustup install stable
info: syncing channel updates for 'stable-arm-unknown-linux-gnueabihf'
info: latest update on 2019-05-23, rust version 1.35.0 (3c235d560 2019-05-20)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'

Okay, that's interesting. Does cURL still manage to download if you unset the proxy environment variables? rustup should honour those environment variables using the reqwest backend, so perhaps something else is in play?

If unset, cURL can't download.

$ unset http_proxy
$ unset https_proxy
$ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
curl: (6) Could not resolve host: static.rust-lang.org

@dalance Fascinating, our reqwest backend really ought to be working with all that. I wonder what's going on. I will be at Snapcraft Summit next week in Montréal, so if you could possibly provide details of how to reproduce that environment I will see if I can debug it while with Snappy people.

@kinnison My snapcraft.yaml to reproduce is below.

name: procs
version: &version v0.8.5
summary: A modern replacement for ps written in Rust
description: |
  procs is a tool to display process information.
base: core18
license: MIT

confinement: strict

architectures:
# - build-on: amd64
# - build-on: i386
# - build-on: ppc64el
# - build-on: arm64
  - build-on: armhf

apps:
  procs:
    command: procs

parts:
  procs:
    source: https://github.com/dalance/procs.git
#   source-tag: *version
    plugin: make
    stage-packages:
      - libc6
      - libgcc1
      - libstdc++6
      - zlib1g
    build-packages:
      - curl
    override-build: |
      /build/procs/parts/procs/src/rustup.sh -y --default-toolchain none -v
      curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
      echo $http_proxy
      echo $https_proxy
      RUSTUP_USE_CURL=1 ~/.cargo/bin/rustup install stable

I tried to reproduce qemu and docker environment on x86_64 by multiarch/ubuntu-core:armhf-bionic docker image.
But in this image, rustup through proxy works fine.

Thanks. Hopefully I'll be able to get someone at the conference to help me reproduce this.

I have the similar problems, but I don't know how to resolve it. I need your help ,thankyou very much:

curl https://sh.rustup.rs -sSf | sh -s -- --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:

/root/.cargo/bin

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

/root/.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

info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/root/.rustup/tmp/v503rbkomwx867u2_file'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256: error trying to connect: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:ssl/record/ssl3_record.c:332:

I run# curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
e6118276ddab3e00a967e11583685e3205564e31e4007968056ffd0878db19c0 channel-rust-stable.toml
It's good

It worked after I disabled network proxy...

@RainKolwa It would be super-helpful if you could provide an example of your proxy setup. Our shift from cURL to reqwest as an HTTP backend should have been feature-compatible, but clearly it's not quite.

Proceed with installing necessary dependencies? (y/N) > y
Installing Rust......
curl: (6) Could not resolve host: sh.rustup.rs
info: syncing channel updates for 'stable-x86_64-apple-darwin'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/Users/rainkolwa/.rustup/tmp/uqiwckx1xkh2e6ut_file'
info: checking for self-updates
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/var/folders/jg/1df1nfns585bgmvwbz_llyb40000gq/T/rustup-update.2UA22XK8IRTO/release-stable.toml'
info: caused by: failed to make network request
info: caused by: https://static.rust-lang.org/rustup/release-stable.toml: timed out

I mean I disabled the Proxy, actually I was using shadowsocks, and then I turned it off.

Aah so you had a proxy but hadn't got the environment variables for it. I understand, okay thanks.

@kinnison shadowsocks is a MITM socket level proxy - https://shadowsocks.org/en/index.html - not an HTTP proxy.

I think this is a case of an attractive-nuisance bug title: its likely that none of the reports are connected, but they all show the same error, so we have a dogpile. I suggest closing this and being super quick about retitling all new reports.

I agree with that, and will close this now. For future download problems, please file new issues with specific titles.

It worked after I disabled network proxy...

Turned off VPN here...

I have strat Tor ( service tor start ) of course after installing the Tor.
Then install Rust.

I'm experiencing this error today. I am not on a VPN nor have a proxy. Curl doesn't seem to have an issue though.

❯ rustup -v check
verbose: read metadata version: '12'
verbose: creating temp file: C:\Users\me\scoop\persist\rustup-msvc\.rustup\tmp\vhidjyjekzmi4ehm_file
verbose: downloading file from: 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256'
verbose: downloading with reqwest
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\me\scoop\persist\rustup-msvc\.rustup\tmp\vhidjyjekzmi4ehm_file'
error: caused by: failed to make network request
error: caused by: https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256: timed out
❯ curl https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256
3e3e5ceacb9fb98d08660fcdc22554a8e074cfce4e94b0eb19b5b261893db71e  channel-rust-stable.toml

@LoZeno It would help if you could get a network trace of what rustup is doing when it times out.

This error started to happen yesterday, on a Linux server behind proxy:

$ rustup update                                                                                                             
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'                                                                             
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to '/rhome/FNORO/.rustup/tmp/_y_ere184wm
ljyms_file'                                                                                                                                     
info: checking for self-updates                                                                                                                 
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/tmp/rustup-updateZ2cEVV/release-stable.toml' 
error: caused by: failed to make network request                                                                                                
error: caused by: error sending request for url (https://static.rust-lang.org/rustup/release-stable.toml): operation timed out                  
error: caused by: operation timed out

@felipenoris In future it's better to open a fresh issue for new problems. In this case though, we're aware there's a bug in the proxy code and we're working on getting a fix out ASAP.

confirmed. same error when the machine is behind a proxy with http_proxy environment var set.

@dzhang-b Please either find an open issue which appears related, or else open a fresh issue with your situation in it. Especially important is to consider the error you get if you specify --verbose when updating; and also the kind of proxy you're trying to use.

@kinnison Sure. I will open a new issue with it.

Was this page helpful?
0 / 5 - 0 ratings