dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

Workload Garbage Collections fails after version change #17325

Closed lewing closed 3 years ago

lewing commented 3 years ago

The reproduction steps are kind of exceptional but the error looks real

Testing against 6.0.100-preview.4.21229.17 if I run ' dotnet workload install microsoft-net-sdk-blazorwebassembly-aot' with the baseline manifest the install goes fine. If I then edit the manifest and bump the version of a couple of packs to validate changes once the pack install has completed I get an error

 dotnet workload install microsoft-net-sdk-blazorwebassembly-aot                                                                                                                                                                                                                                                            
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.0-dev...                                                                                        
[NuGet Manager] [Info]   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.net.runtime.monoaotcompiler.task/index.json                                   
[NuGet Manager] [Info]   GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/7d9f5c21-0d79-403f-bfe3-9a4506529760/nuget/v3/registrations2-semver2/microsoft.net.runtime.monoaotcompiler.task/index.json                                                                                                     
[NuGet Manager] [Info]   GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/registrations2-semver2/microsoft.net.runtime.monoaotcompiler.task/index.json                                                                                                     
[NuGet Manager] [Info]   GET https://pkgs.dev.azure.com/azure-public/3ccf6661-f8ce-4e8a-bb2e-eff943ddd3c7/_packaging/be90bfa8-5c00-452b-ba9f-226ce4366992/nuget/v3/registrations2-semver2/microsoft.net.runtime.monoaotcompiler.task/index.json                                                                                               Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.0-dev...                                                          Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk version 6.0.0-dev...                                                                                             
[NuGet Manager] [Info]   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.net.runtime.webassembly.sdk/index.json                                        
[NuGet Manager] [Info]   GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/7d9f5c21-0d79-403f-bfe3-9a4506529760/nuget/v3/registrations2-semver2/microsoft.net.runtime.webassembly.sdk/index.json                                                                                                          
[NuGet Manager] [Info]   GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/825db618-e3eb-4426-ba54-b1d6e6c944d8/nuget/v3/registrations2-semver2/microsoft.net.runtime.webassembly.sdk/index.json                                                                                                          
[NuGet Manager] [Info]   GET https://pkgs.dev.azure.com/azure-public/3ccf6661-f8ce-4e8a-bb2e-eff943ddd3c7/_packaging/be90bfa8-5c00-452b-ba9f-226ce4366992/nuget/v3/registrations2-semver2/microsoft.net.runtime.webassembly.sdk/index.json                                                                                                    
Writing workload pack installation record for Microsoft.NET.Runtime.WebAssembly.Sdk version 6.0.0-dev...                                                               
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm version 6.0.0-preview.4.21222.10...                                                               
Pack Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm version 6.0.0-preview.4.21222.10 is already installed.                                                       
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.browser-wasm version 6.0.0-
preview.4.21222.10...                                 
Installing pack Microsoft.NET.Runtime.Emscripten.Node version 6.0.0-
preview.4.21220.1...                                                                               
Pack Microsoft.NET.Runtime.Emscripten.Node version 
6.0.0-preview.4.21220.1 is already installed.                                                                       
Writing workload pack installation 
record for Microsoft.NET.Runtime.Emscripten.Node version 6.0.0-preview.4.21220.1...                                                 
Installing pack Microsoft.NET.Runtime.Emscripten.Python version 6.0.0-preview.4.21220.1...                                                                             
Pack Microsoft.NET.Runtime.Emscripten.Python version 6.0.0-preview.4.21220.1 is already installed.                                                                     
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Python version 6.0.0-preview.4.21220.1...                                               
Installing pack Microsoft.NET.Runtime.Emscripten.Sdk version 6.0.0-preview.4.21220.1...                                                                                
Pack Microsoft.NET.Runtime.Emscripten.Sdk version 6.0.0-preview.4.21220.1 is already installed.                                                                        
Writing workload pack installation record for Microsoft.NET.Runtime.Emscripten.Sdk version 6.0.0-preview.4.21220.1...                                                  
Garbage collecting for SDK feature bands 6.0.100...                                                                                                                    
System.NullReferenceException: Object reference not set to an instance of an object.                                                                                      
at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.IsSingleFilePack(PackInfo packInfo) in dotnet.dll:token 0x60001c9+0x0                            
at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.PackIsInstalled(PackInfo packInfo) in dotnet.dll:token 0x60001c3+0x0                             
at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.DeletePack(PackInfo packInfo) in dotnet.dll:token 0x60001c4+0x0                                  
at Microsoft.DotNet.Workloads.Workload.Install.NetSdkManagedInstaller.GarbageCollectInstalledWorkloadPacks() in dotnet.dll:token 0x60001c0+0x151                       
at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.InstallWorkloads(IEnumerable`1 workloadIds, Boolean skipManifestUpdate) in dotnet.dll:token 0x60001ce+0x81                                                                                                                                                              
at Microsoft.DotNet.Workloads.Workload.Install.WorkloadInstallCommand.Execute() in dotnet.dll:token 0x60001cb+0x216                                                    
at Microsoft.DotNet.Cli.DotNetTopLevelCommandBase.RunCommand(String[] args) in dotnet.dll:token 0x60008ac+0x5e                                                         
at Microsoft.DotNet.Workloads.Workload.WorkloadCommand.Run(String[] args) in dotnet.dll:token 0x6000145+0x6                                                            
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient) in dotnet.dll:token 0x6000915+0x2e8                       
at Microsoft.DotNet.Cli.Program.Main(String[] args) in dotnet.dll:token 0x6000913+0x6f      
dotnet-issue-labeler[bot] commented 3 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

sfoslund commented 3 years ago

This looks like a dup of one that @jonathanpeppers found, which only reproed when he manually edited the manifest file. Can you provide the changes you made to the manifest so I can repro?

jonathanpeppers commented 3 years ago

I'm not sure if it was a newer build of .NET 6 Preview 4 that fixed it, or if it was after cleaning up a bunch of files. I manually deleted sdk-manifests, metadata, etc. after uninstalling .NET 6.

See: https://github.com/dotnet/sdk/issues/17410

lewing commented 3 years ago

yeah I'm not sure my state was pristine, I'll close this and reopen if I hit it again