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

Upgrade fails with NPE if user has a group repository that contains only staging repositories

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.0, 3.3.1
    • Fix Version/s: 3.6.1
    • Component/s: Migration
    • Labels:
      None
    • Story Points:
      2

      Description

      A user has a group repository that contains only staging repositories:

          <repository>
            <id>Test_Profile</id>
            <name>Test Profile</name>
            <providerRole>org.sonatype.nexus.proxy.repository.GroupRepository</providerRole>
            <providerHint>maven2</providerHint>
            <localStatus>IN_SERVICE</localStatus>
            <notFoundCacheTTL>15</notFoundCacheTTL>
            <userManaged>true</userManaged>
            <exposed>true</exposed>
            <browseable>true</browseable>
            <writePolicy>READ_ONLY</writePolicy>
            <indexable>true</indexable>
            <localStorage>
              <provider>file</provider>
            </localStorage>
            <externalConfiguration>
              <memberRepositories>
                <memberRepository>test-1001</memberRepository>
              </memberRepositories>
            </externalConfiguration>
          </repository>
      
      

      The upgrade wizard allows this group repository to be selected (see screenshot).

      And then the upgrade subsequently fails with an NPE because the group repository cannot be found.

      Note: I had to patch the server to add extra logging to find out what repository caused this problem, because the repository ID was not printed in the log.

      2017-01-05 09:40:18,254-0600 WARN [plan-executor-8-thread-3] admin com.sonatype.nexus.migration.repository.RepositoryPrepareStep - Prepare repository for upgrade: BNPPF_Local_Assets_Snapshots failed
      org.sonatype.goodies.common.MultipleFailures$MultipleFailuresException: Failed to validate facets; 1 failure
      at org.sonatype.goodies.common.MultipleFailures.maybePropagate(MultipleFailures.java:95) [org.sonatype.goodies.common:2.2.3]
      at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:171) [na:na]
      at org.sonatype.nexus.repository.manager.internal.RepositoryManagerImpl.update(RepositoryManagerImpl.java:306) [na:na]
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39) [org.sonatype.nexus.common:3.2.0.01]
      at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270) [org.sonatype.nexus.common:3.2.0.01]
      at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53) [org.sonatype.nexus.common:3.2.0.01]
      at org.sonatype.nexus.repository.manager.RepositoryManager$update$4.call(Unknown Source) [na:na]
      at com.sonatype.nexus.migration.repository.RepositoryPrepareStep.allowWrite(RepositoryPrepareStep.groovy:155) [com.sonatype.nexus.plugins.nexus-migration-plugin:3.2.0.01]
      at sun.reflect.GeneratedMethodAccessor362.invoke(Unknown Source) [na:na]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_102]
      at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_102]
      at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) [groovy-all:2.4.7]
      at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) [groovy-all:2.4.7]
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) [groovy-all:2.4.7]
      at com.sonatype.nexus.migration.repository.RepositoryPrepareStep.doRun(RepositoryPrepareStep.groovy:134) [com.sonatype.nexus.plugins.nexus-migration-plugin:3.2.0.01]
      at com.sonatype.nexus.migration.plan.Step.run(Step.groovy:271) [com.sonatype.nexus.plugins.nexus-migration-plugin:3.2.0.01]
      at com.sonatype.nexus.migration.plan.Step$run$1.call(Unknown Source) [na:na]
      at com.sonatype.nexus.migration.plan.StepExecutor.runSync(StepExecutor.groovy:168) [na:na]
      at sun.reflect.GeneratedMethodAccessor294.invoke(Unknown Source) [na:na]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_102]
      at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_102]
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) [na:na]
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) [groovy-all:2.4.7]
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) [groovy-all:2.4.7]
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) [groovy-all:2.4.7]
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) [groovy-all:2.4.7]
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) [groovy-all:2.4.7]
      at com.sonatype.nexus.migration.plan.StepExecutor$_runAsync_closure1.doCall(StepExecutor.groovy:197) [com.sonatype.nexus.plugins.nexus-migration-plugin:3.2.0.01]
      at com.sonatype.nexus.migration.plan.StepExecutor$_runAsync_closure1.doCall(StepExecutor.groovy) [com.sonatype.nexus.plugins.nexus-migration-plugin:3.2.0.01]
      at sun.reflect.GeneratedMethodAccessor303.invoke(Unknown Source) [na:na]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_102]
      at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_102]
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) [na:na]
      at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) [groovy-all:2.4.7]
      at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) [groovy-all:2.4.7]
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) [groovy-all:2.4.7]
      at groovy.lang.Closure.call(Closure.java:414) [groovy-all:2.4.7]
      at groovy.lang.Closure.call(Closure.java:408) [groovy-all:2.4.7]
      at groovy.lang.Closure.run(Closure.java:495) [groovy-all:2.4.7]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_102]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_102]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_102]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_102]
      at java.lang.Thread.run(Thread.java:745) [na:1.8.0_102]
      Suppressed: java.lang.NullPointerException: null
      at org.sonatype.nexus.repository.group.GroupFacetImpl.validateGroupDoesNotContainItself(GroupFacetImpl.java:124) [org.sonatype.nexus.repository:3.2.0.01]
      at org.sonatype.nexus.repository.group.GroupFacetImpl.doValidate(GroupFacetImpl.java:107) [org.sonatype.nexus.repository:3.2.0.01]
      at org.sonatype.nexus.repository.FacetSupport.validate(FacetSupport.java:113) [org.sonatype.nexus.repository:3.2.0.01]
      at org.sonatype.nexus.common.stateguard.MethodInvocationAction.run(MethodInvocationAction.java:39) [org.sonatype.nexus.common:3.2.0.01]
      at org.sonatype.nexus.common.stateguard.StateGuard$GuardImpl.run(StateGuard.java:270) [org.sonatype.nexus.common:3.2.0.01]
      at org.sonatype.nexus.common.stateguard.GuardedInterceptor.invoke(GuardedInterceptor.java:53) [org.sonatype.nexus.common:3.2.0.01]
      at org.sonatype.nexus.repository.manager.internal.RepositoryImpl.validate(RepositoryImpl.java:160) [na:na]
      ... 42 common frames omitted
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title