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

Loading never finishes on blue ocean dashboard when clicked show more button.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • blueocean-plugin, p4-plugin
    • None
    • pannonian, iapetus

      Problem

      Perforce plugin does not like to serialize its web repository URL if the credential is not set correctly. This is related to JENKINS-40088.

      java.io.IOException: Failed to write changeSet
      	at io.jenkins.blueocean.commons.stapler.export.Property.safeGetValue(Property.java:152)
      	at io.jenkins.blueocean.commons.stapler.export.Property.writeTo(Property.java:127)
      	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:228)
      	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:224)
      	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:224)
      	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:280)
      	at io.jenkins.blueocean.commons.stapler.export.Property.writeValue(Property.java:169)
      	at io.jenkins.blueocean.commons.stapler.export.Property.writeTo(Property.java:140)
      	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:228)
      	at io.jenkins.blueocean.commons.stapler.export.Model.writeNestedObjectTo(Model.java:224)
      	at io.jenkins.blueocean.commons.stapler.export.Model.writeTo(Model.java:199)
      	at io.jenkins.blueocean.commons.stapler.Export.writeOne(Export.java:97)
      	at io.jenkins.blueocean.commons.stapler.Export.serveExposedBean(Export.java:85)
      	at io.jenkins.blueocean.commons.stapler.Export.doJson(Export.java:30)
      	at io.jenkins.blueocean.rest.pageable.PagedResponse$Processor$1.generateResponse(PagedResponse.java:59)
      	at org.kohsuke.stapler.HttpResponseRenderer$Default.handleHttpResponse(HttpResponseRenderer.java:124)
      	at org.kohsuke.stapler.HttpResponseRenderer$Default.generateResponse(HttpResponseRenderer.java:69)
      	at org.kohsuke.stapler.Function.renderResponse(Function.java:127)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:110)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:362)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:686)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:362)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:225)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:499)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.reflect.InvocationTargetException
      	at io.jenkins.blueocean.commons.stapler.export.MethodProperty.getValue(MethodProperty.java:74)
      	at io.jenkins.blueocean.commons.stapler.export.Property.safeGetValue(Property.java:146)
      	... 89 more
      Caused by: java.lang.NullPointerException
      	at org.jenkinsci.plugins.p4.client.ConnectionConfig.<init>(ConnectionConfig.java:19)
      	at org.jenkinsci.plugins.p4.client.ConnectionHelper.<init>(ConnectionHelper.java:64)
      	at org.jenkinsci.plugins.p4.PerforceScm.guessBrowser(PerforceScm.java:220)
      	at hudson.scm.SCM.getEffectiveBrowser(SCM.java:146)
      	at hudson.scm.ChangeLogParser.parse(ChangeLogParser.java:57)
      	at hudson.model.AbstractBuild.calcChangeSet(AbstractBuild.java:911)
      	at hudson.model.AbstractBuild.getChangeSet(AbstractBuild.java:879)
      	at io.jenkins.blueocean.service.embedded.rest.FreeStyleRunImpl.getChangeSet(FreeStyleRunImpl.java:37)
      	at io.jenkins.blueocean.commons.stapler.export.MethodProperty.getValue(MethodProperty.java:72)
      	... 90 more
      

      Original request
      I have 40 jobs on my jenkins and It shows 25 jobs on dashboard when I first opened blue ocean dashboard.
      And then, to show more jobs, when I press the "Show more" button, it never finishes..

          [JENKINS-41459] Loading never finishes on blue ocean dashboard when clicked show more button.

          James Dumay added a comment -

          allenlee could you please provide the version of Blue Ocean you are using? Also please attach a HAR file for this request (You can learn about generating one here)

          James Dumay added a comment - allenlee could you please provide the version of Blue Ocean you are using? Also please attach a HAR file for this request (You can learn about generating one here )

          allen lee added a comment -

          Thank you James Dumay.
          As you guided, I extracted har file and attached it.

          And followings are my environment.

          • Ubuntu 14.04 LTS
          • JDK : 1.8.0_91
          • Jenkins version : 2.41
          • BlueOcean plugin version : 1.0.0-b19
          • Running env : Just run jenkins directly without tomcat or nginx(not using reverse proxy)
          • Browser : chrome, firefox, IE

          allen lee added a comment - Thank you James Dumay. As you guided, I extracted har file and attached it. And followings are my environment. Ubuntu 14.04 LTS JDK : 1.8.0_91 Jenkins version : 2.41 BlueOcean plugin version : 1.0.0-b19 Running env : Just run jenkins directly without tomcat or nginx(not using reverse proxy) Browser : chrome, firefox, IE

          James Dumay added a comment - - edited

          allenlee it looks like it is trying to load a Freestyle job that does not have credentials set up for it correctly. What happens is that it tries to use a credential that does not exist and it fails the REST call to the backend. We want to handle this in a more generic way in JENKINS-40088 but I've submitted a fix to the p4 plugin that should avoid this problem.

          I couldn't see what job this was coming from but if you look through your jobs and ensure that all the jobs using p4 have valid credentials you should see the problem go away.

          James Dumay added a comment - - edited allenlee it looks like it is trying to load a Freestyle job that does not have credentials set up for it correctly. What happens is that it tries to use a credential that does not exist and it fails the REST call to the backend. We want to handle this in a more generic way in JENKINS-40088 but I've submitted a fix to the p4 plugin that should avoid this problem. I couldn't see what job this was coming from but if you look through your jobs and ensure that all the jobs using p4 have valid credentials you should see the problem go away.

          allen lee added a comment - - edited

          Thank you James Dumay.
          Great!! I found there are two jobs which has invalid P4 credentials and when I fixed them, It working well.
          Thanks!

          allen lee added a comment - - edited Thank you James Dumay. Great!! I found there are two jobs which has invalid P4 credentials and when I fixed them, It working well. Thanks!

          James Dumay added a comment -

          You're most welcome!

          James Dumay added a comment - You're most welcome!

          Code changed in jenkins
          User: James Dumay
          Path:
          src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java
          http://jenkins-ci.org/commit/p4-plugin/f371bd2110c733999df141519495b973fe1c7ec5
          Log:
          JENKINS-41459 fixes NPE when credential is null

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Dumay Path: src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java http://jenkins-ci.org/commit/p4-plugin/f371bd2110c733999df141519495b973fe1c7ec5 Log: JENKINS-41459 fixes NPE when credential is null

          Code changed in jenkins
          User: Paul Allen
          Path:
          src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java
          http://jenkins-ci.org/commit/p4-plugin/33d41b3049db47d579271b4cba81f2626d4603dc
          Log:
          Merge pull request #37 from i386/feature/JENKINS-41459

          JENKINS-41459 fixes NPE when credential is null

          Compare: https://github.com/jenkinsci/p4-plugin/compare/6be78500188e...33d41b3049db

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java http://jenkins-ci.org/commit/p4-plugin/33d41b3049db47d579271b4cba81f2626d4603dc Log: Merge pull request #37 from i386/feature/ JENKINS-41459 JENKINS-41459 fixes NPE when credential is null Compare: https://github.com/jenkinsci/p4-plugin/compare/6be78500188e...33d41b3049db

          James Dumay added a comment -

          There will be a release of the p4 plugin shortly with this patch accepted

          James Dumay added a comment - There will be a release of the p4 plugin shortly with this patch accepted

          allen lee added a comment -

          New p4 plugin that applied this patch was released.
          https://github.com/jenkinsci/p4-plugin/compare/p4-1.4.13...p4-1.4.14

          Thank you a lot.

          allen lee added a comment - New p4 plugin that applied this patch was released. https://github.com/jenkinsci/p4-plugin/compare/p4-1.4.13...p4-1.4.14 Thank you a lot.

          James Dumay added a comment - - edited

          You're most welcome allenlee! We've also got JENKINS-40088 in review which will make this class of issues go away for good.

          James Dumay added a comment - - edited You're most welcome allenlee ! We've also got JENKINS-40088 in review which will make this class of issues go away for good.

            jamesdumay James Dumay
            allenlee allen lee
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: