Home: dotnet restore fails when more than 100 artifacts match the package id

Created on 26 Sep 2017  路  8Comments  路  Source: NuGet/Home

_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

  • dotnet new console
  • dotnet add package Serilog -v 2.5.0

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

  • Make sure that i.e the configured dependency "Serilog" produces more than 100 matches
  • See NuGet.Config attached (had to append suffix .txt due to github)
    NuGet.Config.txt

Restore dependencies

  • dotnet restore

Expected behavior

  • Dependency Serilog gets restored

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_

Restore

Most helpful comment

I agree that it is an external issue.

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

I reproduced it with versions

  • 5.4.6
  • 5.3.2
  • I did not test any other versions

I will open an issue accordingly

All 8 comments

@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.

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

first page.xml.txt

@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>

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

I agree that it is an external issue.

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

I reproduced it with versions

  • 5.4.6
  • 5.3.2
  • I did not test any other versions

I will open an issue accordingly

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.

There are related jiras on the JFrog side:

Please up-vote them to increase priority

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

Was this page helpful?
0 / 5 - 0 ratings