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.

paket install fails when --keep-patch argument is used

See original GitHub issue

When using the latest Paket (3.30.2), if paket install --keep-patch --redirects --createnewbindingfiles --clean-redirects --force --verbose command is executed with paket.dependencies and paket.lock files that look like the simplified examples below, the command will fail with the following error:

  Trying to resolve Foobar.Service >= 1.2 < 1.2.1 (from C:\Work\Foobar\paket.dependencies)
  - fetching versions for Foobar.Service
Error while retrieving 'https://api.nuget.org/v3-flatcontainer/Foobar.Service/index.json': System.AggregateException: One or more errors occurred. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.WebException: The remote server returned an error: (404) Not Found.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
   at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)<---

  Could not resolve package Foobar.Service:
   - Dependencies file requested package Foobar.Service: >= 1.2 < 1.2.1
   - Dependencies file requested package Foobar.Service: >= 1.1 < 2.0

For some reason Paket tries to download Foobar.Service from nuget.org even though according to paket.lock file it should be downloaded from myget.org. I was not able to test what happens if I remove nuget.org source as our private MyGet feed contains only our proprietary packages. I did however change the order of the sources in dependencies file with no effect. The latest version of Foobar.Service on MyGet at the time was 1.2.0-alpha1.

I was able to see from the log file that this was not the only instance where Paket tried to download our proprietary package from nuget.org, but in those intances it correctly used myget.org feed after nuget.org failed. To me it seems that there should be no reason why Paket would need to first check nuget.org if lock file says that the package came from another feed.

This might not be directly related to this issue but Paket doesn’t seem to use https://api.nuget.org/v3/index.json source as defined but instead it uses http://www.nuget.org/api/v2 according to the log file.

paket.dependencies

redirects: on
framework: >= net461
copy_local: true

source https://api.nuget.org/v3/index.json
source https://www.myget.org/F/foobar/api/v3/index.json

nuget Foobar.Service ~> 1.1 prerelease
nuget Newtonsoft.Json ~> 9.0

paket.lock

REDIRECTS: ON
COPY-LOCAL: TRUE
FRAMEWORK: >= NET461
NUGET
  remote: http://api.nuget.org/v3/index.json
    Newtonsoft.Json (9.0.1)
  remote: https://www.myget.org/F/foobar
    Foobar.Service (1.2.0-alpha1)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
forkicommented, Nov 29, 2016

please give it another try with latest

0reactions
Gonnaglecommented, Nov 29, 2016

The latest patch seems fix the issue. Thanks you for the quick response 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

paket install
A dependency manager for .NET with support for NuGet packages and git repositories.
Read more >
I can't use libraries installed with paket tool
If your dotnet version is 6.0, you can't use any library you added. Solution is simple: just add net6.0 to that line. framework:...
Read more >
paket-completion.zsh file - GitHub
paket -completion-update supports an optional first parameter that allows you # to ... I think it's unnatural to type # paket add FAK<tab>...
Read more >
Getting Started with Paket – Part 1 - The Cockney Coder
A powerful resolver means that Paket will protect you from accidentally creating incompatible dependency chains – something that can often occur ...
Read more >
Untitled
Chegg used textbooks condition, David gemmell shield of thunder pdf, ... Unreal tournament 3 linux installer for android, Mp3 hindi song download?
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