Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-22341

NPM ping returns 500 server error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 7.15.3
    • Component/s: None
    • Labels:
    • Severity:
      Medium
    • Release Notes:
      Yes

      Description

      When hitting the URL http://xx.xx.xx.xx:8081/artifactory/api/npm/npm/-/ping

      as used by the npm-ping command https://docs.npmjs.com/cli/ping.html

      Artifactory returns a 500 response and logs a traceback of:

      2020-05-28 18:02:49,223 [http-nio-8081-exec-10] [ERROR] (o.a.r.c.e.m.GlobalExceptionMapper:48) - null
      java.lang.NullPointerException: null
          at org.artifactory.addon.npm.repo.NpmRemoteRepoHandler.replaceTarballUrl(NpmRemoteRepoHandler.java:398)
          at org.artifactory.addon.npm.repo.NpmRemoteRepoHandler.getVersionMetadata(NpmRemoteRepoHandler.java:219)
          at org.artifactory.addon.npm.repo.merge.NpmVersionMetadataMerger.merge(NpmVersionMetadataMerger.java:65)
          at org.artifactory.addon.npm.repo.merge.NpmMetadataMerger.getMergedResult(NpmMetadataMerger.java:67)
          at org.artifactory.addon.npm.repo.NpmVirtualRepoHandler.getVersionMetadata(NpmVirtualRepoHandler.java:83)
          at org.jfrog.repomd.npm.rest.NpmSubResource.packageVersion(NpmSubResource.java:79)
          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.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
          at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
          at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
          at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
          at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
          at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
          at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
          at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
          at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
          at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
          at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
          at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
          at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
          at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
          at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
          at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
          at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
          at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.artifactory.webapp.servlet.RepoFilter.execute(RepoFilter.java:195)
          at org.artifactory.webapp.servlet.RepoFilter.doFilter(RepoFilter.java:97)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.artifactory.webapp.servlet.AccessFilter.useAuthentication(AccessFilter.java:427)
          at org.artifactory.webapp.servlet.AccessFilter.doFilterInternal(AccessFilter.java:214)
          at org.artifactory.webapp.servlet.AccessFilter.doFilter(AccessFilter.java:167)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.artifactory.webapp.servlet.RequestFilter.doFilter(RequestFilter.java:77)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.artifactory.webapp.servlet.ArtifactoryCsrfFilter.doFilter(ArtifactoryCsrfFilter.java:75)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.springframework.session.web.http.SessionRepositoryFilter.doFilterInternal(SessionRepositoryFilter.java:164)
          at org.springframework.session.web.http.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:80)
          at org.artifactory.webapp.servlet.SessionFilter.doFilter(SessionFilter.java:62)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.artifactory.webapp.servlet.ArtifactoryFilter.doFilter(ArtifactoryFilter.java:124)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
          at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:305)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:609)
          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1623)
          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:748) 

       

      Other URLs "nearby" to .../-/ping return 404, so it looks like npm ping support must have some code behind it, but it doesn't seem to be working as intended.

      We ran into this issue when using the https://github.com/release-it/release-it tool, which recently added a npm ping healthcheck before attempting to interact with a repository.  We've disabled these checks as a workaround, but it looks like at the moment that tool (and possibly others? I personally am not super familiar with the node ecosystem) are not usable out of the box with artifactory.  For reference, here is the relevant issue in release-it: https://github.com/release-it/release-it/issues/637

        Attachments

          Activity

              People

              Assignee:
              oleksandrl Oleksandr Legenkiy [EXT]
              Reporter:
              jamur2 Jackie Murphy
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: