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

Log noise from PipelineEventListener after build fails with syntax error

    Details

    • Epic Link:
    • Sprint:
      Blue Ocean 1.1, Blue Ocean 1.1, Blue Ocean 1.2-beta1
    • Similar Issues:

      Description

      I tried to write a Declarative Pipeline but I forget to include steps inside stage. So when I ran it

      May 18, 2017 4:25:12 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
      INFO: foo #1 completed: FAILURE
      

      Fine. But then in the log:

      May 18, 2017 4:25:12 PM io.jenkins.blueocean.events.PipelineEventListener$1 run
      SEVERE: Unexpected error publishing pipeline FlowNode event.
      java.util.concurrent.ExecutionException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 4: Unknown stage section "echo". Starting with version 0.5, steps in a stage must be in a steps block. @ line 4, column 9.
                 stage('main') {
                 ^
      
      WorkflowScript: 4: Nothing to execute within stage "main" @ line 4, column 9.
                 stage('main') {
                 ^
      
      2 errors
      
      	at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:289)
      	at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:276)
      	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
      	at io.jenkins.blueocean.events.PipelineEventListener$1.run(PipelineEventListener.java:226)
      	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:748)
      Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 4: Unknown stage section "echo". Starting with version 0.5, steps in a stage must be in a steps block. @ line 4, column 9.
                 stage('main') {
                 ^
      
      WorkflowScript: 4: Nothing to execute within stage "main" @ line 4, column 9.
                 stage('main') {
                 ^
      
      2 errors
      
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
      	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
      	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
      	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:116)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:430)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:393)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:257)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:405)
      

      Surely this does not count as an "unexpected error". Be quiet.

        Attachments

          Activity

          Hide
          jamesdumay James Dumay added a comment -

          Jesse Glick you are absolutely right. This should be valid as far as declarative is concerned.

          Show
          jamesdumay James Dumay added a comment - Jesse Glick you are absolutely right. This should be valid as far as declarative is concerned.
          Hide
          jglick Jesse Glick added a comment -

          No, I think you missed the point.

          First of all, this was not triggered by an empty stage, but by a stage using a step not inside steps.

          Second, the point was not why the build failed, but the fact that Blue Ocean code is printing a massive stack trace to the system log when a build failed—a normal(ish) occurrence that an administrator should not care about.

          Show
          jglick Jesse Glick added a comment - No, I think you missed the point. First of all, this was not triggered by an empty stage, but by a stage using a step not inside steps . Second, the point was not why the build failed, but the fact that Blue Ocean code is printing a massive stack trace to the system log when a build failed—a normal(ish) occurrence that an administrator should not care about.
          Hide
          jamesdumay James Dumay added a comment -

          Jesse Glick fair call though this is actually Declarative spitting this error in the system log.

          Andrew Bayer I suspect we didn't get the validation error printed to the pipeline log in this case either. We should probably print it sans stacktrace?

          Show
          jamesdumay James Dumay added a comment - Jesse Glick fair call though this is actually Declarative spitting this error in the system log. Andrew Bayer I suspect we didn't get the validation error printed to the pipeline log in this case either. We should probably print it sans stacktrace?
          Hide
          jglick Jesse Glick added a comment -

          James Dumay how is this code not a bug in blueocean? WorkflowRun.executionPromise.get() can throw an exception for various reasons and you should not be logged it above FINE.

          Show
          jglick Jesse Glick added a comment - James Dumay how is  this code  not a bug in blueocean ? WorkflowRun.executionPromise.get() can throw an exception for various reasons and you should not be logged it above FINE .
          Hide
          jamesdumay James Dumay added a comment -

          Vivek Pandey if this is not moving, do you want to push it into the previous sprint?

          Show
          jamesdumay James Dumay added a comment - Vivek Pandey if this is not moving, do you want to push it into the previous sprint?

            People

            • Assignee:
              vivek Vivek Pandey
              Reporter:
              jglick Jesse Glick
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: