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

migrator attempts to migrate tagged components before tags have been processed resulting in NullPointerException executing step processComponentStep

    XMLWordPrintable

    Details

    • Story Points:
      5
    • Sprint:
      NXRM Rocket Sprint 16
    • Notability:
      2

      Description

      Error when migrating from orient to h2 database

      15:18:23 [main] ERROR o.s.batch.core.step.AbstractStep - Encountered an error executing step processComponentStep in job migrationFromOrientJob
      java.lang.NullPointerException: null
              at com.sonatype.nexus.db.migrator.writer.ComponentWriter.lambda$writeByFormat$0(ComponentWriter.java:65)
              at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
              at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
              at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
              at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
              at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
              at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
              at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
              at com.sonatype.nexus.db.migrator.writer.ComponentWriter.writeByFormat(ComponentWriter.java:66)
              at com.sonatype.nexus.db.migrator.writer.ComponentWriter.write(ComponentWriter.java:51)
              at org.springframework.batch.item.support.ClassifierCompositeItemWriter.write(ClassifierCompositeItemWriter.java:69)
              at org.springframework.batch.core.step.item.SimpleChunkProcessor.writeItems(SimpleChunkProcessor.java:193)
              at org.springframework.batch.core.step.item.SimpleChunkProcessor.doWrite(SimpleChunkProcessor.java:159)
              at org.springframework.batch.core.step.item.SimpleChunkProcessor.write(SimpleChunkProcessor.java:294)
              at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:217)
              at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:77)
              at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:407)
              at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:331)
              at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
              at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
              at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
              at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
              at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
              at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
              at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
              at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
              at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
              at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68)
              at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68)
              at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169)
              at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
              at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:137)
              at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:319)
              at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:147)
              at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
              at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:140)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
              at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
              at com.sun.proxy.$Proxy49.run(Unknown Source)
              at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.execute(JobLauncherCommandLineRunner.java:192)
              at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.executeLocalJobs(JobLauncherCommandLineRunner.java:166)
              at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.launchJobFromProperties(JobLauncherCommandLineRunner.java:153)
              at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.run(JobLauncherCommandLineRunner.java:148)
              at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:784)
              at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:768)
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
              at com.sonatype.nexus.db.migrator.MigratorApplication.main(MigratorApplication.java:61)
      

      Diagnosis

      The db migrator was attempting to migrate tagged components before tags had been processed.

      Expected

      The migrator should migrate tags before components which should avoid the problem.

        Attachments

          Activity

            People

            Assignee:
            ybulatnikov Eugene Bulatnikov
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Rich Seddon Rich Seddon
            Team:
            NXRM - Rocket Raccoon
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title