dotnet / vscode-dotnet-runtime

VSCode Extension for Installing .NET via VS Code
MIT License
128 stars 229 forks source link

Error acquiring .NET #1741

Open cinquaindev opened 3 months ago

cinquaindev commented 3 months ago

I'm completely new to programming and all that stuff, decided to try it out and donwload VS code. But for some reason I'm stuck with this mistake that says error occured while installing .NET (8.0). I've tried everything at that point. Reinstalled it dozenz of times, but with no avail. Please help me Снимок экрана (10) Снимок экрана (11)

nagilson commented 2 months ago

Hey, welcome and I dont blame you for not knowing where to go next with that error :)

There should be some logs that you got when you hit this issue. May you attach those?
❗ Privacy Alert! The contents in our log files may contain personal data. Prior to posting to GitHub, please remove any personal data which should not be publicly viewable. https://privacy.microsoft.com/en-US/privacystatement

Please attach log file(s) here if you have any. Our log files are located alongside VS Code logs. If you want to find them manually, navigate here: Linux: ~/.config/Code/logs Mac: ~/Library/Application Support/Code/logs/ Windows: c:\Users\USER\AppData\Roaming\Code\logs\

Then find the folder created at the time you experienced the bug in the logs folder. From there, go to window1 -> exthost -> ms-dotnettools.vscode-dotnet-runtime. The log file should be located in this folder.

Note: The window folder may change depending on how many VS Code windows you have open; if our extension is running in the 2nd window, it'd be in a folder called window2.

krilek commented 2 months ago
Checking if system is WSL. OS: win32

4/10/2024, 1:45:06 PM DotnetAcquisitionStatusRequested
8.0
15eb59019e4eb18477aa8e5406bbf28c22b09cc1ff36d936a31726743566167b

4/10/2024, 1:45:06 PM DotnetAcquisitionStatusRequested
8.0
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:06 PM DotnetAcquisitionStatusRequested
8.0
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:06 PM WebRequestSent
https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

4/10/2024, 1:45:06 PM WebRequestSent
https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

4/10/2024, 1:45:06 PM WebRequestSent
https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

4/10/2024, 1:45:08 PM DotnetVersionResolutionCompleted
8.0
8.0.4

4/10/2024, 1:45:08 PM DotnetAcquisitionStatusUndefined
8.0.4~x64

4/10/2024, 1:45:08 PM DotnetCommandSucceeded
acquireRuntimeStatus

4/10/2024, 1:45:08 PM DotnetVersionResolutionCompleted
8.0
8.0.4

4/10/2024, 1:45:08 PM DotnetVersionResolutionCompleted
8.0
8.0.4

4/10/2024, 1:45:08 PM DotnetAcquisitionStatusUndefined
8.0.4~x64

4/10/2024, 1:45:08 PM DotnetAcquisitionStatusUndefined
8.0.4~x64

4/10/2024, 1:45:08 PM DotnetRuntimeAcquisitionStarted
15eb59019e4eb18477aa8e5406bbf28c22b09cc1ff36d936a31726743566167b

4/10/2024, 1:45:08 PM DotnetAcquisitionRequested
8.0
15eb59019e4eb18477aa8e5406bbf28c22b09cc1ff36d936a31726743566167b

4/10/2024, 1:45:08 PM DotnetCommandSucceeded
acquireRuntimeStatus

4/10/2024, 1:45:08 PM DotnetCommandSucceeded
acquireRuntimeStatus

4/10/2024, 1:45:08 PM DotnetRuntimeAcquisitionStarted
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM DotnetAcquisitionRequested
8.0
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM DotnetRuntimeAcquisitionStarted
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM DotnetAcquisitionRequested
8.0
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM WebRequestSent
https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

4/10/2024, 1:45:08 PM DotnetVersionResolutionCompleted
8.0
8.0.4

4/10/2024, 1:45:08 PM DotnetInstallKeyCreatedEvent
The requested version 8.0.4 is now marked under the install key: 8.0.4~x64.

4/10/2024, 1:45:08 PM WebRequestSent
https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

4/10/2024, 1:45:08 PM DotnetVersionResolutionCompleted
8.0
8.0.4

4/10/2024, 1:45:08 PM DotnetInstallKeyCreatedEvent
The requested version 8.0.4 is now marked under the install key: 8.0.4~x64.

4/10/2024, 1:45:08 PM DotnetAcquisitionInProgress
8.0.4~x64
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM WebRequestSent
https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

4/10/2024, 1:45:08 PM DotnetVersionResolutionCompleted
8.0
8.0.4

4/10/2024, 1:45:08 PM DotnetInstallKeyCreatedEvent
The requested version 8.0.4 is now marked under the install key: 8.0.4~x64.

4/10/2024, 1:45:08 PM DotnetAcquisitionInProgress
8.0.4~x64
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM DotnetAcquisitionStarted
8.0.4~x64
8.0.4
3445ca21a214ca714b56fae55cefb76f78d2a37fa091e8e537a2e0ecca3f3e12

4/10/2024, 1:45:08 PM WebRequestSent
https://dot.net/v1/dotnet-install.ps1

4/10/2024, 1:45:10 PM DotnetFileWriteRequestEvent
Request to write
2024-04-10T11:45:10.976Z
7eed42510171a0e58454cf4cc0ad44938fac793f15537b23074bde0c8e6e768e

4/10/2024, 1:45:10 PM DotnetLockAttemptingAcquireEvent
Lock Acquisition request to begin.
2024-04-10T11:45:10.978Z
111d84c3090c566350b653310429c421e152f7b103c11a23513d744499e9ea19
7eed42510171a0e58454cf4cc0ad44938fac793f15537b23074bde0c8e6e768e

4/10/2024, 1:45:10 PM DotnetLockAcquiredEvent
Lock Acquired.
2024-04-10T11:45:10.985Z
111d84c3090c566350b653310429c421e152f7b103c11a23513d744499e9ea19
7eed42510171a0e58454cf4cc0ad44938fac793f15537b23074bde0c8e6e768e

4/10/2024, 1:45:10 PM DotnetFileWriteRequestEvent
File content is an exact match, not writing file.
2024-04-10T11:45:10.987Z
7eed42510171a0e58454cf4cc0ad44938fac793f15537b23074bde0c8e6e768e

4/10/2024, 1:45:10 PM DotnetLockReleasedEvent
Lock about to be released.
2024-04-10T11:45:10.988Z
111d84c3090c566350b653310429c421e152f7b103c11a23513d744499e9ea19
7eed42510171a0e58454cf4cc0ad44938fac793f15537b23074bde0c8e6e768e

4/10/2024, 1:45:10 PM DotnetInstallScriptAcquisitionCompleted

4/10/2024, 1:45:10 PM CommandExecutionEvent
Executing command powershell.exe
with options [object Object].

4/10/2024, 1:45:12 PM CommandExecutionStatusEvent
The command powershell.exe  exited
with status: 0.

4/10/2024, 1:45:12 PM DotnetAlternativeCommandFoundEvent
The command powershell.exe was found.

4/10/2024, 1:45:15 PM DotnetAcquisitionCompleted
8.0.4~x64
8.0.4
c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe

4/10/2024, 1:45:15 PM DotnetInstallationValidationError
Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
8.0.4~x64
Error
Error: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
    at assertOrThrowError (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:29:93)
    at a.validateDotnetInstall (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:18:18)
    at h.next (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:222:48)
    at Generator.next (<anonymous>)
    at s (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
8.0.4~x64\shared
8.0.4~x64\ThirdPartyNotices.txt
8.0.4~x64\shared\Microsoft.NETCore.App

4/10/2024, 1:45:15 PM DotnetCommandFailed
.NET Acquisition Failed: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
acquire
Error
Error: .NET Acquisition Failed: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
    at assertOrThrowError (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:30:19)
    at a.validateDotnetInstall (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:18:18)
    at h.next (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:222:48)
    at Generator.next (<anonymous>)
    at s (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
8.0

4/10/2024, 1:45:15 PM DotnetCommandFailed
.NET Acquisition Failed: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
acquire
Error
Error: .NET Acquisition Failed: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
    at assertOrThrowError (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:30:19)
    at a.validateDotnetInstall (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:18:18)
    at h.next (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:222:48)
    at Generator.next (<anonymous>)
    at s (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
8.0

4/10/2024, 1:45:15 PM DotnetCommandFailed
.NET Acquisition Failed: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
acquire
Error
Error: .NET Acquisition Failed: Validation of .dotnet installation for version 8.0.4~x64 failed: Expected executable does not exist at "c:\Users\User\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\8.0.4~x64\dotnet.exe"
    at assertOrThrowError (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:30:19)
    at a.validateDotnetInstall (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\InstallationValidator.js:18:18)
    at h.next (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:222:48)
    at Generator.next (<anonymous>)
    at s (c:\Users\User\.vscode\extensions\vscode-dotnet-runtime-library\dist\Acquisition\DotnetCoreAcquisitionWorker.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
8.0
nagilson commented 2 months ago

Thank you.

It looks like the install script succeeded but some of the files are not there. We saw this issue elsewhere recently. @dotnet/install-scripts-admin, is there anything we can collect from here to further determine the cause of failure?

f-alizada commented 2 months ago

@cinquaindev, @krilek Thank you for reporting the issue and sharing the logs!

The logs that are shared are part of the vscode-dotnet-runtime, however the logs from the actual dotnet-install script are missing, is there any chance to share the logs generated from the dotnet-install scripts itself (if any)?

To help us narrow down the problem is there a chance:

@nagilson looking at the code: https://github.com/dotnet/vscode-dotnet-runtime/blob/f6648e7302c084d47fea2d67820d719e48ed849a/vscode-dotnet-runtime-library/src/Acquisition/AcquisitionInvoker.ts#L117C5-L136C1 install scripts are invoked with Verbose parameter, which are not the part of logs shared, does it mean that the output of the script was not captured?

Thank you in advance!

nagilson commented 2 months ago

@f-alizada You are looking at the right file ;) Reading that further, we always record the stderr from the install scripts in our own log files. We only record the stdout during the following condition:

When running the install script: The process could not be spawned. The process could not be killed. Sending a message to the child process failed. The child process was aborted via the signal option.

Perhaps we should change that to always record the stdout? Is that what you were looking for? Does dotnet-install produce its own logs, and if so where are they stored so the customer can post them?

f-alizada commented 2 months ago

Perhaps we should change that to always record the stdout? Is that what you were looking for? Does dotnet-install produce its own logs, and if so where are they stored so the customer can post them?

@nagilson thank you for looking into that. install scripts do not store any logs on the machine, however when invoked with parameter Verbose: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script additionally to the logs from the process it displays the diagnostic logs too.

Examples

Process logs

.\dotnet-install.ps1 -InstallDir ./test-dotnet

dotnet-install: Downloaded file https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.204/dotnet-sdk-8.0.204-win-x64.zip size is 294676060 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Extracting the archive.
dotnet-install: Adding to current process PATH: "somepath". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 8.0.204
dotnet-install: Installation finished

Process logs + Verbose

.\dotnet-install.ps1 -Verbose -InstallDir ./test-dotnet

VERBOSE: dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
VERBOSE: dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
VERBOSE: 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.
VERBOSE: dotnet-install: Get-CLIArchitecture-From-Architecture -Architecture "<auto>"
VERBOSE: dotnet-install: Get-Machine-Architecture
VERBOSE: Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' =
root\cimv2,'className' = CIM_OperatingSystem'.
VERBOSE: Operation 'Enumerate CimInstances' complete.
VERBOSE: dotnet-install: Get-NormalizedQuality -Quality ""
VERBOSE: dotnet-install: Normalized quality: ''
VERBOSE: dotnet-install: Get-NormalizedChannel -Channel "LTS"
...
...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 8.0.204
dotnet-install: Installation finished

It would be very helpful for us to understand the problem if the logs from the install scripts are attached in case of failed installation/ failed verification of installation. @baronfel Is there any objections on storing the regular logs if the installation/acquisition fails?

ducksauz commented 2 months ago

The install script is also failing to update .net to 8.0.4 now as well.

An error occurred while installing .NET (8.0): .NET Acquisition Failed: Installation failed: Error: Command failed: "/Users/john/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.3/dist/install scripts/dotnet-install.sh" -InstallDir "/Users/john/Library/Application Support/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.4~arm64" -Version 8.0.4 -Verbose -Runtime dotnet -Architecture arm64 dotnet_install: Error: Could not find `.NET Core Runtime` with version = 8.0.4 dotnet_install: Error: Refer to: https://aka.ms/dotnet-os-lifecycle for information on .NET Core support
f-alizada commented 2 months ago

@ducksauz Thank you for reporting! could you please let us know if it is reproducible when you run dotnet-install script: https://learn.microsoft.com/dotnet/core/tools/dotnet-install-script? I just tried to install the 8.0.4 and didn't face issues on unix + windows. Will it be possible also to share the logs of the failed update? Thank you in advance!

ducksauz commented 2 months ago

I'm on macOS, and that error was from within VSCode as it was trying to update from 8.0.3 to 8.0.4.

I was able to install from the CLI with the dotnet-install.sh script, but you probably want to take a look at the VSCode integration on macOS. Here's my successful install from the CLI

$ bash dotnet-install.sh --runtime dotnet
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Runtime/8.0.4/dotnet-runtime-8.0.4-osx-arm64.tar.gz
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Runtime/8.0.4/dotnet-runtime-8.0.4-osx-arm64.tar.gz size is 29119888 bytes.
dotnet-install: Extracting archive from https://dotnetcli.azureedge.net/dotnet/Runtime/8.0.4/dotnet-runtime-8.0.4-osx-arm64.tar.gz
dotnet-install: Downloaded file size is 29119888 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 8.0.4
dotnet-install: Adding to current process PATH: `/Users/john/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
nagilson commented 2 months ago

Perhaps we should change that to always record the stdout? Is that what you were looking for? Does dotnet-install produce its own logs, and if so where are they stored so the customer can post them?

@nagilson thank you for looking into that. install scripts do not store any logs on the machine, however when invoked with parameter Verbose: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script additionally to the logs from the process it displays the diagnostic logs too.

Examples

Process logs

.\dotnet-install.ps1 -InstallDir ./test-dotnet

dotnet-install: Downloaded file https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.204/dotnet-sdk-8.0.204-win-x64.zip size is 294676060 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Extracting the archive.
dotnet-install: Adding to current process PATH: "somepath". Note: This change will not be visible if PowerShell was run as a child process.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 8.0.204
dotnet-install: Installation finished

Process logs + Verbose

.\dotnet-install.ps1 -Verbose -InstallDir ./test-dotnet

VERBOSE: dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
VERBOSE: dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
VERBOSE: 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.
VERBOSE: dotnet-install: Get-CLIArchitecture-From-Architecture -Architecture "<auto>"
VERBOSE: dotnet-install: Get-Machine-Architecture
VERBOSE: Perform operation 'Enumerate CimInstances' with following parameters, ''namespaceName' =
root\cimv2,'className' = CIM_OperatingSystem'.
VERBOSE: Operation 'Enumerate CimInstances' complete.
VERBOSE: dotnet-install: Get-NormalizedQuality -Quality ""
VERBOSE: dotnet-install: Normalized quality: ''
VERBOSE: dotnet-install: Get-NormalizedChannel -Channel "LTS"
...
...
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies
dotnet-install: Installed version is 8.0.204
dotnet-install: Installation finished

It would be very helpful for us to understand the problem if the logs from the install scripts are attached in case of failed installation/ failed verification of installation. @baronfel Is there any objections on storing the regular logs if the installation/acquisition fails?

FYI for the next release we will always capture this information in error logs.