org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 3: Missing required section 'agent' @ line 3, column 1. pipeline{ ^ 1 error

Jenkins JIRA | Patrick Wolf | 3 months ago
  1. 0

    If you create a pipeline model with no {{agent}} specified you get an error message: {code}org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 3: Missing required section 'agent' @ line 3, column 1. pipeline{ ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546) 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:67) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:410) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:373) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:213) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE {code} Rather than throwing an error should we default to no label node: {{agent label:""}}

    Jenkins JIRA | 3 months ago | Patrick Wolf
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 3: Missing required section 'agent' @ line 3, column 1. pipeline{ ^ 1 error
  2. 0

    [JIRA] (JENKINS-37932) Error if no "agent" specified

    Google Groups | 3 months ago | pw...@cloudbees.com (JIRA)
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 3: Missing required section 'agent' @ line 3, column 1.    pipeline{    ^ 1 error
  3. 0

    ... multiple external SVN Legacy SCM libs are loaded by the Jenkinsfile *and* the *Local module directory* indicates preservation/overriding of the parent directory. (Ie, when the dot default is not used and a working copy root directory for each lib is created under the {{@libs}} directory. Configuration of global and folder specific libraries as shown in the attachments. The Jenkinsfile script begins {quote}@Library('pipeline_global_helpers') _ @Library('pipeline_branch_build') import com.foo.bar.Application {quote} Running the pipeline makes it as far as checking out or updating the local working copies in the {{@libs/pipeline_global_helpers}} and {{@libs/pipeline_branch_build}} in the pipeline workspace on the master, but execution aborts thereafter with the stack trace {quote}ERROR: Library pipeline_branch_build expected to contain at least one of src or vars directories org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546) 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:67) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:410) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:373) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:213) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Finished: FAILURE{quote} The libraries both have {{src}} and {{vars}} subdirectories and cause no error if used individually if checked out with *Local module directory* set to the default dot (no working copy root directory). I have also avoided the error once or twice when overriding/preserving the working copy root directory when loading a single external library, but not reliably. Ultimately the above error recurs. Checking out straight into the {{@libs}} directory is good for the single-library use case but if I attempt to use multiple libraries, the first checkout's working copy is blown away by the second library's checkout. For now, my workaround is to use a single external library.

    Jenkins JIRA | 2 months ago | Brian Ray
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed 1 error
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [JIRA] (JENKINS-38517) Multiple shared libs throw "ERROR: Library <lib name> expected to contain at least one of src or vars directories" when ...

    Google Groups | 2 months ago | be_...@sbcglobal.net (JIRA)
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed 1 error
  6. 0

    [JIRA] (JENKINS-39719) Internal workflowLib libraries throwing errors

    Google Groups | 3 weeks ago | dtra...@cloudbees.com (JIRA)
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: <br> WorkflowScript: -1: You are not allowed to override the final method __<em>cps</em>__2() from class 'com.acme.foo.test.MyTest'. <br> @ line -1, column -1. <br> 1 error <br>

  1. serious2monkeys 8 times, last 7 days ago
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.codehaus.groovy.control.MultipleCompilationErrorsException

    startup failed: WorkflowScript: 3: Missing required section 'agent' @ line 3, column 1. pipeline{ ^ 1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors()
  2. Groovy
    GroovyShell.parse
    1. org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
    2. org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1073)
    3. org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
    4. org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
    5. org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
    6. groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
    7. groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
    8. groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
    9. groovy.lang.GroovyShell.parse(GroovyShell.java:700)
    9 frames
  3. org.jenkinsci.plugins
    WorkflowRun.run
    1. org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:67)
    2. org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:410)
    3. org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:373)
    4. org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:213)
    4 frames
  4. Hudson
    Executor.run
    1. hudson.model.ResourceController.execute(ResourceController.java:98)
    2. hudson.model.Executor.run(Executor.java:410)
    2 frames