Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

kpm restore fails to proceed to fallback sources when there is an error in the first listed feed #1018

Closed
Praburaj opened this issue Dec 29, 2014 · 7 comments

Comments

@Praburaj
Copy link
Contributor

From @itsananderson on May 13, 2014 15:51

I was walking through the getting started section, and I noticed an exception being thrown from the kpm restore step.

Attempting to resolve dependency System.Console >= 4.0.0.0
  OK https://my-feed.cloudapp.net/api/v2/FindPackagesById()?Id='System.Console' 448ms
Warning: FindPackagesById: System.Console
  '=' is an unexpected token. The expected token is ';'. Line 21, position 78.

(I've sanitized the actual feed URL, but I'm a Microsoft employee if that helps)

My guess is that one of three things is happening:

  1. kpm doesn't know how to negotiate authentication with the private NuGet feed
  2. The private feed needs an update to work with kpm, and kpm doesn't gracefully handle communicating with old feeds
  3. The feed simply doesn't contain the "System.Console" package, and kpm doesn't gracefully handle missing packages.

Other details:

KRE builds tested (both reproduced issue)

0.1-alpha-build-0421 svr50   x86          C:\Users\me\.kre\packages
0.1-alpha-build-0425 svr50   x86          C:\Users\me\.kre\packages

Pretty sure these aren't relevant, but:

  • Windows 8.1 update
  • IIS 8.5

Here's a full dump of console output, and the actual response I get from the NuGet feed when I run the Id='System.Console' query in the browser: https://gist.github.com/itsananderson/3f6c8ec3fb1bb8699a91

Copied from original issue: dotnet/aspnetcore#15

@Praburaj
Copy link
Contributor Author

From @itsananderson on May 13, 2014 15:54

I forgot to mention, but when I disable that package source, kpm restore works as expected

@Praburaj
Copy link
Contributor Author

From @glennc on May 13, 2014 16:19

Which feed did you disable to make it work? The MyGet feed is public as of this morning, so you should be able to use it without any auth getting in the way.

@Praburaj
Copy link
Contributor Author

From @itsananderson on May 13, 2014 16:25

I disabled my private NuGet feed (which uses Microsoft federated auth). I didn't touch the MyGet or nuget.org feeds

@Praburaj
Copy link
Contributor Author

From @Alxandr on May 14, 2014 21:57

I have something of the same problem. I get InternelServerError on one of the feeds, and that just crashes the whole restore.

@Praburaj
Copy link
Contributor Author

I can still reproduce this - For example if I have a package X in my project.json dependencies and I try to do a kpm restore -s http://notexistingfeed.com/api/v2 -s https://nuget.org/api/v2 (Note: This command has multiple feeds and the first one a non-existing feed). When there is an error (404/500 etc) in the first feed kpm restore fails and does not proceed to the fallback sources. For instance the same is handled differently in older nuget where it falls back.

The source at NonExisting [http://notexistingsite.com/api/v2] is unreachable. Falling back to NuGet Local Cache at C:\Users\prabht\AppData\Local\NuGet\Cache

@Praburaj
Copy link
Contributor Author

Updating the title of the bug to reflect the issue.

@davidfowl
Copy link
Member

That's by design. Use --ignore-failed-sources to ignore sources that may not be reachable or failing etc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants