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

Yum hosted metadata cleanup causes IllegalStateException Missing entity-metadata when there are at least two hosted repositories

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.36.0, 3.37.0
    • Fix Version/s: 3.38.0
    • Component/s: Yum
    • Labels:
    • Story Points:
      3
    • Sprint:
      NXRM MadMax Sprint 23, NXRM MadMax Sprint 25

      Description

      Step to reproduce.

      Orient and newDB

      • Create two yum hosted repositories
        hosted1 and hosted2 for example
      • Upload several packages to hosted1 and same packages to hosted2
        for example: nano, ant, cython and GeoIP
      • Waiting for metadata to complete
      • Remove nano from hosted1 and cython from hosted2
      • Waiting for metadata to complete and cleanup (60 + 30 sec by default)

      Actual:

      NXRM contains errors

      2021-11-29 12:25:38,569+0200 ERROR [event-13-thread-16] admin com.google.common.eventbus.EventBus.nexus.async - Could not dispatch event org.sonatype.nexus.repository.yum.orient.internal.createrepo.YumCleanUpMetadataEvent@1a6073f6 to subscriber org.sonatype.nexus.repository.yum.orient.internal.createrepo.OrientCreateRepoFacetImpl$$EnhancerByGuice$$1805150465@2e1b2ca2 method [public void org.sonatype.nexus.repository.yum.orient.internal.createrepo.OrientCreateRepoFacetImpl.on(org.sonatype.nexus.repository.yum.orient.internal.createrepo.YumCleanUpMetadataEvent)]
      java.lang.IllegalStateException: Missing entity-metadata
              at com.google.common.base.Preconditions.checkState(Preconditions.java:510)
              at org.sonatype.nexus.common.entity.EntityHelper.metadata(EntityHelper.java:46)
              at org.sonatype.nexus.common.entity.EntityHelper.id(EntityHelper.java:62)
              at org.sonatype.nexus.repository.storage.StorageTxImpl.deleteAsset(StorageTxImpl.java:660)
              at org.sonatype.nexus.repository.storage.StorageTxImpl.deleteAsset(StorageTxImpl.java:648)
              at org.sonatype.nexus.repository.storage.StorageTxImpl.deleteAsset(StorageTxImpl.java:642)
              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:272)
              at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
              at org.sonatype.nexus.common.stateguard.StateGuardAspect$1.invoke(StateGuardAspect.java:63)
              at com.sun.proxy.$Proxy240.deleteAsset(Unknown Source)
              at java.util.ArrayList.forEach(ArrayList.java:1259)
              at org.sonatype.nexus.repository.yum.orient.internal.hosted.OrientYumHostedFacetImpl.deleteAllGeneratedMetadata(OrientYumHostedFacetImpl.java:228)
              at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:58)
              at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)
              at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
              at org.sonatype.nexus.repository.yum.orient.internal.createrepo.OrientCreateRepoFacetImpl.on(OrientCreateRepoFacetImpl.java:247)
              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 com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:87)
              at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:144)
              at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:72)
              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.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
              at java.lang.Thread.run(Thread.java:748)
      
      

      Expected:

      1. NXRM has no errors.
      2. Metadata rebuild and cleanup work without any issues.
      3. Packages can be installed through yum client
      4. Orient and newDB are fixed

       

      This is a regression NEXUS-24332

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mlukaretkyi Maksym Lukaretkyi
              Reporter:
              mlukaretkyi Maksym Lukaretkyi
              CC:
              David Milet
              Last Updated By:
              Daolong Qiu Daolong Qiu
              Team:
              NXRM - Mad Max
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title