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

Nuget normalized versioning returns 404 through remote

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Deferred
    • Affects Version/s: 7.27.4
    • Fix Version/s: None
    • Component/s: NuGet
    • Labels:
      None

      Description

      Problem description: resolving a nuget package with version normalization returns 404 through smart remote repository.

      Impact: These packages are not able to be retrieved through remote repositories

      Expected behavior: If you can resolve a package from a local repository, we should get the same package if you configure a remote repository to this local

      Steps to reproduce: Spin up an Artifactory instance and setup local repository. Deploy a nuget package with versioning similar to 1.0.0+123456.  We can update the nuspec file to achieve this versioning and can also resolve packages with similar versioning.  We then see we can download the package through the following request:

      http://art.com/artifactory/api/nuget/nuget-local/Download/Azure.AI.FormRecognizer/3.0.0+123456

      We can now spin up another Artifactory instance and setup a smart remote repository to this local.  If we then look up this package, we see the following src URL from http:/art.com/artifactory/api/nuget/nuget-smart-remote/FindPackagesById()?id=Azure.AI.FormRecognizer&semVerLevel=2.0.0:

      <content type="application/zip" src="http://art.com/artifactory/api/nuget/nuget-smart-remote/Download/Azure.AI.FormRecognizer/3.0.0+123456"/>

      If we then run the same request to this endpoint through the smart remote repository, we get a 404.  We see on the remote instance, the correct request in the request logs:

      2021-10-20T20:13:27.849Z|1be492e3e3b4c912|0.0.0.0|admin|GET|/api/nuget/nuget-smart-remote/Download/Azure.AI.FormRecognizer/3.0.0+123456|404|-1|0|413|curl/7.71.1

      We then see in the target instance the following in the request logs:

      2021-10-20T20:13:27.827Z|1be492e3e3b4c912|0.0.0.0|admin|GET|/api/nuget/nuget-local/Download/Azure.AI.FormRecognizer/3.0.0|404|-1|0|6|Artifactory/7.27.6 72706900

      You can see the 123456 is removed between requests and causes the issue.  You can see on the nuget docs around this normalized versioning.

      https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#normalized-version-numbers

      "1.0.7+r3456 is treated as 1.0.7"

      Env details: Art 7.27.6, Postgres, Standalone, On-prem

      Workaround: The only workaround would be to manually update versioning to not include these additional characters, but should work out of the box.

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              scottm Scott Mosher
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: