[JIRA] (JENKINS-42787) Got groovy Compilation Error in WorkflowScript

2 views
Skip to first unread message

poohsunny@r.recruit.co.jp (JIRA)

unread,
Mar 14, 2017, 11:38:01 PM3/14/17
to jenkinsc...@googlegroups.com
Yotaro Takahashi created an issue
 
Jenkins / Bug JENKINS-42787
Got groovy Compilation Error in WorkflowScript
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2017/Mar/15 3:37 AM
Environment: Pipeline: Groovy : 2.29
Pipeline: Declarative Extension Points API : 1.1.1
Priority: Major Major
Reporter: Yotaro Takahashi

When I run Jenkins Job that runs tests, I got following error.

 org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 66: One condition is required in "when" @ line 66, column 7.
when {
^

WorkflowScript: 66: Empty when closure, remove the property or add some content. @ line 66, column 7.
when {
^

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:67)
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:238)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:405)
Finished: FAILURE

How can I troubleshoot this? Please let me know if I should add more information.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

andrew.bayer@gmail.com (JIRA)

unread,
Mar 15, 2017, 9:55:04 PM3/15/17
to jenkinsc...@googlegroups.com
Andrew Bayer assigned an issue to Andrew Bayer
 

Can you please attach your Jenkinsfile?

Change By: Andrew Bayer
Component/s: pipeline-model-definition-plugin
Component/s: pipeline
Assignee: Andrew Bayer

poohsunny@r.recruit.co.jp (JIRA)

unread,
Mar 15, 2017, 10:06:01 PM3/15/17
to jenkinsc...@googlegroups.com

poohsunny@r.recruit.co.jp (JIRA)

unread,
Mar 15, 2017, 10:07:01 PM3/15/17
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Mar 15, 2017, 10:12:02 PM3/15/17
to jenkinsc...@googlegroups.com

Try putting the two conditions in your last when section inside an allOf, like this - 

{code} 

when {

  allOf {

     branch... 

     expression... 

  } 

{code} 

poohsunny@r.recruit.co.jp (JIRA)

unread,
Mar 16, 2017, 12:26:01 AM3/16/17
to jenkinsc...@googlegroups.com

I did and now our Jenkins works fine. Thank you!

andrew.bayer@gmail.com (JIRA)

unread,
Mar 17, 2017, 5:51:02 PM3/17/17
to jenkinsc...@googlegroups.com
Andrew Bayer resolved as Duplicate
 
Change By: Andrew Bayer
Status: Open Resolved
Resolution: Duplicate

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:48 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Duplicate
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages