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

PyPi component upload rest api fails with NPE

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.11.0
    • Fix Version/s: 3.12.0
    • Component/s: REST
    • Labels:
      None

      Description

      Found while writing an IT that trying to upload the sample-1.2.0-py2.7.egg file from the it test data, is failing with an NPE when uploaded via the rest api.

      java.lang.NullPointerException: null
              at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
              at org.sonatype.nexus.repository.pypi.PyPiUploadHandler.lambda$0(PyPiUploadHandler.java:75)
              at org.sonatype.nexus.transaction.OperationPoint.proceed(OperationPoint.java:64)
              at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:56)
              at org.sonatype.nexus.transaction.Operations.transactional(Operations.java:200)
              at org.sonatype.nexus.transaction.Operations.call(Operations.java:146)
              at org.sonatype.nexus.repository.pypi.PyPiUploadHandler.handle(PyPiUploadHandler.java:70)
              at org.sonatype.nexus.repository.upload.internal.UploadManagerImpl.handle(UploadManagerImpl.java:71)
              at org.sonatype.nexus.repository.rest.internal.resources.ComponentsResource.uploadComponent(ComponentsResource.java:255)
              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:498)
              at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:294)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:248)
              at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:235)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:402)
              at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:209)
              at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
              at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
              at org.sonatype.nexus.siesta.internal.resteasy.ComponentContainerImpl.service(ComponentContainerImpl.java:106)
              at org.sonatype.nexus.siesta.SiestaServlet.service(SiestaServlet.java:137)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
              at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
              at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
              at com.google.inject.servlet.DynamicServletPipeline.service(DynamicServletPipeline.java:71)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
              at com.sonatype.nexus.analytics.internal.RestRequestCollector.doFilter(RestRequestCollector.java:86)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
              at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
              at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
              at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
              at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
              at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
              at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
              at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
              at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
              at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
              at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:85)
              at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
              at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
              at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
              at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
              at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
              at org.sonatype.nexus.security.SecurityFilter.doFilterInternal(SecurityFilter.java:101)
              at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at com.sonatype.nexus.licensing.internal.LicensingRedirectFilter.doFilter(LicensingRedirectFilter.java:108)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at org.sonatype.nexus.internal.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:68)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at org.sonatype.nexus.internal.web.EnvironmentFilter.doFilter(EnvironmentFilter.java:101)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at org.sonatype.nexus.internal.web.HeaderPatternFilter.doFilter(HeaderPatternFilter.java:98)
              at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
              at com.google.inject.servlet.DynamicFilterPipeline.dispatch(DynamicFilterPipeline.java:104)
              at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
              at org.sonatype.nexus.bootstrap.osgi.DelegatingFilter.doFilter(DelegatingFilter.java:73)
              at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:175)
              at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
              at org.eclipse.jetty.server.Server.handle(Server.java:530)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
              at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)
              at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)
              at java.lang.Thread.run(Thread.java:745)
      

      I also manually uploaded using a dedicated rest client and observed the exact same issue.

      Note that uploading this same file from the UI works just fine, however

      Note this is probably an issue in earlier versions as well, I just haven't checked anything prior to 3.11

        Attachments

          Activity

            People

            Assignee:
            dbradicich Damian Bradicich
            Reporter:
            dbradicich Damian Bradicich
            Last Updated By:
            Peter Lynch Peter Lynch
            Team:
            Nexus - UX
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title