microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
229 stars 12 forks source link

[BUG] When used in Chinese Mainland, the download of runtime always fails. What is the situation #186

Closed dodu2014 closed 1 year ago

dodu2014 commented 1 year ago

Describe the Issue

image

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

timheuer commented 1 year ago

/cc @nagilson

sharpchen commented 1 year ago

please try using a global proxy.

nagilson commented 1 year ago

Based on my cursory research, it does seem that mainland china does block a lot of microsoft websites. Though Id be surprised if dot.net/v1/dotnet-install.sh is blocked. @dodu2014 can you access this site? I'm not really sure what we can do if the website to download .NET Is blocked besides suggest that you use a VPN, unfortunately. @marcpopMSFT Do we have any policy or additional support we can provide for this? Or any contacts that might know more about what .NET access in china looks like?

marcpopMSFT commented 1 year ago

This is a release team question. I'd check with @leecow offline.

dodu2014 commented 1 year ago

@nagilson https://dot.net/v1/dotnet-install.sh https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh This is accessible.

timheuer commented 1 year ago

Hi @dodu2014 thank you for reporting this. We are investigating with our content delivery team. You have indicated that the scripts are accessible. Can you download the script at https://dot.net/v1/dotnet-install.ps1 and then execute it from a terminal?

(from downloaded location):

.\dotnet-install.ps1 -Channel STS 

And tell us here if this succeeds? If it fails can you please run:

.\dotnet-install.ps1 -Channel STS -DryRun

and report the output back here?

donJoseLuis commented 1 year ago

Greetings, the steps that Tim mentioned are useful (thanks @timheuer )

dodu2014 commented 1 year ago

@timheuer image Is this normal ?

rbhanda commented 1 year ago

Hi @dodu2014 I followed up with our team, it seems there was transient spike in the unavailability but that has recovered now. Just to ensure that this indeed matches, can I get the timestamp of exactly when we started to see this issue

timheuer commented 1 year ago

@timheuer image Is this normal ?

Use an admin prompt. That is normal if you don’t have execution policy set (which is typical).

donJoseLuis commented 1 year ago

Greetings @dodu2014 ,

  1. do try to trigger a CMD console as ADMIN as @timheuer suggested
  2. If does not succeed, can you please ping dotnetcli.azureedge.net & tell us the result.
donJoseLuis commented 1 year ago

I translated the error @dodu2014 reported

"Unable to load the file D:\dodu\downloads\dotnet_install.ps1. An unauthorized user or process may have changed the contents of the file D:\dodu\downloads\dotnet_install.ps1 because the file's hash does not match the hash stored in the digital signature. The script cannot be run on the specified system. For more information, please run Get-Help about_Signing."

:: @dodu2014 - can you please acquire https://dot.net/v1/dotnet-install.ps1 and try with that script?

The ticket has tracked 2 separate issues...

  1. Originally, requests to blob storage were timing out, however the script was launching.
  2. Later in the ticket, the script fails to launch due to the above mentioned signing issue (@dodu2014, what changed with respect to the scripts?).
dodu2014 commented 1 year ago

@donJoseLuis image

dotnet-install.ps1 The file can be downloaded correctly and has not been edited. When executing, there is a prompt: because the hash of the file does not match the hash stored in the digital signature. The script cannot be run on the specified system.

dodu2014 commented 1 year ago

@timheuer image Is this normal ?

Use an admin prompt. That is normal if you don’t have execution policy set (which is typical).

It is already in administrator mode @timheuer

PS D:\dodu\downloads> Get-ExecutionPolicy
RemoteSigned
donJoseLuis commented 1 year ago

@dodu2014 Thank you for meticulously trying each recommended step.

:: Can you please acquire https://dot.net/v1/dotnet-install.ps1 and try with that script?

The ticket has tracked 2 separate issues...

  1. Originally, requests to blob storage were timing out, however the script was launching.
  2. Later in the ticket, the script fails to launch due to the above mentioned signing issue (@dodu2014, what changed with respect to the scripts?).
dodu2014 commented 1 year ago

@donJoseLuis

image

I changed the execution policy using the Set ExecutionPolicy command, and now the execution of this script has been in this state. Is this normal?

YuliiaKovalova commented 1 year ago

@donJoseLuis

image

I changed the execution policy using the Set ExecutionPolicy command, and now the execution of this script has been in this state. Is this normal?

Hi @dodu2014,

On the screenshot, I don't see any errors or warnings in the output. Does it run normally?

dodu2014 commented 1 year ago

There was no response after execution, waiting for a long time

YuliiaKovalova commented 1 year ago

@dodu2014 , after applying policy changes did you reload the terminal? Also, could you run the command again with -Verbose specified and paste the output? e.g. .\dotnet-install.ps1 -Channel sts -Verbose

donJoseLuis commented 1 year ago

@dodu2014 in addition to Yuliia's tip, what was the outcome of the execution? Did it just hang?

dodu2014 commented 1 year ago

I'll record a video for you to see

https://dv.kejiajia.net/dotnet-install.mp4

donJoseLuis commented 1 year ago

thank you @dodu2014 , please add the verbose flat (-verbose) as Yuliia recommended. We'd like to see exactly at what step the script is hanging.

dodu2014 commented 1 year ago
PS D:\dodu\downloads> .\dotnet-install.ps1 -Channel sts -Verbose
详细信息: dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios,
where:
详细信息: dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
详细信息: dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
详细信息: dotnet-install: To set up a development environment or to run apps, use installers rather than this script.
Visit https://dotnet.microsoft.com/download to get the installer.
详细信息: dotnet-install: Get-CLIArchitecture-From-Architecture -Architecture "<auto>"
详细信息: dotnet-install: Get-Machine-Architecture
详细信息: 执行带有以下参数的操作“枚举 CimInstance”:“'namespaceName' = root\cimv2,'className' =
CIM_OperatingSystem”。
详细信息: 完成操作“枚举 CimInstance”。
详细信息: dotnet-install: Get-NormalizedQuality -Quality ""
详细信息: dotnet-install: Normalized quality: ''
详细信息: dotnet-install: Get-NormalizedChannel -Channel "sts"
详细信息: dotnet-install: Normalized channel: 'STS'
详细信息: dotnet-install: Get-NormalizedProduct -Runtime ""
详细信息: dotnet-install: Normalized product: 'dotnet-sdk'
详细信息: dotnet-install: 鈴?Action 'Product discovery' took 0.1663521 seconds
详细信息: dotnet-install: Resolve-Installation-Path -InstallDir "<auto>"
详细信息: dotnet-install: Get-User-Share-Path
详细信息: dotnet-install: InstallRoot: C:\Users\dodu\AppData\Local\Microsoft\dotnet
详细信息: dotnet-install: Get-AkaMSDownloadLink -Channel "STS" -Quality "" -Internal "False" -Product "dotnet-sdk"
-Architecture "x64"
详细信息: dotnet-install: Retrieving primary payload URL from aka.ms link for channel: 'STS', quality: '' product:
'dotnet-sdk', os: 'win', architecture: 'x64'.
详细信息: dotnet-install: Constructed aka.ms link: 'https://aka.ms/dotnet/STS/dotnet-sdk-win-x64.zip'.
详细信息: dotnet-install: Received response:
StatusCode: 301, ReasonPhrase: 'Moved Permanently', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Request-Context: appId=cid-v1:26ef1154-5995-4d24-ad78-ef0b04f11587
  X-Response-Cache-Status: True
  Pragma: no-cache
  Connection: keep-alive
  Strict-Transport-Security: max-age=31536000 ; includeSubDomains
  Cache-Control: no-store, no-cache, max-age=0
  Date: Fri, 30 Jun 2023 09:20:30 GMT
  Location: https://aka.ms/dotnet/7.0/dotnet-sdk-win-x64.zip
  Server: Kestrel
  Content-Length: 0
  Expires: Fri, 30 Jun 2023 09:20:30 GMT
}
详细信息: dotnet-install: The redirect location retrieved: 'https://aka.ms/dotnet/7.0/dotnet-sdk-win-x64.zip'.
详细信息: dotnet-install: Received response:
StatusCode: 301, ReasonPhrase: 'Moved Permanently', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Request-Context: appId=cid-v1:b47e5e27-bf85-45ba-a97c-0377ce0e5779
  X-Response-Cache-Status: True
  Pragma: no-cache
  Connection: keep-alive
  Strict-Transport-Security: max-age=31536000 ; includeSubDomains
  Cache-Control: no-store, no-cache, max-age=0
  Date: Fri, 30 Jun 2023 09:20:30 GMT
  Location: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip
  Server: Kestrel
  Content-Length: 0
  Expires: Fri, 30 Jun 2023 09:20:30 GMT
}
详细信息: dotnet-install: The redirect location retrieved:
'https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip'.
donJoseLuis commented 1 year ago

Summarizing progress of the investigation (thank you @dodu2014 for following our tasks)

  1. The signing issue was overcome.
  2. The script hangs retrieving 'https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip', the current STS channel (per the verbose dump)
  3. @dodu2014 previously confirmed his agent could ping CLI blob storage

This aligns to the current issues under investigation consisting of:

  1. slow down from CDN

While we await resolution to the above networking problem, would you try this....? ps> .\dotnet-install.ps1 -Channel STS -Verbose -NoCdn

YuliiaKovalova commented 1 year ago

@dodu2014 , what happens if you try to paste the link in your browser? Is the dotnet-sdk-7.0.305-win-x64.zip file downloaded successfully? https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip

dodu2014 commented 1 year ago
PS D:\dodu\downloads> .\dotnet-install.ps1 -Channel STS -Verbose -NoCdn
详细信息: dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios,
where:
详细信息: dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
详细信息: dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
详细信息: dotnet-install: To set up a development environment or to run apps, use installers rather than this script.
Visit https://dotnet.microsoft.com/download to get the installer.
详细信息: dotnet-install: Get-CLIArchitecture-From-Architecture -Architecture "<auto>"
详细信息: dotnet-install: Get-Machine-Architecture
详细信息: 执行带有以下参数的操作“枚举 CimInstance”:“'namespaceName' = root\cimv2,'className' =
CIM_OperatingSystem”。
详细信息: 完成操作“枚举 CimInstance”。
详细信息: dotnet-install: Get-NormalizedQuality -Quality ""
详细信息: dotnet-install: Normalized quality: ''
详细信息: dotnet-install: Get-NormalizedChannel -Channel "STS"
详细信息: dotnet-install: Normalized channel: 'STS'
详细信息: dotnet-install: Get-NormalizedProduct -Runtime ""
详细信息: dotnet-install: Normalized product: 'dotnet-sdk'
详细信息: dotnet-install: 鈴?Action 'Product discovery' took 0.1831191 seconds
详细信息: dotnet-install: Resolve-Installation-Path -InstallDir "<auto>"
详细信息: dotnet-install: Get-User-Share-Path
详细信息: dotnet-install: InstallRoot: C:\Users\dodu\AppData\Local\Microsoft\dotnet
详细信息: dotnet-install: Get-AkaMSDownloadLink -Channel "STS" -Quality "" -Internal "False" -Product "dotnet-sdk"
-Architecture "x64"
详细信息: dotnet-install: Retrieving primary payload URL from aka.ms link for channel: 'STS', quality: '' product:
'dotnet-sdk', os: 'win', architecture: 'x64'.
详细信息: dotnet-install: Constructed aka.ms link: 'https://aka.ms/dotnet/STS/dotnet-sdk-win-x64.zip'.
详细信息: dotnet-install: Received response:
StatusCode: 301, ReasonPhrase: 'Moved Permanently', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Request-Context: appId=cid-v1:7d63747b-487e-492a-872d-762362f77974
  X-Response-Cache-Status: True
  Pragma: no-cache
  Connection: keep-alive
  Strict-Transport-Security: max-age=31536000 ; includeSubDomains
  Cache-Control: no-store, no-cache, max-age=0
  Date: Fri, 30 Jun 2023 09:32:57 GMT
  Location: https://aka.ms/dotnet/7.0/dotnet-sdk-win-x64.zip
  Server: Kestrel
  Content-Length: 0
  Expires: Fri, 30 Jun 2023 09:32:57 GMT
}
详细信息: dotnet-install: The redirect location retrieved: 'https://aka.ms/dotnet/7.0/dotnet-sdk-win-x64.zip'.
详细信息: dotnet-install: Received response:
StatusCode: 301, ReasonPhrase: 'Moved Permanently', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Request-Context: appId=cid-v1:9b037ab9-fa5a-4c09-81bd-41ffa859f01e
  X-Response-Cache-Status: True
  Pragma: no-cache
  Connection: keep-alive
  Strict-Transport-Security: max-age=31536000 ; includeSubDomains
  Cache-Control: no-store, no-cache, max-age=0
  Date: Fri, 30 Jun 2023 09:32:57 GMT
  Location: https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip
  Server: Kestrel
  Content-Length: 0
  Expires: Fri, 30 Jun 2023 09:32:57 GMT
}
详细信息: dotnet-install: The redirect location retrieved:
'https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip'.
详细信息: dotnet-install: Received response:
StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Age: 21343
  X-Cache: HIT
  x-ms-blob-type: BlockBlob
  x-ms-lease-status: unlocked
  x-ms-request-id: 5b436a03-401e-0089-2804-ab814d000000
  x-ms-version: 2009-09-19
  Accept-Ranges: bytes
  Date: Fri, 30 Jun 2023 09:32:59 GMT
  ETag: 0x8DB734A624AAD23
  Server: ECAcc
  Server: (hkc/BD05)
  Content-Length: 272526932
  Content-Type: application/octet-stream
  Last-Modified: Thu, 22 Jun 2023 17:59:11 GMT
}
详细信息: dotnet-install: Retrieved primary named payload URL from aka.ms link:
'https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip'.
详细信息: dotnet-install: Downloading using legacy url will not be attempted.
详细信息: dotnet-install: Version: '7.0.305'.
详细信息: dotnet-install: Get-Product-Version -SpecificVersion "7.0.305" -PackageDownloadLink
"https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip"
详细信息: dotnet-install: Get-Product-Version-Url -Flattened "True" -AzureFeed "" -SpecificVersion "7.0.305"
-PackageDownloadLink "https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip"
详细信息: dotnet-install: Constructed productVersion link:
https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/sdk-productVersion.txt
详细信息: dotnet-install: Get-Product-Version-Url -Flattened "False" -AzureFeed "" -SpecificVersion "7.0.305"
-PackageDownloadLink "https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip"
详细信息: dotnet-install: Constructed productVersion link:
https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/productVersion.txt
详细信息: dotnet-install: Checking for the existence of
https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/sdk-productVersion.txt
详细信息: dotnet-install: Product version: '7.0.305'.
详细信息: dotnet-install: Generated aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip with version 7.0.305
详细信息: dotnet-install: Checking if the version 7.0.305 is already installed
详细信息: dotnet-install: Is-Dotnet-Package-Installed -InstallRoot "C:\Users\dodu\AppData\Local\Microsoft\dotnet" -RelativePathToPackage "sdk" -SpecificVersion "7.0.305"
详细信息: dotnet-install: Is-Dotnet-Package-Installed: DotnetPackagePath=C:\Users\dodu\AppData\Local\Microsoft\dotnet\sdk\7.0.305
详细信息: 执行带有以下参数的操作“查询 CimInstance”:“'queryExpression' = SELECT * FROM Win32_LogicalDisk WHERE DeviceId='C:','queryDialect' = WQL,'namespaceName' = root\cimv2”。
详细信息: 完成操作“查询 CimInstance”。
详细信息: dotnet-install: 鈴?Action 'Installation directory preparation' took 0.0609787 seconds
详细信息: dotnet-install: Zip path: C:\Users\dodu\AppData\Local\Temp\spn1irom.2fz
详细信息: dotnet-install: Downloading "aka.ms" link https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip

https://dotnetcli.azureedge.net/dotnet/Sdk/7.0.305/dotnet-sdk-7.0.305-win-x64.zip

This link is unstable and often unavailable

donJoseLuis commented 1 year ago

@dodu2014 thank you again.

dodu2014 commented 1 year ago

ok, thank you very much, thank you all for your hard work. Salute

timheuer commented 1 year ago

Hi @dodu2014 we believe the network aspects have been resolved. Can you confirm if you are still seeing any of this issue recently? If not, we'll close this out. /cc @donJoseLuis

dodu2014 commented 1 year ago

@timheuer Update the kit to 0.3.5 pre, but the result is still the same 😒😒

9861207690da4348b31584d1d7a417f

timheuer commented 1 year ago

Thanks @dodu2014 - out of curiousity if you go to https://dot.net/downloads and download an SDK or runtime there does it work for you?

dodu2014 commented 1 year ago

SDK has already been installed on this PC, but there will still be a prompt in vscode to download and install runtime

image

dodu2014 commented 1 year ago

@timheuer Although such errors occur, they do not affect compilation and debugging, But there is no intelligent prompt during encoding. The temporary solution is to disable the dev kit and restore the c # extension to the released version

dodu2014 commented 1 year ago

@timheuer @donJoseLuis @YuliiaKovalova

C#:v2.0.320 C# Dev Kit:v0.3.21

The newly updated version has now resolved the entire issue. Thank you very much for the team's efforts, Good job!