Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-31352

NPM proxy not returning cached metadata when remote is not available

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.14.20, 2.14.21
    • Fix Version/s: 3.0.0
    • Component/s: NPM
    • Labels:
    • Notability:
      3
    • InvestmentLayer:
      support-escalated
    • Aha Concept:
      non-concept

      Description

      NPM proxy not returning cached metadata when remote is not available.

       

      Steps to reproduce

      1) Create npm proxy to https://registry.npmjs.org/

      2) Make a request for metadata of package gulp

      curl -v -u admin http://localhost:8081/nexus/content/repositories/npmjs/gulp
      

      3) Change proxy url to https://registry.npmjs.orgs to make invalid remote response

      4) Making the same request will now fail.

      curl -v -u admin http://localhost:8081/nexus/content/repositories/npmjs/gulp
      

      Making the same call with trailing slash and the cached metadata is served.

      curl -v -u admin http://localhost:8081/nexus/content/repositories/npmjs/gulp/
      

      Issue is that the npm client request for package metadata does not have trailing slash at end of request URL.

      http://localhost:8081/nexus/content/repositories/npmjs/gulp

       

      Expected Behavior
      When proxy remote is not available the npm client request for packages url should return the cached metadata

       

      Workaround

      Make a request through a npm group repository. When remote proxy is unavailable the same request through group repo with no trailing slash works fine (cached metadata is returned)

      http://localhost:8081/nexus/content/repositories/npm-group/gulp

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            msurani Mahendra Surani
            Last Updated By:
            Rich Seddon Rich Seddon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title