Bamboo build fails with a java.lang.StackOverflowError while executing Script Task
Problem
Bamboo build fails with a java.lang.StackOverflowError
while executing Script Task, the script ask is attempting to tokenize the environment variables when it fails.
Diagnosis
A stack trace similar to the following is found in the build log:
Error occurred while running Task 'Script example' of type com.atlassian.bamboo.plugins.scripttask:task.builder.script.
java.lang.StackOverflowError
at java.util.HashMap.put(HashMap.java:611)
at com.atlassian.bamboo.process.EnvironmentVariableStringUtils.tokeniseVariables(EnvironmentVariableStringUtils.java:77)
at com.atlassian.bamboo.process.EnvironmentVariableStringUtils.tokeniseVariables(EnvironmentVariableStringUtils.java:79)
at com.atlassian.bamboo.process.EnvironmentVariableStringUtils.tokeniseVariables(EnvironmentVariableStringUtils.java:79)
at com.atlassian.bamboo.process.EnvironmentVariableStringUtils.tokeniseVariables(EnvironmentVariableStringUtils.java:79)
at com.atlassian.bamboo.process.EnvironmentVariableStringUtils.tokeniseVariables(EnvironmentVariableStringUtils.java:79)
at com.atlassian.bamboo.process.EnvironmentVariableStringUtils.tokeniseVariables(EnvironmentVariableStringUtils.java:79)
Environment
- The Sauce OnDemand for Bamboo add-on is installed.
Cause
The problem is caused by an incompatible version of the Sauce OnDemand for Bamboo add-on. At the time of writing the incompatibility is known to occur with version 1.6.56 of the add-on on Bamboo 5.14.x.
Workaround
To work around the problem:
- Disable the Sauce OnDemand for Bamboo add-on in Bamboo or uninstall it.
Resolution
Upgrade Sauce OnDemand for Bamboo to the latest compatible version for your Bamboo as listed here: