sdk: dotnet restore with basic authentication failing

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

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 39 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@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.