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

error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to [...] #4050

Closed
2 tasks done
ssg47 opened this issue Oct 15, 2024 · 7 comments
Labels

Comments

@ssg47
Copy link

ssg47 commented Oct 15, 2024

Verification

Problem

I'm trying to install on a corporate Windows 10 laptop using the current version of rustup-init.exe which I've just downloaded.

I'm seeing this:

Welcome to Rust!

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

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  C:\Users\my-user-id\.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory is located at:
  C:\Users\my-user-id\.cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:

  C:\Users\my-user-id\.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 (default)
			   profile: default
  modify PATH variable: yes

1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
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\my-user-id\.rustup\tmp\8vozg73cf7ftx94w_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): dns error: No such host is known. (os error 11001): No such host is known. (os error 11001)

Press the Enter key to continue.

Steps

  1. Download rustup-init.exe to my Downloads folder.
  2. Double-click rustup-init.exe to execute.
  3. Select option (1) Proceed with standard installation (default - just press enter)

When I do this, it returns the error within a second.

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup-init 1.27.1 (54dd3d0 2024-04-24)

Installed toolchains

N/a

OS version

Win10 22H2 (OS Build 19045.4894)

@ssg47 ssg47 added the bug label Oct 15, 2024
@ssg47
Copy link
Author

ssg47 commented Oct 15, 2024

I wondered if it might be a proxy server issue. The laptop's proxy server is configured via a PAC file. So, I used:

(Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings' -Name AutoConfigURL).AutoConfigURL

to get the URL to the PAC file. Downloaded it, opened it up in Notepad and found the IP address/Port of one of the proxy servers at the bottom of the file. Opened up PowerShell and ran:

$env:HTTP_PROXY = '12.34.56.78:80'
$env:HTTPS_PROXY = '12.34.56.78:80'

where 12.34.56.7880 was the ipaddress & port from the PAC file. Then, in the same PowerShell, ran:

C:\Users\my-user-id\Downloads\rustup-init.exe

Selected option (1) as before and, this time, it took about 20 seconds to give this output:

[...]
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
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\my-user-id\.rustup\tmp\kzirzmyy2zy5r85o_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): tcp connect error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (os error 10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (os error 10060)

Press the Enter key to continue.

@rami3l
Copy link
Member

rami3l commented Oct 15, 2024

@ssg47 Thanks for filing this issue! Given that there's a download backend change upfront (#3806), are you interested in trying our bleeding-edge build and see if it changes anything? Many thanks in advance! 🙏

@ssg47
Copy link
Author

ssg47 commented Oct 15, 2024

Gladly. Didn't work, though I'm afraid:

info: profile set to 'default'
info: default host triple is x86_64-pc-windows-msvc
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\my-user-id\.rustup\tmp\mikrkozofypyuf79_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): dns error: No such host is known. (os error 11001): No such host is known. (os error 11001)

Press the Enter key to continue.

I think it's failing to authenticate with the proxy server. I guess I'm going to have to get the URL(s) whitelisted (for me, at least). Is there a complete list of URLs anywhere?

@rami3l
Copy link
Member

rami3l commented Oct 16, 2024

error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): dns error: No such host is known. (os error 11001)

@ssg47 The error message is definitely different though, so looks like we're making progress. Is there something wrong with your DNS config?

Is there a complete list of URLs anywhere?

That's subject to change. However, I'm sure that almost all files related to toolchain installation are downloaded from a specific distribution server, so:

pub(crate) fn dist_root_server(process: &Process) -> Result<String> {

has covered most cases. Its default value, of course, is

pub static DEFAULT_DIST_SERVER: &str = "https://static.rust-lang.org";

Also, if it sounds okay to you, you might use unofficial mirrors instead. For example, if you're located in mainland China, the TUNA mirror might be interesting to look at.

@ssg47
Copy link
Author

ssg47 commented Oct 17, 2024

When I raised the ticket, I was in the office. Now, I'm working from home but using the corporate VPN. The proxy is Zscaler (for all locations). I think there is some kind of split/bypass implemented. So, I think, (some) web traffic goes direct, rather then through the VPN and then out.

For completeness, running from a PowerShell window, using the original download, with no proxy environment variables configured, I get this:

error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\my-user-id\.rustup\tmp\kte4_wcsf_al_gbz_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): dns error: No such host is known. (os error 11001): No such host is known. (os error 11001)

The bleeding-edge build also gives:

error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\my-user-id\.rustup\tmp\l131elw4y77zkfxa_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): dns error: No such host is known. (os error 11001): No such host is known. (os error 11001)

Both errors are generated within a second or so.

After configuring

$env:HTTPS_PROXY = '12.34.56.78:80'

where 12.34.56.7880 was the ipaddress & port from the PAC file, the standard build gives:

error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\my-user-id\.rustup\tmp\ygi_q26rvsu6dimw_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): operation timed out

and, likewise, the bleeding edge build gives:

error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\my-user-id\.rustup\tmp\ywd7u703xu1kkpc3_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): operation timed out

As before, both return after around thirty seconds.

You asked about DNS. I can run

Invoke-WebRequest -Method Get -Uri https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256

and get

StatusCode        : 200
StatusDescription : OK
Content           : {53, 53, 57, 54...}
RawContent        : HTTP/1.1 200 OK
    etc...

so I think DNS is fine. [I'm not in mainland China.] I'll request https://static.rust-lang.org is whitelisted. I wonder how long that will take...

@ssg47
Copy link
Author

ssg47 commented Nov 5, 2024

The networking team came back to me after eight (8) days and said I'd used the wrong form! So, I filled out the right one, and waited some more.

Then they said, 'Your application is not using the system proxy settings. It needs to be fixed. Nothing can be downloaded without going through the proxy server.

@ssg47
Copy link
Author

ssg47 commented Nov 5, 2024

Never mind. They found a different proxy server url with an obscure port (not 80, not 443, not 8080 or any of the other ones you see used elsewhere) and it worked [sigh].

@ssg47 ssg47 closed this as completed Nov 5, 2024
@rami3l rami3l reopened this Nov 5, 2024
@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants