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

Blue Ocean doesn't render exceptions in hidden stages

    • Blue Ocean 1.2-beta3, Blue Ocean 1.2-beta4, Blue Ocean 1.2, Blue Ocean 1.3, Blue Ocean 1.4 - beta 1, Blue Ocean - Candidates

      Context
      At some point in the karaoke refactor we lost the ability to the pipeline errors log if the run failed before the stages started executing. We need to bring that back.

      Scope

      • Bring back functionality
      • Write a test to ensure this never regresses

      Problem
      The attached screenshot shows the lack of information in Blue Ocean, I had to exit Blue Ocean to figure out what actually failed here :'(

      The full console output of this Pipeline is below.

      Push event to branch production
      23:48:11 Connecting to https://api.github.com using jenkinsadmin/****** (GitHub access token for jenkinsadmin)
      Obtained Jenkinsfile from 46609410aef0f7f363994808987fa37ed72a1113
      Loading library pipeline-library@master
      Setting origin to https://github.com/jenkins-infra/pipeline-library.git
      Fetching origin...
      Fetching changes from the remote Git repository
      Checking out Revision 99c3df94cec3f20c7e1982ebb41e4a7540a6ed7b (master)
      Commit message: "Merge pull request #10 from daniel-beck/azure-java-8-plus"
      [Pipeline] node
      Running on win2012-6abd30 in C:\Jenkins\workspace\ra_jenkins-infra_production-4TTENGJWW2V5USAIFAFZPTML4FH6S63TQKHWZDNDDNW4YIHE7VEA
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Declarative: Checkout SCM)
      [Pipeline] checkout
      Cloning the remote Git repository
      remote: Counting objects
      remote: Compressing objects
      Receiving objects
      Resolving deltas
      Updating references
      Checking out Revision 46609410aef0f7f363994808987fa37ed72a1113 (production)
      Commit message: "Merge pull request #790 from jenkins-infra/staging"
      [Pipeline] }
      [Pipeline] // stage
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      
      GitHub has been notified of this commit’s build result
      
      org.eclipse.jgit.errors.CorruptObjectException: name contains ':'
      	at org.eclipse.jgit.lib.ObjectChecker.scanPathSegment(ObjectChecker.java:700)
      	at org.eclipse.jgit.lib.ObjectChecker.checkPathSegment(ObjectChecker.java:782)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.checkValidPathSegment(DirCacheCheckout.java:1400)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.checkValidPath(DirCacheCheckout.java:1392)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.processEntry(DirCacheCheckout.java:350)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.prescanOneTree(DirCacheCheckout.java:329)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:457)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:443)
      	at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:271)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.doCheckout(JGitAPIImpl.java:329)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.access$100(JGitAPIImpl.java:143)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl$1.execute(JGitAPIImpl.java:296)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:336)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at hudson.remoting.Engine$1$1.run(Engine.java:94)
      Caused: org.eclipse.jgit.dircache.InvalidPathException: Invalid path: hieradata/roles/jenkins::agent.yaml
      	at org.eclipse.jgit.dircache.DirCacheCheckout.checkValidPathSegment(DirCacheCheckout.java:1403)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.checkValidPath(DirCacheCheckout.java:1392)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.processEntry(DirCacheCheckout.java:350)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.prescanOneTree(DirCacheCheckout.java:329)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.doCheckout(DirCacheCheckout.java:457)
      	at org.eclipse.jgit.dircache.DirCacheCheckout.checkout(DirCacheCheckout.java:443)
      	at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:271)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.doCheckout(JGitAPIImpl.java:329)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl.access$100(JGitAPIImpl.java:143)
      	at org.jenkinsci.plugins.gitclient.JGitAPIImpl$1.execute(JGitAPIImpl.java:296)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:336)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at hudson.remoting.Engine$1$1.run(Engine.java:94)
      	at java.lang.Thread.run(Thread.java:745)
      	at ......remote call to JNLP4-connect connection from 40.80.147.10/40.80.147.10:49186(Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      	at hudson.remoting.Channel.call(Channel.java:830)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      	at sun.reflect.GeneratedMethodAccessor388.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      	at com.sun.proxy.$Proxy203.execute(Unknown Source)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1161)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:109)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:83)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:73)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
      	at hudson.security.ACL.impersonate(ACL.java:260)
      	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	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)
      Finished: FAILURE
      

      Related to JENKINS-45165

          [JENKINS-45166] Blue Ocean doesn't render exceptions in hidden stages

          James Dumay added a comment -

          rtyler this makes me sad.

          James Dumay added a comment - rtyler this makes me sad.

          James Dumay added a comment - - edited

          abayer do you know where this exception is being thrown? Checkout? Trying to come up with a reproduction case so we can handle this in the UI.

          Is there an error we should be bubbling up from a synthetic/invisible stage?

          James Dumay added a comment - - edited abayer do you know where this exception is being thrown? Checkout? Trying to come up with a reproduction case so we can handle this in the UI. Is there an error we should be bubbling up from a synthetic/invisible stage?

          Andrew Bayer added a comment -

          Yup, that's in the checkout.

          Andrew Bayer added a comment - Yup, that's in the checkout.

          James Dumay added a comment -

          abayer do you know how we could reliably see this sort of error? I need a reproduction case so that I can show a frontend developer the situation in which this occurs.

          James Dumay added a comment - abayer do you know how we could reliably see this sort of error? I need a reproduction case so that I can show a frontend developer the situation in which this occurs.

          Andrew Bayer added a comment -

          fwiw, it also doesn't render exceptions in block-scoped steps. So, for example:

          stage('hi there') {
              try {
                  node {
                      withCredentials([string(credentialsId:'huh', variable: 'no_what')]) {
                          echo "hi"
                      }
                  }
              } finally {
                  echo "mooooo"
              }
          }
          

          shows the "mooooo" echo as failed, because it doesn't visualize the withCredentials at all. This isn't exactly the same as this ticket, but it's a similar issue...

          Andrew Bayer added a comment - fwiw, it also doesn't render exceptions in block-scoped steps. So, for example: stage( 'hi there' ) { try { node { withCredentials([string(credentialsId: 'huh' , variable: 'no_what' )]) { echo "hi" } } } finally { echo "mooooo" } } shows the "mooooo" echo as failed, because it doesn't visualize the withCredentials at all. This isn't exactly the same as this ticket, but it's a similar issue...

          James Dumay added a comment -

          imeredith can you provide reproduction instructions?

          James Dumay added a comment - imeredith can you provide reproduction instructions?

          Ivan Meredith added a comment -

          To reproduce, thow an error before anything happens.

           

           
          node {
            throw new Exception();
            checkout scm
          }
          

           

          To fix this properly, LongConsole should be refactored so that the logic to handle the log fetching is internal, and therefore can be used in mulitple places easily. It can be then used to fetch the general log for pipelines when no stages exist

           

          Ivan Meredith added a comment - To reproduce, thow an error before anything happens.     node { throw new Exception(); checkout scm }   To fix this properly, LongConsole should be refactored so that the logic to handle the log fetching is internal, and therefore can be used in mulitple places easily. It can be then used to fetch the general log for pipelines when no stages exist  

          Ivan Meredith added a comment -

          sophistifunk is working on related code which should help fix this.

          Ivan Meredith added a comment - sophistifunk is working on related code which should help fix this.

          Karl Shultz added a comment -

          Testing Notes:

          • Automated unit tests should be provided as a part of the PR(s) which make up this work.
          • The addition of "negative" UI tests would be welcomed too. I've written that in a lot of these tickets, and wonder if perhaps an "Error handling tests in the Blue Ocean ATH" Epic/Story/Whatever might be worth looking into.

          Karl Shultz added a comment - Testing Notes: Automated unit tests should be provided as a part of the PR(s) which make up this work. The addition of "negative" UI tests would be welcomed too. I've written that in a lot of these tickets, and wonder if perhaps an "Error handling tests in the Blue Ocean ATH" Epic/Story/Whatever might be worth looking into.

            Unassigned Unassigned
            rtyler R. Tyler Croy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: