Skip to content
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

Paket Error pulling Nuget v3 only Package Registry #3700

Closed
odytrice opened this issue Nov 5, 2019 · 4 comments
Closed

Paket Error pulling Nuget v3 only Package Registry #3700

odytrice opened this issue Nov 5, 2019 · 4 comments

Comments

@odytrice
Copy link
Contributor

odytrice commented Nov 5, 2019

Description

Paket Fails to pull packages from Nuget V3

Repro steps

  1. Add a Nuget Registry that supports only Nuget V3
  2. Paket install

https://github.com/odytrice/fake-paket-sample

Expected behavior

Paket Install Executes Successfully

Actual behavior

Fails to pull with the following error

Paket failed with
-> Unable to retrieve package versions for 'App.Library'
   -- CLOSED --

   -- OPEN ----
      App.Library 0.0.1 (from C:\Users\Ody\Desktop\Temp\paket.dependencies)
    "https://nuget.pkg.github.com/odytrice/index.json"]. (Source 'https://api.nuget.org/v3/index.json' yielded (0): [] (Request 'https://api.nuget.org/v3-flatcontainer/app.library/index.json?semVerLevel=2.0.0' finished with: [])) (Source 'https://nuget.pkg.github.com/odytrice/index.json' yielded no results (Request 'https://nuget.pkg.github.com/odytrice/downloadapp.library/index.json?semVerLevel=2.0.0' finished with error))))
-> One or more errors occurred. (Could not find versions for package App.Library on any of ["https://api.nuget.org/v3/index.json";
    "https://nuget.pkg.github.com/odytrice/index.json"]. (Source 'https://api.nuget.org/v3/index.json' yielded (0): [] (Request 'https://api.nuget.org/v3-flatcontainer/app.library/index.json?semVerLevel=2.0.0' finished with: [])) (Source 'https://nuget.pkg.github.com/odytrice/index.json' yielded no results (Request 'https://nuget.pkg.github.com/odytrice/downloadapp.library/index.json?semVerLevel=2.0.0' finished with error)))
-> Could not find versions for package App.Library on any of ["https://api.nuget.org/v3/index.json";
    "https://nuget.pkg.github.com/odytrice/index.json"]. (Source 'https://api.nuget.org/v3/index.json' yielded (0): [] (Request 'https://api.nuget.org/v3-flatcontainer/app.library/index.json?semVerLevel=2.0.0' finished with: [])) (Source 'https://nuget.pkg.github.com/odytrice/index.json' yielded no results (Request 'https://nuget.pkg.github.com/odytrice/downloadapp.library/index.json?semVerLevel=2.0.0' finished with error))
        -  Source 'https://api.nuget.org/v3/index.json' yielded (0): [] (Request 'https://api.nuget.org/v3-flatcontainer/app.library/index.json?semVerLevel=2.0.0' finished with: [])
        -> Request 'https://api.nuget.org/v3-flatcontainer/app.library/index.json?semVerLevel=2.0.0' finished with: []
        -  Source 'https://nuget.pkg.github.com/odytrice/index.json' yielded no results (Request 'https://nuget.pkg.github.com/odytrice/downloadapp.library/index.json?semVerLevel=2.0.0' finished with error)
        -> Request 'https://nuget.pkg.github.com/odytrice/downloadapp.library/index.json?semVerLevel=2.0.0' finished with error
        -> Not authorized (401)

The critial piece is Request 'https://nuget.pkg.github.com/odytrice/downloadapp.library/index.json?semVerLevel=2.0.0' finished with error the correct url is supposed to be https://nuget.pkg.github.com/odytrice/download/app.library/index.json?semVerLevel=2.0.0

Known workarounds

No known work arounds at the moment

Version

5.231.0

@matthid
Copy link
Member

matthid commented Nov 5, 2019

Looks like there is a / missing between download and app.library?

@forki
Copy link
Member

forki commented Nov 5, 2019

@matthid ideas where to put it?

@odytrice
Copy link
Contributor Author

odytrice commented Nov 6, 2019

@matthid yes precisely. This is the output of the main index.json page

{
   "version":"3.0.0-beta.1",
   "resources":[
      {
         "@id":"https://nuget.pkg.github.com/odytrice/download",
         "@type":"PackageBaseAddress/3.0.0",
         "comment":"Get package content (.nupkg)."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice/query",
         "@type":"SearchQueryService",
         "comment":"Filter and search for packages by keyword."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice/query",
         "@type":"SearchQueryService/3.0.0-beta",
         "comment":"Filter and search for packages by keyword."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice/query",
         "@type":"SearchQueryService/3.0.0-rc",
         "comment":"Filter and search for packages by keyword."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice",
         "@type":"PackagePublish/2.0.0",
         "comment":"Push and delete (or unlist) packages."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice",
         "@type":"RegistrationsBaseUrl",
         "comment":"Get package metadata."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice",
         "@type":"RegistrationsBaseUrl/3.0.0-beta",
         "comment":"Get package metadata."
      },
      {
         "@id":"https://nuget.pkg.github.com/odytrice",
         "@type":"RegistrationsBaseUrl/3.0.0-rc",
         "comment":"Get package metadata."
      }
   ]
}

@forki I tried looking at the code but I'm not sure where the issue is coming from. My initial guess was here https://github.com/fsprojects/Paket/blob/master/src/Paket.Core/Dependencies/NuGetV3.fs#L603 but that looks okay

@matthid
Copy link
Member

matthid commented Nov 6, 2019

Thanks for posting the index, I think we expect the packagebaseaddress to end with a trailing slash for some reason. shouldn't be too hard to find.

I wouldn't be surprised if the spec even demands the trailing slash so this could very well be a bug in the Github implementation as well. So if we want to do it properly we look up the spec as well (but to be honest we should probably fix it anyway)

@forki forki closed this as completed in 153c939 Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants