Bamboo build fails with a java.lang.StackOverflowError while executing Script Task

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

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:

1 2 3 4 5 6 7 8 9 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

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.

Solution

Workaround

To work around the problem:

  • Disable the Sauce OnDemand for Bambooadd-on in Bamboo or uninstall it.

Resolution

Upgrade Sauce OnDemand for Bamboo to the latest compatible version for your Bamboo as listed here:

Updated on April 7, 2025

Still need help?

The Atlassian Community is here for you.