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

Artifactory doesn't follow tarball location on npm remote registries which results in 404

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 6.21.1, 7.10.5
    • Fix Version/s: 7.24.1
    • Component/s: None
    • Severity:
      Medium

      Description

      I'm trying to setup a npm remote registry inside Artifactory. While the registry works perfectly direct with npm, using Artifactory as proxy results in 404 error on a npm install.

      Looking at the Artifactory debug logs I could figure out Artifactory ignores the tarball location of the npm package from the metadata and tries to get the package on a specific location after getting the metadata is successfully.

      Scenario:

      Repository URL: https://example.com/api/v4/packages/npm/
      Package Name: @jfrog/test-package

      On a client side npm install:

      1. Artifactory tries to get the metadata of the package first:
      https://example.com/api/v4/packages/npm/@jfrog%2Ftest-package
      Answer:

      {"name":"@jfrog/test-package","versions":{"0.1.12":{"name":"@jfrog/test-package","version":"0.1.12","dist":{"shasum":"72faa6e13e034efddb861192d56a12ac483470bd","tarball":"https://example.com/api/v4/projects/1886/packages/npm/@jfrog/test-package/-/@jfrog/test-package-0.1.12.tgz"},"dependencies":{"jsonpath-plus":"1.0.0"}}},"dist-tags":{"latest":"0.1.12"}}

      2. Artifactory tries to download the npm packages:
      https://example.com/api/v4/packages/npm/@jfrog/test-package/-/@jfrog/test-package-0.1.12.tgz
      Answer: 404 Not Found

      Artifactory ignores the tarball location and tries to get the package at 

      <repo-url>/<scope>/<name>/-/<scope>/<name>-<version>.tar.gz

      I would expect that Artifactory tries to download the artifact here: https://example.com/api/v4/projects/1886/packages/npm/@jfrog/test-package/-/@jfrog/test-package-0.1.12.tgz It's the URL inside npm metadata of the artifact location.

      Related:

        Attachments

          Issue Links

            Activity

                People

                Assignee:
                Unassigned
                Reporter:
                jkr Jan-Otto Kröpke
                Votes:
                10 Vote for this issue
                Watchers:
                9 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Sync Status

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