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

'npm publish' command fails while having specific content in README.md file

    XMLWordPrintable

    Details

    • Severity:
      Medium
    • Location:
      External

      Description

      Problem description: 

      While trying to publish any npm package with certain values in the README file, the publish fails from the client with error 406. I was able to publish the same file directly to Artifactory with cURL, meaning that something in the integration between npm client and Artifactory causes it.

      What is the expected behavior? 

      To be able to publish a package regardless of the content of the README file.

      Steps to reproduce: 

      1. Clone the below package to your local machine: https://github.com/venikkin/jfrog-test
      2. Edit the content of package.json to point to your Artifactory virtual NPM repository. Example: *"publishConfig": { "registry"*: "https://omerb.jfrog.io/artifactory/api/npm/default-npm-virtual/" }
      3. Make sure to configure the ~/.npmrc file to point to your Artifactory, and use 'npm login' to authenticate against the server
      4. Publish the package with the command: "npm publish --versbose"
      5. The package upload will fail with the '406 error' (screenshot attached)
      6. Edit the 'README.md' file, and remove the "${foo:${bar:a.b}.c}" string from it. (you may put numbers or letters instead)
      7. Try to publish the package again with 'npm publish --verbose'
      8. The package will be published to Artifactory successfully.

        Uploading the "README.md" file directly to Artifactory via cURL works:

      curl -XPUT --uadmin:password "https://omerb.jfrog.io/artifactory/api/npm/default-npm-virtual/" -T README.md -vvv

       

      There might be issues with the HEADERS that the npm client is adding to the request, and causes it to fail for some reason.

      • The issue is not reproducible while trying to publish the package with JFrog CLI.
      • It is possible to manually upload the file to Artifactory bypassing the npm client
      • Error 406 indicates that there might have been issues with the 'accept' header
      • Is it expected that Artifactory parses the data inside the npm package in the 'README.md' file?

       

       

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              omerb Omer Borshan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:

                  Sync Status

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