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

NPE when parsing the metadata of the "build" npm package because readme is null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.16.2
    • Fix Version/s: 3.17.0
    • Component/s: NPM
    • Labels:

      Description

      Create a proxy repository against https://registry.npmjs.org, and put that proxy in a group repository.  

      Request the "build" package metadata through the group repository:  https://localhost:8081/repository/npm-group/build

      This will result in an NPE.

      The reason for this is that the "readme" attribute in the JSON has value null:

      {
          "_id": "build",
          "_rev": "21-274f1973001a5071786c42531c647694",
          "author": {
              "email": "jon@solagratiadesigns.com",
              "name": "Jonathan Bomgardner",
              "url": "http://solagratiadesigns.com"
          },
          "description": "An ant-like build program for node",
          "dist-tags": {
              "latest": "0.1.4"
          },
          "maintainers": [
              {
                  "email": "jon@solagratiadesigns.com",
                  "name": "jonlb"
              }
          ],
          "name": "build",
          "readme": null,
      
          "repository": {
              "type": "git",
              "url": "git://github.com/jonlb/node-build.git"
          },
      

       
      Stack trace observed:

      2019-06-19 13:29:02,703+0200 WARN [qtp803656153-224395] *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /nexus/repository/build.releases.npm/build
      java.lang.NullPointerException: null
      at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:882)
      at org.sonatype.nexus.repository.npm.internal.NpmResponses.ok(NpmResponses.java:62)
      at sun.reflect.GeneratedMethodAccessor153.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151)
      at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:209)
      at org.sonatype.nexus.repository.npm.internal.NpmGroupPackageHandler.buildMergedPackageRoot(NpmGroupPackageHandler.groovy:77)
      at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)

      ...

      Caused by: java.lang.NullPointerException: while trying to invoke the method com.fasterxml.jackson.databind.deser.NullValueProvider.getNullValue(com.fasterxml.jackson.databind.DeserializationContext) of a null object loaded from field com.fasterxml.jackson.databind.deser.std.MapDeserializer._nullProvider of an object loaded from local variable 'this'
      at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:525)
      ... 123 common frames omitted

       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title