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

npm hosted repository package metadata tarball URLs incorrectly contain generated-on-request placeholder after upgrade

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.14.2, 3.2.0
    • Fix Version/s: 3.2.1
    • Component/s: NPM
    • Labels:
    • Story Points:
      3
    • Sprint:
      Sprint 85, Sprint 86

      Description

      NEXUS-11874 fixed an error which prevented some npm hosted packages from being migrated from 2.x to 3.x if the "Rebuild npm hosted metadata" task had been run on the source repository.

      Now an upgrade with Nexus Repository Manager 2.14.2 to 3.2.0, will migrate those hosted packages instead of failing the repository migration. However there is a new problem. When the package metadata for hosted npm packages are requested from Nexus 3, the tarball URLs may not be rewritten correctly and will contain invalid URLs which contain the internal placeholder term: "generated-on-request".

      1. Deploy an npm package to a Nexus Repository Manager 2.x npm hosted repository.
      2. Schedule and run at least one "Rebuild npm hosted metadata" task against the Nexus Repository Manager 2.x npm hosted repository.
      3. Migrate the npm hosted repository to Nexus 3.2.0.
      4. Request the root level package metadata of a migrated package. The tarball URLs will contain the term "generated-on-request" instead of the expected tarball file name.

      Example bad metadata
      {"maintainers":[{"name":"admin","email":"my@example.com"}],"x-nx-rebuilt":"2016-12-27T17:48:01.866-0400","keywords":["test1"],"dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"testproject1","version":"0.0.1","description":"Test Project 1","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 0"},"dependencies":{"commonjs":"0.0.1"},"publishConfig":{"registry":"http://localhost:8081/nexus/content/repositories/npm-hosted/"},"keywords":["test1"],"author":{"name":"cstamas"},"license":"ISC","readme":"ERROR: No README data found!","_id":"testproject1@0.0.1","_shasum":"8bec15747a094d7720fc8a4d8e785b6ea5e23b85","_from":".","_npmVersion":"4.0.5","_nodeVersion":"0.12.2","_npmUser":{"name":"admin","email":"my@example.com"},"maintainers":[{"name":"admin","email":"my@example.com"}],"dist":{"shasum":"8bec15747a094d7720fc8a4d8e785b6ea5e23b85","tarball":"http://localhost:8091/repository/npm-hosted/testproject1/-/generated-on-request"}}},"name":"testproject1","_rev":"1","description":"Test Project 1","_id":"testproject1","readme":"ERROR: No README data found!","time":{"created":"2016-12-27T21:34:40.348Z","modified":"2016-12-27T21:48:01.870Z","0.0.1":"2016-12-27T21:34:40.348Z"}}
      

      The invalid URLs will of course return 404 and therefore builds which previously worked using Nexus 2 will fail when used with Nexus 3.

      Expected

      Package metadata migrated from Nexus 2 should render with proper tarball urls.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ecobb Eric Cobb
                Reporter:
                plynch Peter Lynch
                Last Updated By:
                Dulani Wallace
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: