New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget Install with All Package Sources, but package missing from 1 source, fails #2322

Closed
rrelyea opened this Issue Mar 15, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@rrelyea
Contributor

rrelyea commented Mar 15, 2016

  1. Create a console application (.Net Core) project
  2. Right-click on the "References" node in the "Solution Explorer"
  3. Click on “Manage Nuget Packages” option
  4. Find the package that is named “Newtonsoft.json” and click "Install" button
  5. In the “Preview” window that comes up click “OK”

Expected result: the package is installed without any errors.

Actual result:
package install failed...with following output:

GET https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/newtonsoft.json/8.0.3/newtonsoft.json.8.0.3.nupkg
NotFound https://dotnetmyget.blob.core.windows.net/artifacts/dotnet-core/nuget/v3/flatcontainer/newtonsoft.json/8.0.3/newtonsoft.json.8.0.3.nupkg 191ms
Install failed. Rolling back...
Uninstalling NuGet package Newtonsoft.Json.8.0.3.
NuGet.Protocol.Core.Types.FatalProtocolException: Package 'Newtonsoft.Json.8.0.3' is not found on source 'https://dotnet.myget.org/F/dotnet-core/api/v3/index.json'.
at NuGet.PackageManagement.PackageDownloader.d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.PackageManagement.NuGetPackageManager.d__54.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at NuGet.PackageManagement.NuGetPackageManager.d__54.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.UI.UIActionEngine.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.PackageManagement.UI.UIActionEngine.d__6.MoveNext()
========== Finished ==========

Note: when using nuget source directly, works fine.

@rrelyea rrelyea added this to the 3.4 RTM milestone Mar 15, 2016

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Mar 15, 2016

Contributor

It appears that we need WebTools installed for this to work correctly. (who'd a'thunk?)
the original repro was caused by command line creation of the project (via "dotnet new").
it had a nuget.config.

Closing as by design.

Contributor

rrelyea commented Mar 15, 2016

It appears that we need WebTools installed for this to work correctly. (who'd a'thunk?)
the original repro was caused by command line creation of the project (via "dotnet new").
it had a nuget.config.

Closing as by design.

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Mar 15, 2016

Contributor

Sorry, mistake in testing. Hadn't recleared my nuget cache.

Updated repro steps.

  1. Create a console application (.Net Core) project (via "dotnet new")
  2. Open in VS
    3.Right-click on the "References" node in the "Solution Explorer"
    4.Click on “Manage Nuget Packages” option
    5.Find the package that is named “Newtonsoft.json” and click "Install" button
    6.In the “Preview” window that comes up click “OK”
Contributor

rrelyea commented Mar 15, 2016

Sorry, mistake in testing. Hadn't recleared my nuget cache.

Updated repro steps.

  1. Create a console application (.Net Core) project (via "dotnet new")
  2. Open in VS
    3.Right-click on the "References" node in the "Solution Explorer"
    4.Click on “Manage Nuget Packages” option
    5.Find the package that is named “Newtonsoft.json” and click "Install" button
    6.In the “Preview” window that comes up click “OK”
@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen

joelverhagen Mar 16, 2016

Member

The scenario here is:

  • Project K project
  • Installing a package from the NuGet UI in Visual Studio
  • Using the All Source
  • The package doesn't exist on the primary source.

We are thinking that we can potentially punt this to 3.5 since the scenario is not major.

Member

joelverhagen commented Mar 16, 2016

The scenario here is:

  • Project K project
  • Installing a package from the NuGet UI in Visual Studio
  • Using the All Source
  • The package doesn't exist on the primary source.

We are thinking that we can potentially punt this to 3.5 since the scenario is not major.

@kmcginnes

This comment has been minimized.

Show comment
Hide comment
@kmcginnes

kmcginnes Apr 19, 2016

This is also an issue in the command line.

  1. New command line project
  2. Convert to project.json
  3. Add NuGet package from the nuget.org
  4. Add a NuGet.config with a private NuGet server
  5. Execute nuget restore MyApp.sln
  6. Fails to restore package

The restore command never even attempts to ask nuget.org for the package. It only asks the private package source, which fails. It seems to ignore the order of package sources and always tries the private feed first. I assume because it's going in alphabetical order and http:\\ goes before https:\\ (in my case I am using TeamCity as the NuGet feed, which has additional issues with NuGet v3 API).

So I believe there are a couple of issues here.

  • n failures on one package source cancels entire restore without trying any alternate sources
  • package source order is not respected during restore (and possibly other commands)

kmcginnes commented Apr 19, 2016

This is also an issue in the command line.

  1. New command line project
  2. Convert to project.json
  3. Add NuGet package from the nuget.org
  4. Add a NuGet.config with a private NuGet server
  5. Execute nuget restore MyApp.sln
  6. Fails to restore package

The restore command never even attempts to ask nuget.org for the package. It only asks the private package source, which fails. It seems to ignore the order of package sources and always tries the private feed first. I assume because it's going in alphabetical order and http:\\ goes before https:\\ (in my case I am using TeamCity as the NuGet feed, which has additional issues with NuGet v3 API).

So I believe there are a couple of issues here.

  • n failures on one package source cancels entire restore without trying any alternate sources
  • package source order is not respected during restore (and possibly other commands)
@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen

joelverhagen Apr 28, 2016

Member

Hey @kmcginnes... slight tangent but could we have worked together at SpaceX for a couple years back? I was one of the lowly interns 😄. I hope things are going well!

Sorry about the delay on this issue. I can't seem to reproduce the problem. Could you provide what nuget.exe version you are using as well as attach a self-enclosed solution (or project) that reproduces the issue?

Member

joelverhagen commented Apr 28, 2016

Hey @kmcginnes... slight tangent but could we have worked together at SpaceX for a couple years back? I was one of the lowly interns 😄. I hope things are going well!

Sorry about the delay on this issue. I can't seem to reproduce the problem. Could you provide what nuget.exe version you are using as well as attach a self-enclosed solution (or project) that reproduces the issue?

@joelverhagen

This comment has been minimized.

Show comment
Hide comment
@joelverhagen
Member

joelverhagen commented Apr 29, 2016

@kmcginnes

This comment has been minimized.

Show comment
Hide comment
@kmcginnes

kmcginnes Apr 29, 2016

@joelverhagen Hey man! Yeah, we totally worked together at SpaceX. I'm glad to see you got a nice cushy job at NuGet 😄 !

And I can try to get a sample app to you, but it depends on what sources you have configured in the NuGet.config. We were using TeamCity along with a project.json file. This configuration just won't work, mainly because of #2347 .

But it was failing on packages that it can clearly get from NuGet.org, which is the topmost element in my NuGet.config, but it was attempting to grab them from the TeamCity feed.

I ended up getting so fed up with TeamCity's broken NuGet server implementation that I just installed Klondike on our servers and put all our internal packages there. Solved our problem perfectly. :shipit:

kmcginnes commented Apr 29, 2016

@joelverhagen Hey man! Yeah, we totally worked together at SpaceX. I'm glad to see you got a nice cushy job at NuGet 😄 !

And I can try to get a sample app to you, but it depends on what sources you have configured in the NuGet.config. We were using TeamCity along with a project.json file. This configuration just won't work, mainly because of #2347 .

But it was failing on packages that it can clearly get from NuGet.org, which is the topmost element in my NuGet.config, but it was attempting to grab them from the TeamCity feed.

I ended up getting so fed up with TeamCity's broken NuGet server implementation that I just installed Klondike on our servers and put all our internal packages there. Solved our problem perfectly. :shipit:

@zhili1208 zhili1208 modified the milestones: 3.5 Beta2, 3.6 Beta Jun 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment