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

Browsing Group repo whilst member repo is being deleted can result in InvalidStateException

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.35.0
    • Fix Version/s: None
    • Component/s: Browse Storage
    • Labels:
    • Notability:
      3

      Description

      Browsing a group repo via the UI, whilst a member repo is being deleted can result in the following InvalidStateException preventing the UI from correctly loading:

      org.sonatype.nexus.extdirect.internal.ExtDirectExceptionHandler - Failed to invoke action method: coreui_Component.readAsset, java-method: org.sonatype.nexus.coreui.ComponentComponent.readAsset
      org.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED]
       at org.sonatype.nexus.common.stateguard.StateGuard._ensure(StateGuard.java:115)
       at org.sonatype.nexus.common.stateguard.StateGuard.access$1(StateGuard.java:108)
       at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:271)
       at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:54)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.lambda$4(GroupMemberMappingCache.java:127)
       at java.util.Optional.ifPresent(Optional.java:159)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.lambda$3(GroupMemberMappingCache.java:125)
       at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.findContainingGroups(GroupMemberMappingCache.java:125)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.lambda$7(GroupMemberMappingCache.java:138)
       at java.util.ArrayList.forEach(ArrayList.java:1257)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.findContainingGroups(GroupMemberMappingCache.java:138)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.lambda$0(GroupMemberMappingCache.java:105)
       at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:406)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.populateCache(GroupMemberMappingCache.java:101)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.getCache(GroupMemberMappingCache.java:89)
       at org.sonatype.nexus.repository.manager.internal.GroupMemberMappingCache.getGroups(GroupMemberMappingCache.java:76)
       at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.findContainingGroups(RepositoryManagerImpl.java:439)
       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.repository.manager.RepositoryManager$findContainingGroups$1.call(Unknown Source)
       at org.sonatype.nexus.coreui.internal.orient.OrientComponentHelper.ensurePermissions(OrientComponentHelper.groovy:298)
       at sun.reflect.GeneratedMethodAccessor724.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
       at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
       at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
       at org.sonatype.nexus.coreui.internal.orient.OrientComponentHelper.readAsset(OrientComponentHelper.groovy:225)
       at org.sonatype.nexus.coreui.ComponentHelper$readAsset$1.call(Unknown Source)
       at org.sonatype.nexus.coreui.ComponentComponent.readAsset(ComponentComponent.groovy:190)
      

      This is difficult to reproduce as it would require a delete to be invoked at the same time as the UI request e.g.

      2021-10-13 21:39:14,692+0300 INFO  [qtp1286540673-411941]  XXXXX org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl - Deleting repository: xyz
      2021-10-13 21:39:14,712+0300 ERROR [qtp1286540673-414438]  YYYYY org.sonatype.nexus.extdirect.internal.ExtDirectExceptionHandler - Failed to invoke action method: coreui_Component.readComponent, java-method: org.sonatype.nexus.coreui.ComponentComponent.readComponent
      org.sonatype.nexus.common.stateguard.InvalidStateException: Invalid state: STOPPED; allowed: [STARTED]
      

      Expected:

      An event where a member repo is being deleted at the same time as the group repo is being browsed via the UI should not result in an invalid state exception and instead the UI should continue to function as normal i.e. load group components and assets.

       

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hardeepn Hardeep Nagra
            Last Updated By:
            Peter Lynch Peter Lynch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title