Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

pre-execute script failure #2256

raimainc ·
I'm getting this error:
09:38:50,649 ERROR - Step 'master' is failed: Failed to evaluate below expression:
mvel:vars.get("buildForStaging").setValue(vars.get("build"), false);
vars.get("build").increase();

My pre-execute script box contains the following:
vars.get("buildForStaging").setValue(vars.get("build"), false);
vars.get("build").increase();

What am I doing wrong with this?
  • replies 9
  • views 3260
  • stars 0
raimainc ·
I also tried:

build.variableValues.put("buildForStaging", vars.get("build"));
system.buildManager.save(build);
vars.get("build").increase()

Which does not give an error, but it also does not set the buildForStaging value.
robinshen ADMIN ·
Try below instead:

vars.get("buildForStaging").setValue(vars.getValue("build"), false);
vars.get("build").increase();
robinshen ADMIN ·
If you want the variable "buildForStaging" to be persisted, please use below version:
vars.get("buildForStaging").setValue(vars.getValue("build"), true);
vars.get("build").increase();
raimainc ·
I took your suggestion and tried it:
vars.get("buildForStaging").setValue(vars.getValue("build"), true);
vars.get("build").increase();

But I get this error:
13:04:14,100 ERROR - Step 'master' is failed: Failed to evaluate below expression:
mvel:vars.get("buildForStaging").setValue(vars.getValue("build"), true);
vars.get("build").increase();

Any idea what I'm doing wrong?
robinshen ADMIN ·
Sorry I forget to prefix it with groovy:
groovy:
vars.get("buildForStaging").setValue(vars.getValue("build"), true);
vars.get("build").increase();
raimainc ·
Ok. I tried that and now I'm getting this error:

12:00:02,504 INFO - Executing pre-execute action...
12:00:03,074 ERROR - Step 'master' is failed: java.lang.NullPointerException: Cannot invoke method setValue() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at script13660524025061580102451.run(script13660524025061580102451.groovy:2)
at com.pmease.quickbuild.plugin.basis.BasisPlugin$20.evaluate(BasisPlugin.java:277)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:80)
at com.pmease.quickbuild.setting.step.executeaction.ScriptExecuteAction.execute(ScriptExecuteAction.java:36)
at com.pmease.quickbuild.setting.step.executeaction.ScriptExecuteAction$$EnhancerByCGLIB$$47130f2d.CGLIB$execute$0(<generated>)
at com.pmease.quickbuild.setting.step.executeaction.ScriptExecuteAction$$EnhancerByCGLIB$$47130f2d$$FastClassByCGLIB$$d6ef043.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.executeaction.ScriptExecuteAction$$EnhancerByCGLIB$$47130f2d.execute(<generated>)
at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:436)
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(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
robinshen ADMIN ·
Do you have this variable "buildForStaging" defined in this configuration and any of its ancestor configurations?
raimainc ·
Yes, of course. It is defined only two nodes up from the configuration where these steps are being run.
robinshen ADMIN ·
Can you please send me [robin AT pmease DOT com] your database backup and let me know the configuration in question?