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

Artifactory is unable to handle NPM packages that have ".json" in the name of the package like merge-package.json

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: 3 - High
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.19.0, 7.4.0
    • Component/s: NPM
    • Labels:
    • Severity:
      High

      Description

      The package installation is successful for the merge-package.json npm package, but the request actually goes to the registry npm and therefore the package is not cached in Artifactory. 

      From the npm verbose output we can see that the actual install request for the merge-package.json is going to the npm registry and due to this the package metadata is never updated. The metadata is downloaded to the root of the npm remote repo and not to the .npm/ folder where we store metadata.

      npm install merge-package.json@1.0.0 --verbose

       

      npm http fetch GET 200 http://localhost:8081/artifactory/api/npm/npm-remote/merge-package.json 1589ms

      npm http fetch GET 200 https://registry.npmjs.org/merge-package.json/-/merge-package.json-1.0.0.tgz 597ms

      npm http fetch GET 200 http://localhost:8081/artifactory/api/npm/npm-remote/three-way-merger 419ms

       

      Below are the messages seen in the artifactory.log during the install request where we can see that Artifactory is expecting the package to be compressed in gz format. However it receives a package that ends with .json.

      In the registry NPM we can see this package  http://registry.npmjs.com/merge-package.json

       

      2018-04-06 13:34:42,485 [http-nio-8081-exec-6] [ERROR] (o.j.r.n.NpmMetadataExtractor:133) - Unable to find or parse correctly the package archive ('package.json') within the tarball content: Input is not in the .gz format

      java.io.IOException: Input is not in the .gz format

       

      2018-04-06 13:34:42,487 [http-nio-8081-exec-6] [WARN ] (o.a.a.n.r.r.NpmRemoteInterceptor:62) - Failed to set npm metadata on path npm-remote-cache/merge-package.json : java.io.IOException: Input is not in the .gz format

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alexeiv Alexei Vainshtein
              Reporter:
              nihalc@jfrog.com Nihal Reddy Chinna Choudhary
              Votes:
              8 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

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