question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet restore with basic authentication failing

See original GitHub issue

Steps to reproduce

Ubuntu 14.04 container running on docker in Digital Ocean

Followed https://dotnet.github.io/getting-started/

Nexus Nuget feed with Basic Authentication enabled

Added feeds to Nuget.config with nuget add source & nuget setapikey.

Expected behavior

Manually running nuget 3.3.0 authenticates correctly, but:

Actual behavior

dotnet restore ./project.json

gives

log : Response status code does not indicate success: 401 (Unauthorized).

Detailed trace:

error: Response status code does not indicate success: 401 (Unauthorized). trace: System.AggregateException: One or more errors occurred. (Failed to retrieve information from remote source β€˜http://subdomain.domain.com/repository/nuget.org-proxy/FindPackagesById()?id=β€˜MRAM.ServiceFramework’’.) β€”> NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information from remote source β€˜http://subdomain.domain.com/repository/nuget.org-proxy/FindPackagesById()?id=β€˜MRAM.ServiceFramework’’. β€”> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). trace: at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() trace: at NuGet.Protocol.HttpSource.<GetAsync>d__16.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Protocol.Core.v3.RemoteRepositories.RemoteV2FindPackageByIdResource.<FindPackagesByIdAsyncCore>d__23.MoveNext() trace: β€” End of inner exception stack trace β€” trace: at NuGet.Protocol.Core.v3.RemoteRepositories.RemoteV2FindPackageByIdResource.<FindPackagesByIdAsyncCore>d__23.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Protocol.Core.v3.RemoteRepositories.RemoteV2FindPackageByIdResource.<GetAllVersionsAsync>d__19.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.SourceRepositoryDependencyProvider.<FindLibraryAsync>d__8.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<>c__DisplayClass15_1.<<FindLibrary>b__0>d.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibrary>d__15.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryByVersion>d__14.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryMatch>d__11.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryEntry>d__8.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<CreateGraphNode>d__3.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<CreateGraphNode>d__3.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<WalkDependenciesAsync>d__19.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<TryRestore>d__14.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<ExecuteRestoreAsync>d__11.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__8.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<Execute>d__1.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<>c__DisplayClass0_0.<<Run>b__0>d.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<CompleteTaskAsync>d__2.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<Run>d__0.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.CommandLine.XPlat.RestoreCommand.<>c__DisplayClass0_1.<<Register>b__1>d.MoveNext() trace: β€” End of inner exception stack trace β€” trace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) trace: at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) trace: at Microsoft.Dnx.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args) trace: at NuGet.CommandLine.XPlat.Program.Main(String[] args) trace: β€”> (Inner Exception #0) NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information from remote source β€˜http://subdomain.domain.com/repository/nuget.org-proxy/FindPackagesById()?id=β€˜MRAM.ServiceFramework’’. β€”> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). trace: at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode() trace: at NuGet.Protocol.HttpSource.<GetAsync>d__16.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Protocol.Core.v3.RemoteRepositories.RemoteV2FindPackageByIdResource.<FindPackagesByIdAsyncCore>d__23.MoveNext() trace: β€” End of inner exception stack trace β€” trace: at NuGet.Protocol.Core.v3.RemoteRepositories.RemoteV2FindPackageByIdResource.<FindPackagesByIdAsyncCore>d__23.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Protocol.Core.v3.RemoteRepositories.RemoteV2FindPackageByIdResource.<GetAllVersionsAsync>d__19.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.SourceRepositoryDependencyProvider.<FindLibraryAsync>d__8.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<>c__DisplayClass15_1.<<FindLibrary>b__0>d.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibrary>d__15.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryByVersion>d__14.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryMatch>d__11.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<FindLibraryEntry>d__8.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<CreateGraphNode>d__3.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.DependencyResolver.RemoteDependencyWalker.<CreateGraphNode>d__3.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<WalkDependenciesAsync>d__19.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<TryRestore>d__14.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<ExecuteRestoreAsync>d__11.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreCommand.<ExecuteAsync>d__8.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<Execute>d__1.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<>c__DisplayClass0_0.<<Run>b__0>d.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<CompleteTaskAsync>d__2.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.Commands.RestoreRunner.<Run>d__0.MoveNext() trace: β€” End of stack trace from previous location where exception was thrown β€” trace: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) trace: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) trace: at NuGet.CommandLine.XPlat.RestoreCommand.<>c__DisplayClass0_1.<<Register>b__1>d.MoveNext()<β€”

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-beta-001793) Usage: dotnet [common-options] [command] [arguments]

Arguments: [command] The command to execute [arguments] Arguments to pass to the command

Common Options (passed before the command): -v|–verbose Enable verbose output –version Display .NET CLI Version Info

Common Commands: new Initialize a basic .NET project restore Restore dependencies specified in the .NET project build Builds a .NET project publish Publishes a .NET project for deployment (including the runtime) run Compiles and immediately executes a .NET project repl Launch an interactive session (read, eval, print, loop) pack Creates a NuGet package

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:39 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
yishaigalatzercommented, Apr 15, 2016

@simon-hardy @eerhardt you are both correct

@eerhardt is correct that he has the latest 3.5-Beta build in the CLI The fixes are in 3.5-RC (or the nuget dev branch) and 3.4.3 branch that is ahead of 3.5-Beta as 3.5-Beta was frozen in escrow and 3.4.3 had patches applied.

We are working on approving a merge from 3.5-RC (basically renaming the branch to 3.5-Beta) where at that point there will be a newer build that the CLI can take.

Hopefully this clarifies the state of affairs.

0reactions
TheRealPiotrPcommented, Feb 22, 2017

This issue was moved to NuGet/Home#4668

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuget restore fails with authentication
Migrating to my Linux machine for work I have run into a problem with Nuget. Our projects are .net core 3.1 and each...
Read more >
dotnet restore with basic authentication failing Β· Issue #4668
TheRealPiotrP commented on Feb 21, 2017 ... I am on a Mac, running .NET Command Line Tools (1.0.0-rc2-002659) and NuGet Version: 3.4.3.855. I...
Read more >
dotnet restore command - .NET CLI
Learn how to restore dependencies and project-specific tools with the dotnet restore command.
Read more >
Sporadic dotnet restore authentication (CredentialProvider) ...
BTW: I just found a workaround that seems to fix the problem. I had to swap the order of the NuGetAuthenticate and NuGetToolInstaller...
Read more >
NuGet Basic Authentication support
The command '/bin/sh -c dotnet restore' returned a non-zero code: 1. I have tried to change the NuGet configuration to require basic authentication:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found