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

Orient to Postgres migration fails due to asset with missing blob reference

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.37.0, 3.38.0
    • Fix Version/s: 3.38.0
    • Component/s: Database Migrator
    • Labels:
    • Story Points:
      2
    • Sprint:
      NXRM Sentinels Sprint 34
    • Notability:
      3
    • InvestmentLayer:
      support-escalated
    • Aha Concept:
      non-concept

      Description

      Orient to Postgres migration fails due to asset with missing blob reference. No useful details are logged and it fails the migration.

       

      16:02:16 [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.processor.content.AssetProcessor.reformatBlobRef(AssetProcessor.java:103)
      	at com.sonatype.nexus.db.migrator.processor.content.AssetProcessor.process(AssetProcessor.java:87)
      	at com.sonatype.nexus.db.migrator.processor.content.AssetProcessor.process(AssetProcessor.java:37)
      	at org.springframework.batch.item.support.ClassifierCompositeItemProcessor.processItem(ClassifierCompositeItemProcessor.java:63)
      	at org.springframework.batch.item.support.ClassifierCompositeItemProcessor.process(ClassifierCompositeItemProcessor.java:54)
      	at org.springframework.batch.item.support.ClassifierCompositeItemProcessor.processItem(ClassifierCompositeItemProcessor.java:63)
      	at org.springframework.batch.item.support.ClassifierCompositeItemProcessor.process(ClassifierCompositeItemProcessor.java:54)
      	at org.springframework.batch.core.step.item.SimpleChunkProcessor.doProcess(SimpleChunkProcessor.java:134)
      	at org.springframework.batch.core.step.item.SimpleChunkProcessor.transform(SimpleChunkProcessor.java:319)
      	at org.springframework.batch.core.step.item.SimpleChunkProcessor.process(SimpleChunkProcessor.java:210)
      	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.$Proxy51.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:76)
      

      Expected Behaviour

      The asset details should be logged and record skipped and then continue with migration

      Workaround

      Connecting to the orient component database, you can check for assets with no blob_ref

      select bucket,name  from asset where blob_ref is null
      

      These records can be deleted with below SQL.

      delete from asset where blob_ref is null
      

       

      Then database migration can be attempted again

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vhashock Vitalii Hashock
              Reporter:
              msurani Mahendra Surani
              Last Updated By:
              Hajime Osako Hajime Osako
              Team:
              NXRM - Sentinels
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title