When having complex configuration, with many steps, variables, repositories, pre / post build scripts, etc.
it's quite difficult to find an error cause, when the script is not directly defined in a step.
For example, having a step with a script in the resource selection:
${groovy:
if(step.getRuntime().nodeAddress) {
return step.getRuntime().nodeAddress
\}
step.getRuntime().nodeAddress = Eval.xy(vars, params, vars.getValue("BuilderSelectionScript"))
logger.info("Resource name for the step: "+step.getRuntime().nodeAddress)
return step.getRuntime().nodeAddress
}
Fails sometimes on an unclear error cause:
10:54:34,774 INFO - Running step...
10:54:34,785 INFO - PParameters: 14b+PLATFORM(CAMMINI_EXT)|SENSOR(MT9J001)@PExt@PNand
10:54:34,785 INFO - Executing post-execute action...
10:54:34,786 ERROR - Step 'master>Verification Stage>Dependent Config>Building stage - New>Build platform?PlatformParameters=14b+PLATFORM(CAMMINI_EXT)|SENSOR(MT9J001)@PExt@PNand' is failed: java.lang.ArrayIndexOutOfBoundsException: 2
at org.codehaus.groovy.runtime.dgmimpl.arrays.ObjectArrayGetAtMetaMethod$MyPojoMetaMethodSite.call(ObjectArrayGetAtMetaMethod.java:57)
at script1384243581199239825853.run(script1384243581199239825853.groovy:5)
at com.pmease.quickbuild.plugin.basis.BasisPlugin$25.evaluate(BasisPlugin.java:322)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:80)
at com.pmease.quickbuild.DefaultScriptEngine.interpolate(DefaultScriptEngine.java:104)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:277)
at com.pmease.quickbuild.setting.step.repetition.SpecifiedValues$$EnhancerByCGLIB$$39322756.getValues(<generated>)
at com.pmease.quickbuild.setting.step.repetition.SpecifiedValues.get(SpecifiedValues.java:36)
at com.pmease.quickbuild.setting.step.repetition.SpecifiedValues$$EnhancerByCGLIB$$39322756.CGLIB$get$0(<generated>)
at com.pmease.quickbuild.setting.step.repetition.SpecifiedValues$$EnhancerByCGLIB$$39322756$$FastClassByCGLIB$$901523ef.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:269)
at com.pmease.quickbuild.setting.step.repetition.SpecifiedValues$$EnhancerByCGLIB$$39322756.get(<generated>)
at com.pmease.quickbuild.stepsupport.CompositeStep.findChildren(CompositeStep.java:155)
at com.pmease.quickbuild.stepsupport.SequentialStep$$EnhancerByCGLIB$$9b1e322f.CGLIB$findChildren$4(<generated>)
at com.pmease.quickbuild.stepsupport.SequentialStep$$EnhancerByCGLIB$$9b1e322f$$FastClassByCGLIB$$168f50c9.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:269)
at com.pmease.quickbuild.stepsupport.SequentialStep$$EnhancerByCGLIB$$9b1e322f.findChildren(<generated>)
at com.pmease.quickbuild.stepsupport.SequentialStep.triggerChildren(SequentialStep.java:31)
at com.pmease.quickbuild.stepsupport.CompositeStep.run(CompositeStep.java:97)
at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:501)
at com.pmease.quickbuild.stepsupport.StepExecutionJob.executeStepAwareJob(StepExecutionJob.java:30)
at com.pmease.quickbuild.stepsupport.StepAwareJob.executeBuildAwareJob(StepAwareJob.java:47)
at com.pmease.quickbuild.BuildAwareJob.execute(BuildAwareJob.java:61)
at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:78)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
10:54:34,786 TRACE - Stack trace for the failure
java.lang.RuntimeException: Failed to evaluate below expression:
groovy:
res = ""
logger.info("PParameters: "+params.get('PlatformParameters'))
arr = params.get('PlatformParameters').split("\|")
data = arr[2]
logger.info("Pre steps: " + data)
res += data.replaceAll("\*",",")
logger.info("Result: "+res)
return res
Now finding the exact place in configuration scripts is very difficult, as I don't see the "data = arr[2]" anywhere in step scripts, nor in variable "BuilderSelectionScript".
Is there a vast search on whole configuration scripts and definitions ?
Thanks, Noam.