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

BackfillBlobStoreTask replication.blobattributesbackfill task can fail because it assumes a blobstore will never have corrupt blobs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.34.0
    • Fix Version/s: 3.35.0
    • Component/s: Replication
    • Labels:
    • Notability:
      2

      Description

      If the backfill task tries to process a blob in a blobstore, and the blob attributes for that blob do not have the expected attributes required by the task ( ie. bucket.repo-name ) then the task will fail. For example like this:

      2021-09-15 13:40:10,323-0400 ERROR [quartz-23-thread-20]  *SYSTEM com.sonatype.nexus.replication.internal.BlobAttributeBackfillTask - Blob attribute backfill task did not complete successfully
      java.util.concurrent.ExecutionException: java.lang.NullPointerException
      	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
      	at com.sonatype.nexus.replication.internal.BlobAttributeBackfillTask.processBlobs(BlobAttributeBackfillTask.java:126)
      	at com.sonatype.nexus.replication.internal.BlobAttributeBackfillTask.execute(BlobAttributeBackfillTask.java:96)
      	at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:100)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:143)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:106)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	at org.sonatype.nexus.quartz.internal.QuartzThreadPool.lambda$0(QuartzThreadPool.java:145)
      	at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
      	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
      	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NullPointerException: null
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
      	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
      	... 15 common frames omitted
      Caused by: java.lang.NullPointerException: null
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
      	at java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:677)
      	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:735)
      	at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:160)
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:174)
      	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
      	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
      	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:583)
      	at com.sonatype.nexus.replication.internal.BlobAttributeBackfillTask.lambda$1(BlobAttributeBackfillTask.java:126)
      	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
      	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
      	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
      	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
      	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
      Caused by: java.lang.NullPointerException: null
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:880)
      	at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.get(RepositoryManagerImpl.java:330)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:272)
      	at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
      	at com.sonatype.nexus.replication.internal.db.orient.OrientBlobAttributeBackfillService.backfillBlobAttributes(OrientBlobAttributeBackfillService.java:51)
      	at com.sonatype.nexus.replication.internal.BlobAttributeBackfillTask.lambda$0(BlobAttributeBackfillTask.java:97)
      	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
      	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
      	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
      	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
      	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
      	... 4 common frames omitted
      

      Expected

      A blobstore can contain corrupt blob attributes. Suggest logging the problem blob id and file location as a WARN, ignore the problem and process the next blob, while not failing the task.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              Hajime Osako Hajime Osako
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title