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

invalid nexus 2.x npm packages will fail the upgrade to nexus 3.x with 500 internal server error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.14.2, 3.2.0
    • Fix Version/s: 2.14.4
    • Component/s: Migration
    • Labels:
    • Story Points:
      1
    • Sprint:
      Sprint 91, Platform Team - Sprint 92

      Description

      An invalid npm package causes the migration to Nexus 3 fail with a 500 error.

      2017-03-07 06:56:58,371+0100 WARN  [plan-executor-8-thread-2] admin com.sonatype.nexus.migration.repository.ProcessChangesStep - Process changes failed
      javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
          at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:209) [na:na]
          at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:174) [na:na]
          at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:59) [na:na]
          at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104) [na:na]
          at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:64) [na:na]
          at com.sonatype.nexus.migration.client.$Proxy199.get(Unknown Source) [com.sonatype.nexus.plugins.nexus-migration-plugin:3.2.0.01]
      

      The cause of issue is shown in the Nexus 2 logs

      2017-03-07 06:56:58,318+0100 WARN  [qtp271176893-1024] *UNKNOWN org.sonatype.sisu.siesta.server.internal.mappers.ThrowableExceptionMapper - java.lang.IllegalStateException: PackageVersion expected for npm tarball /somecompany-stilguide/-rev/undefined
      java.lang.IllegalStateException: PackageVersion expected for npm tarball /somecompany-stilguide/-rev/undefined
          at com.google.common.base.Preconditions.checkState(Preconditions.java:200) ~[guava-16.0.1.jar:na]
          at com.sonatype.nexus.migrationagent.repository.migrators.NpmRepositoryMigrator.findVersion(NpmRepositoryMigrator.java:85) ~[na:na]
          at com.sonatype.nexus.migrationagent.repository.migrators.NpmRepositoryMigrator.extract(NpmRepositoryMigrator.java:63) ~[na:na]
          at com.sonatype.nexus.migrationagent.repository.RepositoryMigratorSupport.extract(RepositoryMigratorSupport.java:251) ~[na:na]
          at com.sonatype.nexus.migrationagent.repository.RepositoryMigrator$extract$2.call(Unknown Source) ~[na:na]
          at com.sonatype.nexus.migrationagent.rest.RepositoryChangelogResource$_get_closure1$_closure2.doCall(RepositoryChangelogResource.groovy:117) ~[na:na]
      

      Cause of the issue is the following file:

      sonatype-work/nexus/storage/npm-internal/somecompany-stilguide/-rev/undefined

      This should really not cause a failure. The migration should just log a warning and skip this invalid component.

        Attachments

          Activity

            People

            • Assignee:
              fmilens Frederick Milens
              Reporter:
              msurani Mahendra Surani
              Last Updated By:
              Peter Lynch
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

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