Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70074

computer/api results in an error when authenticated

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • versioncolumn-plugin
    • Jenkins 2.361.2 Docker Image
      Running on AWS EC2 Instance
      versioncolumn:83.vf59361a_44b_b_5 or versioncolumn:86.v5a_dd521c4edd
    • 87.v8fe7c090a_d3b

      Recently upgraded to the latest LTS and when logged in to Jenkins (either via a browser or via REST calls) performing GET requests on ${JENKINS_URL}/computer/api/json (and also XML) results in an error message.

       

      Same error with ${JENKINS_URL}/computer/${NODE_NAME}/api/json as well.

      Looking at the logs:

      2022-11-14 10:13:48.247+0000 [id=25650] WARNING o.e.j.s.h.ContextHandler$Context#log: Error while serving https://cloudbuilder.marine.net.int/computer/i-000d0189db58807d1/api/json
              org.kohsuke.stapler.export.NotExportableException: class java.lang.Runtime$Version doesn't have @ExportedBean
              at org.kohsuke.stapler.export.Property.writeValue(Property.java:300)
              at org.kohsuke.stapler.export.Property.writeValue(Property.java:170)
              at org.kohsuke.stapler.export.Property.writeValue(Property.java:268)
              at org.kohsuke.stapler.export.Property.writeValue(Property.java:170)
              at org.kohsuke.stapler.export.Property.writeTo(Property.java:154)
              at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:222)
              at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:218)
              at org.kohsuke.stapler.export.Model.writeTo(Model.java:193)
              at org.kohsuke.stapler.ResponseImpl.writeOne(ResponseImpl.java:306)
              at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:297)
              at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:253)
              at hudson.model.Api.doJson(Api.java:230)
              at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
              at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
          Caused: java.lang.reflect.InvocationTargetException
              at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:401)
              at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
              at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
              at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
              at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:558)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
              at org.kohsuke.stapler.MetaClass$2.doDispatch(MetaClass.java:224)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
              at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:475)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
              at org.kohsuke.stapler.MetaClass$2.doDispatch(MetaClass.java:224)
              at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
              at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:762)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:894)
              at org.kohsuke.stapler.Stapler.invoke(Stapler.java:690)
              at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
              at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:157)
              at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:81)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at com.atlassian.bitbucket.jenkins.internal.applink.oauth.serviceprovider.auth.OAuth1aRequestFilter.doFilter(OAuth1aRequestFilter.java:91)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:60)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239)
              at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:215)
              at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:88)
              at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:121)
              at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
              at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:160)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:160)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:94)
              at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
              at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:106)
              at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:97)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223)
              at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:97)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)
              at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)
              at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:63)
              at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
              at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:111)
              at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:172)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:53)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
              at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
              at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:549)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1378)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1544)
              at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1300)
              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
              at org.eclipse.jetty.server.Server.handle(Server.java:562)
              at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)
              at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)
              at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)
              at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
              at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
              at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
              at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
              at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412)
              at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381)
              at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268)
              at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:138)
              at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:407)
              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
              at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
              at java.base/java.lang.Thread.run(Thread.java:829) 

      Doing this in a private window without authentication works - and also using an unauthenticated REST call will also work.

      We also tried versions 2.361.1 and 2.361.3 with the same error message(s).

          [JENKINS-70074] computer/api results in an error when authenticated

          Mark Waite added a comment - - edited

          Thanks for reporting the issue! I see the same stack trace on Jenkins 2.375 when I open http://mark-pc2.markwaite.net:8080/computer/api/json from an authenticated session and I confirm as you reported that it does not give that stack trace or exception when called from a session that is not authenticated.

          Will need some research to identify the version and the commit that introduced the issue.

          Mark Waite added a comment - - edited Thanks for reporting the issue! I see the same stack trace on Jenkins 2.375 when I open http://mark-pc2.markwaite.net:8080/computer/api/json from an authenticated session and I confirm as you reported that it does not give that stack trace or exception when called from a session that is not authenticated. Will need some research to identify the version and the commit that introduced the issue.

          Elliot added a comment -

          We were previously on 2.360 and it was working fine then - hopefully that helps narrow down which commits!

          Elliot added a comment - We were previously on 2.360 and it was working fine then - hopefully that helps narrow down which commits!

          Mark Waite added a comment -

          Thanks to JENKINS-70075 that assigned the issue to the versioncolumn plugin. The assignment is exactly correct. The versioncolumn plugin 2.2 does not have the issue. The two releases after 2.2 both have the problem. Short term workaround is to use versioncolumn plugin 2.2.

          Mark Waite added a comment - Thanks to JENKINS-70075 that assigned the issue to the versioncolumn plugin. The assignment is exactly correct. The versioncolumn plugin 2.2 does not have the issue. The two releases after 2.2 both have the problem. Short term workaround is to use versioncolumn plugin 2.2.

          Edward Tew added a comment -

          Thanks esloman , I have run the series of releases from 2.377 back through 2.360 including the recent LTS versions and this is the result

          Result Version
          BAD 2.377
          BAD 2.361.4
          BAD 2.361.3
          BAD 2.361.2
          BAD 2.361.1
          BAD 2.377
          BAD 2.361.4
          BAD 2.361.3
          BAD 2.361.2
          BAD 2.361.1
          BAD 2.377
          BAD 2.376
          BAD 2.375
          BAD 2.374
          BAD 2.373
          BAD 2.372
          BAD 2.371
          BAD 2.370
          BAD 2.369
          BAD 2.368
          BAD 2.367
          BAD 2.366
          BAD 2.365
          BAD 2.364
          BAD 2.363
          BAD 2.362
          GOOD 2.361
          GOOD 2.360

          So, it looks like something happened about the time of the LTS release.

          My method of testing was with the Docker images and a bash loop.

          Using curl to check the availability of the built in Agent computer api

          NOAUTH_OK=$(curl --write-out '%{http_code}' --connect-timeout 3 --silent --output /dev/null 'http://localhost:8080/computer/(built-in)/api/json')
          AUTH_OK=$(curl --user "${JENKINS_USER}:${JENKINS_PASS}" --write-out '%{http_code}' --connect-timeout 3 --silent --output /dev/null 'http://localhost:8080/computer/(built-in)/api/json') 
          
          if [ ${NOAUTH_OK} -eq 200 -a ${AUTH_OK} -eq 200 ]; then
              echo "GOOD ${VER}" | tee -a result.txt
          else
              echo "BAD ${VER}" | tee -a result.txt
          fi

           

          Edward Tew added a comment - Thanks esloman , I have run the series of releases from 2.377 back through 2.360 including the recent LTS versions and this is the result Result Version BAD 2.377 BAD 2.361.4 BAD 2.361.3 BAD 2.361.2 BAD 2.361.1 BAD 2.377 BAD 2.361.4 BAD 2.361.3 BAD 2.361.2 BAD 2.361.1 BAD 2.377 BAD 2.376 BAD 2.375 BAD 2.374 BAD 2.373 BAD 2.372 BAD 2.371 BAD 2.370 BAD 2.369 BAD 2.368 BAD 2.367 BAD 2.366 BAD 2.365 BAD 2.364 BAD 2.363 BAD 2.362 GOOD 2.361 GOOD 2.360 So, it looks like something happened about the time of the LTS release. My method of testing was with the Docker images and a bash loop. Using curl to check the availability of the built in Agent computer api NOAUTH_OK=$(curl --write-out '%{http_code}' --connect-timeout 3 --silent --output /dev/null 'http://localhost:8080/computer/(built-in)/api/json') AUTH_OK=$(curl --user "${JENKINS_USER}:${JENKINS_PASS}" --write-out '%{http_code}' --connect-timeout 3 --silent --output /dev/null 'http://localhost:8080/computer/(built-in)/api/json') if [ ${NOAUTH_OK} -eq 200 -a ${AUTH_OK} -eq 200 ]; then echo "GOOD ${VER}" | tee -a result.txt else     echo "BAD ${VER}" | tee -a result.txt fi  

          Edward Tew added a comment -

          Thanks markewaite , we will try your suggestion. We have Versions Node Monitors plugin Version 86.v5a_dd521c4edd

          Edward Tew added a comment - Thanks markewaite , we will try your suggestion. We have Versions Node Monitors plugin Version 86.v5a_dd521c4edd

          Mark Waite added a comment -

          Thanks for the systematic verification edwardtew! That matches with the Jenkins versions that support the two new releases of the versioncolumn plugin. The new releases require Jenkins 2.361.1 as their minimum version. Install versioncolumn plugin 2.2 for the moment and the issue should hide itself.

          Mark Waite added a comment - Thanks for the systematic verification edwardtew ! That matches with the Jenkins versions that support the two new releases of the versioncolumn plugin. The new releases require Jenkins 2.361.1 as their minimum version. Install versioncolumn plugin 2.2 for the moment and the issue should hide itself.

          Mark Waite added a comment -

          I hope to spend some time diagnosing this issue this week, possibly with some help from basil. Apologies that I missed it during my testing of the new releases.

          Mark Waite added a comment - I hope to spend some time diagnosing this issue this week, possibly with some help from basil . Apologies that I missed it during my testing of the new releases.

            basil Basil Crow
            esloman Elliot
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: