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

PublishMavenIndexTask failures may leave bad blob refs in the component database causing MissingBlobException

    Details

    • Story Points:
      0

      Description

      Due to NEXUS-16303, The publish Maven indexes task may fail - and under certain circumstances can leave bad blob refs in the component database.

      2018-03-16 12:15:45,839-0300 ERROR [quartz-5-thread-2] *SYSTEM org.sonatype.nexus.repository.maven.tasks.PublishMavenIndexTask - Failed to run task 'Publish Maven indexes of *' on repository 'cris-maven-group'
      org.sonatype.nexus.repository.storage.RetryDeniedException: Reached max retries: 8/8
      	at org.sonatype.nexus.repository.storage.StorageTxImpl.allowRetry(StorageTxImpl.java:224)
      	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.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53)
      	at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:69)
      	at com.sun.proxy.$Proxy206.allowRetry(Unknown Source)
      	at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:81)
      	at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:54)
      	at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher$Maven2WritableResource.read(MavenIndexPublisher.java:446)
      	at org.apache.maven.index.reader.Utils.loadProperties(Utils.java:87)
      	at org.apache.maven.index.reader.IndexReader.<init>(IndexReader.java:68)
      	at org.sonatype.nexus.repository.maven.internal.MavenIndexPublisher.publishMergedIndex(MavenIndexPublisher.java:175)
      	at org.sonatype.nexus.repository.maven.internal.group.IndexGroupFacet.publishIndex(IndexGroupFacet.java:58)
      	at org.sonatype.nexus.repository.maven.tasks.PublishMavenIndexTask.execute(PublishMavenIndexTask.java:37)
      	at org.sonatype.nexus.repository.RepositoryTaskSupport.execute(RepositoryTaskSupport.java:73)
      	at org.sonatype.nexus.scheduling.TaskSupport.call(TaskSupport.java:93)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.doExecute(QuartzTaskJob.java:145)
      	at org.sonatype.nexus.quartz.internal.task.QuartzTaskJob.execute(QuartzTaskJob.java:108)
      	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      	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:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.sonatype.nexus.repository.storage.MissingBlobException: Blob maven2-cris-snapshots@4F4F21E0-97AFAD74-1D65581A-9EBB696D-90C3FFEB:67cc342d-991f-4953-9f4a-d69073aa8012 exists in metadata, but is missing from the blobstore
      	at org.sonatype.nexus.repository.storage.StorageTxImpl.requireBlob(StorageTxImpl.java:918)
      	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.sonatype.nexus.common.stateguard.SimpleMethodInvocation.proceed(SimpleMethodInvocation.java:53)
      	at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39)
      	at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270)
      	at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53)
      	at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63)
      	at com.sun.proxy.$Proxy206.requireBlob(Unknown Source)
      	at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.get(MavenFacetImpl.java:183)
      	at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
      	... 20 common frames omitted
      
      

      The bad blob ref gets left behind:

      orientdb {db=component}> select from asset where blob_ref = 'default@73108758-244CE9AA-60CD5592-602F1528-C5A865FE:479b303c-cac1-42d5-8df4-fbbd6c8f93ee'
      
      
      0 item(s) found. Query executed in 0.012 sec(s).
      orientdb {db=component}> select from asset where blob_ref = 'maven2-cris-snapshots@4F4F21E0-97AFAD74-1D65581A-9EBB696D-90C3FFEB:67cc342d-991f-4953-9f4a-d69073aa8012'
      
      +----+-----+------+----+------+------+---------+---------+---------+---------+---------+---------+---------+---------+---------------+---------------------------+------------------------------------------------------+
      |#   |@RID |@CLASS|size|bucket|format|component|created_b|created_b|last_upda|last_down|blob_crea|blob_upda|content_t|name           |blob_ref                   |attributes                                            |
      +----+-----+------+----+------+------+---------+---------+---------+---------+---------+---------+---------+---------+---------------+---------------------------+------------------------------------------------------+
      |0   |#52:0|asset |187 |#39:1 |maven2|         |system   |system   |2018-0...|2018-0...|2018-0...|2018-0...|text/x...|.index/nexus...|maven2-cris-snapshots@4F...|{provenance={hashes_not_verified=false}, checksum={...|
      +----+-----+------+----+------+------+---------+---------+---------+---------+---------+---------+---------+---------+---------------+---------------------------+------------------------------------------------------+
      
      1 item(s) found. Query executed in 0.004 sec(s).
      

      Expected

      The PublishMavenIndexTask should never leave bad blob refs in the component DB on any error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jstephens Joseph Stephens
              Reporter:
              plynch Peter Lynch
              Last Updated By:
              zhanghb4 zhanghb4
              Team:
              NXRM - Cypher
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title