`dotnet workload` commands do not authenticate properly
See original GitHub issueDescribe the bug
I am trying to update/install workloads from an internal feed, and the authentication does not seem to carry through properly to the dotnet workload install
commands.
I can restore and build normal csproj and they have no issues.
The first hurdle was the --interactive
does nothing, so I had to create a dummy csproj. But, after that we get a 401 error on the feeds.
To Reproduce
Install a dotnet workload using a rollback file with a version on an internal feed.
I can’t share exact urls and deets here, but the log is basically this BEFORE authentication (with/without --interactive
):
> dotnet workload update --source https://pkgs.dev.azure.com/private/index.json --verbosity diagnostic
No workloads installed for this feature band. To update workloads installed with earlier SDK versions, include the --from-previous-sdk option.
Failed to update the advertising manifest microsoft.net.sdk.android: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.sdk.ios: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.sdk.macos: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.sdk.maui: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.sdk.tvos: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.workload.emscripten: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json..
Downloading microsoft.net.sdk.android.manifest-6.0.100.msi.x64 (31.0.101-preview.10.30)
Workload installation failed. Rolling back installed packs...
Downloading microsoft.net.sdk.maui.manifest-6.0.100.msi.x64 (6.0.101-preview.9.1805)
Installation rollback failed: One or more errors occurred. (Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json.)
Workload update failed: One or more errors occurred. (Unable to load the service index for source https://pkgs.dev.azure.com/private/index.json.)
If I create a dummy project and add a package and do the auth, then the log is different:
> dotnet workload update --source https://pkgs.dev.azure.com/private/index.json --verbosity diagnostic
No workloads installed for this feature band. To update workloads installed with earlier SDK versions, include the --from-previous-sdk option.
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.sdk.android.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.sdk.ios.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.sdk.maccatalyst.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.sdk.macos.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.sdk.maui.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.sdk.tvos.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.workload.emscripten.manifest-6.0.100/index.json
[NuGet Manager] [Info] GET https://pkgs.dev.azure.com/private/microsoft.net.workload.mono.toolchain.manifest-6.0.100/index.json
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.sdk.macos.manifest-6.0.100/index.json 558ms
Failed to update the advertising manifest microsoft.net.sdk.macos: Response status code does not indicate success: 401 (Unauthorized)..
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.sdk.ios.manifest-6.0.100/index.json 1376ms
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.sdk.maccatalyst.manifest-6.0.100/index.json 1358ms
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.sdk.maui.manifest-6.0.100/index.json 1334ms
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.sdk.tvos.manifest-6.0.100/index.json 1318ms
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.workload.emscripten.manifest-6.0.100/index.json 1444ms
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.sdk.android.manifest-6.0.100/index.json 1646ms
[NuGet Manager] [Info] Unauthorized https://pkgs.dev.azure.com/private/microsoft.net.workload.mono.toolchain.manifest-6.0.100/index.json 1449ms
Failed to update the advertising manifest microsoft.net.sdk.ios: Response status code does not indicate success: 401 (Unauthorized)..
Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: Response status code does not indicate success: 401 (Unauthorized)..
Failed to update the advertising manifest microsoft.net.sdk.maui: Response status code does not indicate success: 401 (Unauthorized)..
Failed to update the advertising manifest microsoft.net.sdk.tvos: Response status code does not indicate success: 401 (Unauthorized)..
Failed to update the advertising manifest microsoft.net.workload.emscripten: Response status code does not indicate success: 401 (Unauthorized)..
Failed to update the advertising manifest microsoft.net.sdk.android: Response status code does not indicate success: 401 (Unauthorized)..
Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: Response status code does not indicate success: 401 (Unauthorized)..
Downloading microsoft.net.sdk.android.manifest-6.0.100.msi.x64 (31.0.101-preview.10.30)
Workload installation failed. Rolling back installed packs...
Downloading microsoft.net.sdk.maui.manifest-6.0.100.msi.x64 (6.0.101-preview.9.1805)
Installation rollback failed: One or more errors occurred. (Response status code does not indicate success: 401 (Unauthorized).)
Workload update failed: One or more errors occurred. (Response status code does not indicate success: 401 (Unauthorized).)
Exceptions (if any)
Further technical details
.NET SDK (reflecting any global.json):
Version: 6.0.100-rc.2.21478.25
Commit: e3936c2261
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22468
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-rc.2.21478.25\
Host (useful for support):
Version: 6.0.0-rc.2.21474.18
Commit: d1c6659c2d
.NET SDKs installed:
2.1.816 [C:\Program Files\dotnet\sdk]
3.1.411 [C:\Program Files\dotnet\sdk]
5.0.205 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]
5.0.400 [C:\Program Files\dotnet\sdk]
6.0.100-rc.1.21458.32 [C:\Program Files\dotnet\sdk]
6.0.100-rc.1.21463.6 [C:\Program Files\dotnet\sdk]
6.0.100-rc.2.21474.31 [C:\Program Files\dotnet\sdk]
6.0.100-rc.2.21478.25 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.2.21470.37 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.2.21475.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21470.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21474.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.7.21378.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.2.21470.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.2.21475.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 2 years ago
- Comments:23 (23 by maintainers)
Top Results From Across the Web
Workloads: Feed authentication during install doesn't seem ...
The command complained that the packages couldn't be found in the feed, even though upstreams were configured correctly. Which is why we took ......
Read more >Troubleshoot .NET tool usage issues
Discover the common issues when running .NET tools and possible solutions.
Read more >dotnet workload repair command - .NET CLI
The dotnet workload repair command reinstalls all installed workloads. Workloads are made up of multiple workload packs and it's possible to ...
Read more >dotnet workload install command - .NET CLI
Description. The dotnet workload install command installs one or more optional workloads. Optional workloads can be installed on top of the .NET ......
Read more >Bug #2018308 “'dotnet workload install' command doesn't ...
I'm filling this out for awareness here. The issue is that no workloads are listed after a successful installation: #Installation. ubuntu@ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ve confirmed that adding a PAT in the nuget.config works for 6.0.100. I’ll target the
--interactive
fix for 6.0.2xx.The if check here is not needed, https://github.com/dotnet/sdk/blob/599fde6a0276a1e9d8eefea4ee4e4a4f9518bfd8/src/Cli/dotnet/NugetPackageDownloader/NuGetPackageDownloader.cs#L79.
The service should always be setup, not only in interactive mode.
See the equivalent NuGet side, https://github.com/NuGet/NuGet.Client/blob/2afc1e1d01dbf880b2ed0ce5c3fa52fb67dda080/src/NuGet.Core/NuGet.Build.Tasks/BuildTasksUtility.cs#L180