NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

dotnet restore fails when more than 100 artifacts match the package id #5942

Closed livarcocc closed 7 years ago

livarcocc commented 7 years ago

From @Andresbu on September 26, 2017 12:33

Artifactory contains more than 100 packages matching id "Serilog". dotnet restore fails as it seems to read only the first 100 packages and not more. Reason seems to be an invalid GET for fetching the pages after the first one. See below.

Steps to reproduce

Use any of the docker images (It fails for me with those, I havent tested others)

Create a project

Configure an own Artifactory (serving as a mirror within our company)

Restore dependencies

Expected behavior

Actual behavior

Restore fails with "Unable to find ...."

         /builds/x/devops/ev-dotnet-container/test/test.csproj : error NU1102: Unable to find package Serilog with version (= 2.5.0)
       /builds/x/devops/ev-dotnet-container/test/test.csproj : error NU1102:   - Found 100 version(s) in Z-Artifactory [ Nearest version: 1.3.39 ]
       /builds/x/devops/ev-dotnet-container/test/test.csproj : error NU1102:   - Found 0 version(s) in /usr/share/dotnet/sdk/NuGetFallbackFolder

A first analysis on my side reveals the following. HTTP calls made:

Observe, that the later one is missing 'FindPackagesById()'! And this actually seems to be the cause.

OK but wrong content!

OK and correct content

Environment data

dotnet --info output:

Copied from original issue: dotnet/cli#7707

emgarten commented 7 years ago

@andresbu does https://HOST/artifactory/api/nuget/nuget-notcleared-remote/FindPackagesById()?id='Serilog' contain the correct next link?

I would like to determine if the nuget client is incorrectly using https://HOST/artifactory/api/nuget/nuget-notcleared-remote/?id='Serilog'&$skip=100 or if the feed is broken here and needs to be fixed.

Andresbu commented 7 years ago

@emgarten I attached the result for https://HOST/artifactory/api/nuget/nuget-notcleared-remote/FindPackagesById()?id='Serilog' as attachment.

first page.xml.txt

emgarten commented 7 years ago

@Andresbu where is this OData coming from? Would you file an issue on the feed or creator of this feed?

From what I see the next link in the response is incorrect, and I'm going to guess that the self link here is also incorrect.

  <title type="text"></title>
  <id>http://schemas.datacontract.org/2004/07/</id>
  <updated>2017-09-27T13:22:37Z</updated>
  <link rel="self" href="https://www.nuget.org/api/v2/Packages"/>
  <link rel="next" href="https://HOST/artifactory/api/nuget/nuget-notcleared-remote/?id=%27Serilog%27&amp;$skip=100"/>
  <m:count>276</m:count>
mishra14 commented 7 years ago

@Andresbu Please let us know if this does not resolve your issue. Else, we can go ahead and close this issue.

Andresbu commented 7 years ago

I agree that it is an external issue.

It occurs with https://www.jfrog.com/artifactory/.

I reproduced it with versions

I will open an issue accordingly

emgarten commented 7 years ago

Thanks for the update @Andresbu, if any changes are needed on the client let me know in this issue and I'll reopen it so we can address those.

imanushin commented 6 years ago

There are related jiras on the JFrog side:

Please up-vote them to increase priority

evgeny-burmakov commented 6 years ago

Got the same issue with jFrog artifactory after migrating from package.config projects to SDK style with PackageReference. On old style it was direct request for downloading package which was work: .../Packages(Id='MSBuild.Sdk.Extras',Version='1.6.55') At SDK project there is request for list available versions which is trimmed (in my case by 40 entrance): .../FindPackagesById()?id='MSBuild.Sdk.Extras'&semVerLevel=2.0.0