Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26719

"Next" NuGet XML tag disappears when Priority Resolution is used on remotes

    XMLWordPrintable

    Details

    • Severity:
      Medium
    • Location:
      External

      Description

      Problem description:
      Using the Priority Resolution repository setting in a certain way causes a Virtual NuGet Repository to truncate its metadata. The issue is that a "next" XML tag will not be present, resulting in situations where the NuGet client will fail to find a package.

      This happens when there are more than 100 versions of a NuGet package. When there are this many packages, Artifactory paginates results. The NuGet client can handle this, but it needs the "next" XML tag to tell it there are additional versions to look through. Oddly enough Artifactory 6.X paginates only 80 packages at a time, this may be a factor in the bug.

      The problem occurs when a smart remote repository is the only one with Priority Resolution enabled.

      What is the expected behavior?
      No matter the order of Priority Resolution flags, if there are more than 100 packages Artifactory should add the "next" XML tag. Anything less will result in builds failing if the NuGet client needs the 101st package.

      Environment details:

      A particular layout causes the issue:

      Artifactory 6.20.1                             |    Artifactory 7.29.8
                                                               nuget-virtual 
         nuget-local (200 Packages)        <-    | -  nuget-int-remote (Smart Remote Repository)
                                                                    L   nuget-7x-local
      
      

      DB type & Version: PSQL 9.4 on both 6.X and 7.X
      Is this an HA env? Yes, 6.X and 7.X used 2 nodes each
      Is this On-Prem or SaaS? On-Prem
      OS details if relevant: Not relevant, reproduced on Debian 9 in both 6.X and 7.X
      Installation type: Docker containers

      Steps to reproduce:

      1] Create a local nuget repository in an Artifactory 6.20.1. Also create a nuget local and a remote nuget repository in Artifactory 7.29.8. Finally, create a NuGet virtual on the 7.29.8 Artifactory with the local and remotes in it.

      2] Point the 7.X remote repository to the Artifactory 6.X local nuget repository

      3] Deploy 200 NuGet packages using the attached script to the 6.X local, the metadata should show up in the 7.X remote. Use the 2.6.0 generator (nuget-package-maker-2.6.0.sh) to let you track the 6.X packages.

      4] Deploy 200 NuGet packages using the attached script to the 7.X local, so the NuGet virtual aggregates both packages. Use the 2.0.0 generator (nuget-package-maker.sh) to let you track the 7.X packages.

      5] Use the "FindPackagesById()" API to load the NuGet metadata, note that currently there is a helpful "Next" link at the top (This is the expected behavior):

      Use: <https://artifactory.com>/artifactory/api/nuget/v3/test-nuget/FindPackagesById()?id=%27Dapper%27&semVerLevel=2.0.0

      [...]
      <link rel="self" title="FindPackagesById" href="FindPackagesById"/>
      <link rel="next" href="http://mill.jfrog.info:33715/artifactory/api/nuget/test-nuget/FindPackagesById()?semVerLevel=2.0.0&id=%27Dapper%27&%24skip=100"/>
      <entry>
      [...]

      6] To cause the bug, turn on Priority Resolution on the Smart Remote going to 6.X.

      7] Reload the FindPackagesById API and note now the "next" page tag is gone:

      <link rel="self" title="FindPackagesById" href="FindPackagesById"/>
      <entry>

      The lack of the "next" tag causes the NuGet client to give up searching for a package. If there are more than 80 versions, the 81st will not be found.

      You can swap Priority Resolution onto the local, and the "next" tag will be there.

      A 7.X -> 7.X system was tested as well, it produced the same behavior.

       

      Workaround:

      Disabling Priority Resolution on the remote seems to make the issue go away.

      Push Replication to a local on the 7.X avoids the issue. You have to remove the Smart Remote Repository and replace it with the Push Replication target.

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              patrickr Patrick Russell
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26729 -
                  SYNCHRONIZED
                  • Last Sync Date: