You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by CLOSE Dave <Da...@us.thalesgroup.com> on 2015/06/19 01:54:02 UTC

How to interpret an error message

I am certainly not a Groovy expert, not even a Java expert, but I use 
both occasionally and can usually decipher error messages. But this time 
I'm stumped.

Groovy is used as the job description language by the build-flow plugin 
for Jenkins (and in other parts of Jenkins as well). I have a Jenkins 
job on Jenkins 1.613 running on x86_64 Fedora 20 using the build flow 
plugin. A portion of it looks like the code below. (Perhaps you don't 
need to know about Jenkins or build-flow to help, but here it is just in 
case. I've already asked the Jenkins list without a useful response.)

branchName = build.buildVariableResolver.resolve("BRANCH")
def chkbranch ( String product, String branch ) {
    def cmd = ["/bin/bash", "-c", "/home/jenkins/bin/chkbranch"+"
"+product+" "+branch]  // Build the command string to run
    def ans = cmd.execute().text  // Run the command
    return "$ans"[0..-2]  // Chomp the answer before returning
}
parallel (
    { ignore ( FAILURE ) { build ( "job1", BRANCH: chkbranch ( "job1", 
branchName ) ) } },
    { ignore ( FAILURE ) { build ( "job2", BRANCH: chkbranch ( "job2", 
branchName ) ) } }
)

But this doesn't work. It throws a Groovy error which means nothing to 
me. The error looks something like the following. Any ideas?

ERROR: Failed to run DSL Script
groovy.lang.MissingMethodException: No signature of method:
Script1$_run_closure8.call() is applicable for argument types:
(Script1$_run_closure9, Script1$_run_closure10, Script1$_run_closure11,
Script1$_run_closure12, Script1$_run_closure13, Script1$_run_closure14,
Script1$_run_closure15) values: [Script1$_run_closure9@9202ce0,
Script1$_run_closure10@1f622ace, ...]
Possible solutions: doCall(), any(), any(), find(), grep(), dump()
	at 
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:903)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:723)
	at 
groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
	at 
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
	at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at Script1.run(Script1.groovy:30)
	at Script1$run.call(Unknown Source)
	at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at Script1$run.call(Unknown Source)
	at com.cloudbees.plugins.flow.FlowDSL.executeFlowScript(FlowDSL.groovy:84)
	at 
com.cloudbees.plugins.flow.FlowRun$FlyweightTaskRunnerImpl.run(FlowRun.java:219)
	at hudson.model.Run.execute(Run.java:1759)
	at com.cloudbees.plugins.flow.FlowRun.run(FlowRun.java:155)
	at hudson.model.ResourceController.execute(ResourceController.java:89)
	at hudson.model.Executor.run(Executor.java:240)
	at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
-- 
Dave Close
"Technology has the shelf life of a banana." - Scott McNealy

Re: How to interpret an error message

Posted by Jochen Theodorou <bl...@gmx.org>.
Am 19.06.2015 18:21, schrieb CLOSE Dave:
{...[
> Yes, it was abbreviated. Line 30 would be the second of the two "build"
> lines in my example. The reset of the script consists of several more
> "parallel" groups and the introductory code I included in my example.

if a line like this

build ( "job2", BRANCH: chkbranch ( "job2",
branchName ) )

is converted into something with 7 arguments, which are all closures and 
build itself is one too...

But I am puzzled about the Groovy version in use... I thought they are 
still using something ancient like Groovy 1.5, but the error message 
details look like something I thought we added later.

> I also don't see anything with seven arguments and don't think anything
> like that was intended. However, I can't speak to what the build-flow
> Jenkins plugin might do with my code.

I think the question is better asked at 
https://groups.google.com/forum/#!forum/jenkinsci-users actually... I 
don't really know jenkins and that flow dsl. The error reporting could 
be improved a lot (something they would have to do). But from that 
script alone and without knowing how the builder works I cannot really 
help. I hope jenkins-user is better

bye blackdrag

-- 
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/


Re: How to interpret an error message

Posted by CLOSE Dave <Da...@us.thalesgroup.com>.
On 2015-06-18 21:21, Jochen Theodorou wrote:
> Am 19.06.2015 01:54, schrieb CLOSE Dave:
> [...]
>> ERROR: Failed to run DSL Script
>> groovy.lang.MissingMethodException: No signature of method:
>> Script1$_run_closure8.call() is applicable for argument types:
>> (Script1$_run_closure9, Script1$_run_closure10, Script1$_run_closure11,
>> Script1$_run_closure12, Script1$_run_closure13, Script1$_run_closure14,
>> Script1$_run_closure15) values: [Script1$_run_closure9@9202ce0,
>> Script1$_run_closure10@1f622ace, ...]
>
> that is a call on a closure using 7 other closures. the call originates
> from your script at line 30:
> [...]
>> 	at Script1.run(Script1.groovy:30)
> [...]
>> 	at com.cloudbees.plugins.flow.FlowDSL.executeFlowScript(FlowDSL.groovy:84)
>> 	at
>> com.cloudbees.plugins.flow.FlowRun$FlyweightTaskRunnerImpl.run(FlowRun.java:219)
>> 	at hudson.model.Run.execute(Run.java:1759)
>> 	at com.cloudbees.plugins.flow.FlowRun.run(FlowRun.java:155)
>> 	at hudson.model.ResourceController.execute(ResourceController.java:89)
>> 	at hudson.model.Executor.run(Executor.java:240)
>> 	at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
>>
>
> The script you have shown though, does not have 30 lines, nor do I see
> there a call using 7 arguments. So I assume the script you have shown is
> a condensed version of the one you really have?

Yes, it was abbreviated. Line 30 would be the second of the two "build" 
lines in my example. The reset of the script consists of several more 
"parallel" groups and the introductory code I included in my example.

I also don't see anything with seven arguments and don't think anything 
like that was intended. However, I can't speak to what the build-flow 
Jenkins plugin might do with my code.
-- 
Dave Close
"Technology has the shelf life of a banana." - Scott McNealy

Re: How to interpret an error message

Posted by Jochen Theodorou <bl...@gmx.org>.
Am 19.06.2015 01:54, schrieb CLOSE Dave:
[...]
> ERROR: Failed to run DSL Script
> groovy.lang.MissingMethodException: No signature of method:
> Script1$_run_closure8.call() is applicable for argument types:
> (Script1$_run_closure9, Script1$_run_closure10, Script1$_run_closure11,
> Script1$_run_closure12, Script1$_run_closure13, Script1$_run_closure14,
> Script1$_run_closure15) values: [Script1$_run_closure9@9202ce0,
> Script1$_run_closure10@1f622ace, ...]

that is a call on a closure using 7 other closures. the call originates 
from your script at line 30:
[...]
> 	at Script1.run(Script1.groovy:30)
[...]
> 	at com.cloudbees.plugins.flow.FlowDSL.executeFlowScript(FlowDSL.groovy:84)
> 	at
> com.cloudbees.plugins.flow.FlowRun$FlyweightTaskRunnerImpl.run(FlowRun.java:219)
> 	at hudson.model.Run.execute(Run.java:1759)
> 	at com.cloudbees.plugins.flow.FlowRun.run(FlowRun.java:155)
> 	at hudson.model.ResourceController.execute(ResourceController.java:89)
> 	at hudson.model.Executor.run(Executor.java:240)
> 	at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
>

The script you have shown though, does not have 30 lines, nor do I see 
there a call using 7 arguments. So I assume the script you have shown is 
a condensed version of the one you really have?

bye blackdrag

-- 
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/