Open ssg47 opened 5 days ago
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.
@ssg47 Thanks for filing this issue! Given that there's a download backend change upfront (https://github.com/rust-lang/rustup/issues/3806), are you interested in trying our bleeding-edge build and see if it changes anything? Many thanks in advance! 🙏
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?
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:
https://github.com/rust-lang/rustup/blob/3db381b0bec0f8f36351d431aae723654e4261ae/src/config.rs#L961
has covered most cases. Its default value, of course, is
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.
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...
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:
Steps
rustup-init.exe
to my Downloads folder.rustup-init.exe
to execute.(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 (54dd3d00f 2024-04-24)
Installed toolchains
N/a
OS version
Win10 22H2 (OS Build 19045.4894)