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

NullPointerException on npm search when invalidating cache

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.1
    • Fix Version/s: 3.4.0
    • Component/s: NPM
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      Formats Team - Sprint 95, Formats Team - Sprint 96

      Description

      While investigating https://issues.sonatype.org/browse/NEXUS-12716 I found another NPE when running npm search.

      When npm search is run against a group containing a proxy the following stack is outputted but the search runs successfully:

      2017-05-17 09:04:35,695+0100 ERROR [event-7-thread-18] anonymous com.google.common.eventbus.EventBus.nexus.async - Could not dispatch event com.sonatype.nexus.repository.npm.internal.NpmSearchIndexInvalidatedEvent@68784d5f to subscriber com.sonatype.nexus.repository.npm.internal.NpmSearchIndexFacetGroup$$EnhancerByGuice$$2aa2ef56@326797d7 method [public void com.sonatype.nexus.repository.npm.internal.NpmSearchIndexFacetGroup.on(com.sonatype.nexus.repository.npm.internal.NpmSearchIndexInvalidatedEvent)]
      java.lang.NullPointerException: null
              at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770) [com.google.guava:21.0.0]
              at org.sonatype.nexus.repository.FacetSupport.getRepository(FacetSupport.java:62) [na:na]
              at org.sonatype.nexus.repository.FacetSupport.facet(FacetSupport.java:213) [na:na]
              at com.sonatype.nexus.repository.npm.internal.NpmSearchIndexFacetGroup.on(NpmSearchIndexFacetGroup.java:77) [na:na]
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.8.0_121]
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0_121]
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0_121]
              at java.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0_121]
              at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [na:na]
              at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [na:na]
              at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40) [org.sonatype.nexus.thread:3.3.1.SNAPSHOT]
              at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [org.apache.shiro.core:1.3.2]
              at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [org.apache.shiro.core:1.3.2]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
      

      This has something to do with the fact that the proxy fires the search index invalidation event while the group is in the middle of building its search index, although it is not immediately obvious how the repository field could ever be null.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jtom Joe Tom
              Reporter:
              jstephens Joseph Stephens
              Last Updated By:
              Peter Lynch
              Team:
              Nexus - Formats
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title