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

NPE When Installing Gem with no Date Attribute

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.10.0, 3.15.2
    • Fix Version/s: 3.16.0
    • Component/s: RubyGems
    • Labels:
    • Story Points:
      1

      Description

      When attempting to install a gem that does not contain a date attribute in its spec file a NullPointerException is thrown e.g.

      *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /content/groups/gems-all/gems/linux-kstat-0.2.1-universal-linux.gem
      java.lang.NullPointerException: null
       at org.sonatype.nexus.repository.rubygems.marshal.RubyTime.from(RubyTime.java:131)
       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:497)
       at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
       at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
       at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
       at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:91)
       at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
       at org.sonatype.nexus.repository.rubygems.marshal.GemSpecification.<init>(GemSpecification.groovy:81)
       at org.sonatype.nexus.repository.rubygems.internal.GemsUtils.retrieveGemSpecification(GemsUtils.java:188)
       at org.sonatype.nexus.repository.rubygems.internal.RubygemsProxyFacet.getComponentGemAsset(RubygemsProxyFacet.java:256)
       at org.sonatype.nexus.repository.rubygems.internal.RubygemsProxyFacet.doStore(RubygemsProxyFacet.java:183)
       at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
       at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:54)
       at org.sonatype.nexus.repository.rubygems.internal.RubygemsProxyFacet.store(RubygemsProxyFacet.java:169)
       at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.doGet(ProxyFacetSupport.java:222)
       at org.sonatype.nexus.repository.rubygems.internal.RubygemsProxyFacet.doGet(RubygemsProxyFacet.java:159)

      To reproduce with example linux-kstat v0.2.1 gem:

      1. Configure proxy repo for https://rubygems.org
      2. On a linux env, run gem install e.g.
      3. gem install linux-kstat -v 0.2.1 -s http://localhost:8081/repository/rubygems-proxy/

      Expected:

      Nexus should handle cases where gem spec does not contain expected values.

        Attachments

          Activity

            People

            Assignee:
            mdodgson Mark Dodgson
            Reporter:
            hardeepn Hardeep Nagra
            CC:
            Christopher Stanley
            Last Updated By:
            Rich Seddon Rich Seddon
            Team:
            NXRM - Cypher
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title