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

Pipeline Groovy update to 2.38 disables some pipeline options

      I have the following defined in a Jenkins pipeline:

      {{ options {}}
        skipDefaultCheckout()
        timestamps()
        timeout(time: 5, unit: 'MINUTES')
      {{ }}}

      Upon updating from 2.37 to 2.38 of the "Pipeline: Groovy" plugin, when running this job, I get the following error:
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 17: Invalid option type "timestamps". Valid option types: [buildDiscarder, disableConcurrentBuilds, overrideIndexTriggers, skipDefaultCheckout, skipStagesAfterUnstable, withCredentials, ws] @ line 17, column 3.
      timestamps()
      ^

      WorkflowScript: 18: Invalid option type "timeout". Valid option types: [buildDiscarder, disableConcurrentBuilds, overrideIndexTriggers, skipDefaultCheckout, skipStagesAfterUnstable, withCredentials, ws] @ line 18, column 3.
      timeout(time: 5, unit: 'MINUTES')

      Downgrading the plugin back to 2.37 resolved this issue, and let me continue with my definitions as they are.

       

      (PS. I wasn't sure if I picked the right JIRA component here, I picked workflow-cps-plugin because that appears to be the github project linked from the plugin page)

       

          [JENKINS-45978] Pipeline Groovy update to 2.38 disables some pipeline options

          Thomas Johansen added a comment - - edited

          I just got a similar symptom:

          org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          WorkflowScript: 16: Invalid option type "timeout". Valid option types: [buildDiscarder, disableConcurrentBuilds, overrideIndexTriggers, skipDefaultCheckout, skipStagesAfterUnstable, withCredentials, ws] @ line 16, column 9.
                     timeout(time: 5, unit: 'DAYS')
                     ^
          
          1 error
          
          	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.doParse(CpsGroovyShell.java:129)
          	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
          	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
          	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269)
          	at hudson.model.ResourceController.execute(ResourceController.java:97)
          	at hudson.model.Executor.run(Executor.java:419)

          I'm quite sure it appeared after upgrading and adding some plugins to our Jenkins instance (which is version 2.77):

          Added:

          • analysis-core:1.92
          • warnings:4.63
          • maven-plugin:2.17

          Upgraded:

          • script-security 1.33 -> 1.34
          • credentials 2.1.14 -> 2.1.15
          • workflow-cps 2.39 -> 2.40

          Thomas Johansen added a comment - - edited I just got a similar symptom: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 16: Invalid option type "timeout". Valid option types: [buildDiscarder, disableConcurrentBuilds, overrideIndexTriggers, skipDefaultCheckout, skipStagesAfterUnstable, withCredentials, ws] @ line 16, column 9. timeout(time: 5, unit: 'DAYS') ^ 1 error 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.doParse(CpsGroovyShell.java:129) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:419) I'm quite sure it appeared after upgrading and adding some plugins to our Jenkins instance (which is version 2.77): Added: analysis-core:1.92 warnings:4.63 maven-plugin:2.17 Upgraded: script-security 1.33 -> 1.34 credentials 2.1.14 -> 2.1.15 workflow-cps 2.39 -> 2.40

          I just used the downgrade button on the Manage plugins page for Pipeline: Groovy (which is workflow-cps) to 2.39, and now it works again. Hope this helps to fix the problem.

          (Btw, after downgrading, the Installed plugin is still reported as 2.40, but the Downgrade button disappeared.)

          Thomas Johansen added a comment - I just used the downgrade button on the Manage plugins page for Pipeline: Groovy (which is workflow-cps) to 2.39, and now it works again. Hope this helps to fix the problem. (Btw, after downgrading, the Installed plugin is still reported as 2.40, but the Downgrade button disappeared.)

          Andrew Bayer added a comment -

          This is a truly weird one - honestly, I have a feeling that just restarting would have fixed it on its own. I'm going to leave this open to try to get more diagnostic info if anyone else hits this.

          Andrew Bayer added a comment - This is a truly weird one - honestly, I have a feeling that just restarting would have fixed it on its own. I'm going to leave this open to try to get more diagnostic info if anyone else hits this.

          Note that I did not restart after downgrading workflow-cps from 2.40 to 2.39.

          Thomas Johansen added a comment - Note that I did not restart after downgrading workflow-cps from 2.40 to 2.39.

          +1 happened to me, downgrading Groovy plugin to 2.39 worked around it.

          Omer van Kloeten added a comment - +1 happened to me, downgrading Groovy plugin to 2.39 worked around it.

          The error did not reproduce simply after rebuild.

          Alexander Vorobiev added a comment - The error did not reproduce simply after rebuild.

          Andrew Bayer added a comment -

          I'm closing this as can't reproduce...

          Andrew Bayer added a comment - I'm closing this as can't reproduce...

          Felix Neumann added a comment -

          +1 happened to me right after installing the plugin (without jenkins restart). Simply restarting the build helped.

          hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
          D:\jenkins\jobs\whatever\jobs\whatever.bm00q4\branches\master\builds\41\libs\my-pipeline-shared\vars\runPipelineMaven.groovy: 48: Invalid option type "timestamps". Valid option types: [ansiColor, authorizationMatrix, buildDiscarder, catchError, disableConcurrentBuilds, lock, overrideIndexTriggers, retry, script, skipDefaultCheckout, skipStagesAfterUnstable, timeout, waitUntil, withContext, withCredentials, withEnv, ws] @ line 48, column 13.

          Felix Neumann added a comment - +1 happened to me right after installing the plugin (without jenkins restart). Simply restarting the build helped. hudson.remoting.ProxyException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: D:\jenkins\jobs\whatever\jobs\whatever.bm00q4\branches\master\builds\41\libs\my-pipeline-shared\vars\runPipelineMaven.groovy: 48: Invalid option type "timestamps". Valid option types: [ansiColor, authorizationMatrix, buildDiscarder, catchError, disableConcurrentBuilds, lock, overrideIndexTriggers, retry, script, skipDefaultCheckout, skipStagesAfterUnstable, timeout, waitUntil, withContext, withCredentials, withEnv, ws] @ line 48, column 13.

          Vadim Kotov added a comment -

          Vadim Kotov added a comment - I think this is related - https://issues.jenkins-ci.org/browse/JENKINS-48556

          Liam Newman added a comment -

          Bulk closing resolved issues.

          Liam Newman added a comment - Bulk closing resolved issues.

            abayer Andrew Bayer
            toddmarimon Todd Marimon
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: