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

First staging move to npm hosted repo fails with 500 error.

    XMLWordPrintable

    Details

      Description

      First staging move to npm hosted repo fails with 500 error, but the npm package is moved. Subsequent staging move works, but artifact remains in the previous repo (the one that failed with 500 error), which is also wrong.

       

      Steps to reproduce

      1) Create 3 hosted npm repos (npm-dev, npm-uat, npm-prod) with "Disable redeploy" amd all on the same blobstore.

      2) Create a tag "test-tag"

      3) Upload a new npm package using the UI and assigning tag "test-tag" during upload

      4) Move from npm-dev to npm-uat

      curl -v -u admin:admin123 -X POST http://127.0.0.1:8081/service/rest/v1/staging/move/npm-uat?tag=test-tag

      This will fail with a 500 response. You will see that the npm package does not exist in npm-dev and has been moved to npm-uat. Nexus log show warnings like belowL

      2020-02-04 15:45:58,873+0000 WARN  [qtp1217129166-52] admin org.sonatype.nexus.blobstore.file.FileBlobStore - Attempt to access non-existent blob e945860d-fc84-4585-901e-a3c037a537b2 (/sonatype-work/nexus3/blobs/custom/NPM_NPRD/content/vol-27/chap-31/e945860d-fc84-4585-901e-a3c037a537b2.properties)

      2020-02-04 15:45:58,877+0000 WARN  [qtp1217129166-52] admin org.sonatype.nexus.siesta.internal.UnexpectedExceptionMapper - (ID 620dfb4b-c611-40d6-b7ba-a309a4036f31) Unexpected exception: java.lang.NullPointerException

      java.lang.NullPointerException: null

      at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:882)

      at org.sonatype.nexus.repository.npm.internal.NpmComponentDirector.lambda$1(NpmComponentDirector.java:75)

      at com.google.common.collect.Iterables$4.lambda$forEach$0(Iterables.java:568)

      at com.google.common.collect.Iterables$5.lambda$forEach$0(Iterables.java:707)

      at java.lang.Iterable.forEach(Iterable.java:75)

      at com.google.common.collect.Iterables$5.forEach(Iterables.java:707)

      at com.google.common.collect.Iterables$4.forEach(Iterables.java:565)

      at org.sonatype.nexus.repository.npm.internal.NpmComponentDirector.lambda$0(NpmComponentDirector.java:74)

      at java.util.Optional.ifPresent(Optional.java:159)

      at org.sonatype.nexus.repository.npm.internal.NpmComponentDirector.afterMove(NpmComponentDirector.java:72)

      at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:57)

      at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)

      at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)

      at com.sonatype.nexus.staging.internal.StagingComponentManager.move(StagingComponentManager.java:94)

      at com.sonatype.nexus.staging.internal.StagingService.doMove(StagingService.java:397)

      5) Try moving from npm-uat to npm-prod

      curl -v -u admin:admin123 -X POST http://127.0.0.1:8081/service/rest/v1/staging/move/npm-prod?tag=test-tag

      This returns a 200 response and you see the npm package in npm-prod, but the issue is that you also see it npm-uat, which is a bug.

      You can now download that component from npm-uat and npm-prod.

       

       

        Attachments

          Activity

            People

            Assignee:
            moncef Moncef Ben-Soula
            Reporter:
            msurani Mahendra Surani
            Last Updated By:
            Wes Wannemacher
            Team:
            NXRM - Neo
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title