Bamboo specs scan fails with error "Docker configuration: Volume ${bamboo.tmp.directory} is already defined".

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

When managing Bamboo plans with Bamboo Specs (YAML or Java) and running them on a Docker environment, the specs scan fails with the error "Docker configuration: Volume ${bamboo.tmp.directory} is already defined".

Environment

The issue was observed on Bamboo 9.6.0, but other versions may be affected.

Diagnosis

Checked the specs scan logs and saw the following error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 14-May-2024 09:41:45 There was an error when processing yaml file "bamboo.yaml". File structure is correct, contact Atlassian Support for assistance on resolving this issue. 14-May-2024 09:41:45 14-May-2024 09:41:45 Docker configuration: Volume ${bamboo.tmp.directory} is already defined. 14-May-2024 09:41:45 com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: Docker configuration: Volume ${bamboo.tmp.directory} is already defined. 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.model.docker.DockerConfigurationProperties.lambda$validate$0(DockerConfigurationProperties.java:90) 14-May-2024 09:41:45 at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) 14-May-2024 09:41:45 at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1505) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.model.docker.DockerConfigurationProperties.validate(DockerConfigurationProperties.java:86) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.model.docker.DockerConfigurationProperties.<init>(DockerConfigurationProperties.java:67) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.builders.docker.DockerConfiguration.build(DockerConfiguration.java:120) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.builders.docker.DockerConfiguration.build(DockerConfiguration.java:27) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.builders.CallEntityPropertiesBuilder.build(CallEntityPropertiesBuilder.java:10) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.util.EntityPropertiesBuilders.build(EntityPropertiesBuilders.java:14) 14-May-2024 09:41:45 at com.atlassian.bamboo.specs.api.builders.plan.Job.dockerConfiguration(Job.java:273) 14-May-2024 09:41:45 at java.base/java.util.Optional.ifPresent(Optional.java:183) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.yaml.BambooYamlToSpecsConverterImpl.appendPlanStructure(BambooYamlToSpecsConverterImpl.java:592) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.yaml.BambooYamlToSpecsConverterImpl.appendPlanConfig(BambooYamlToSpecsConverterImpl.java:387) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.yaml.BambooYamlToSpecsConverterImpl.createPlan(BambooYamlToSpecsConverterImpl.java:165) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.parseYaml(YamlSpecsImportServiceImpl.java:169) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.rss.YamlSpecsImportServiceImpl.processSimplifiedYaml(YamlSpecsImportServiceImpl.java:107) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.tryProcessYaml(RepositoryStoredSpecsServiceImpl.java:341) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.runBambooSpecs(RepositoryStoredSpecsServiceImpl.java:184) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl.runRssDetection(RssDetectionServiceImpl.java:374) 14-May-2024 09:41:45 at com.atlassian.bamboo.configuration.external.detection.RssDetectionRunnable.run(RssDetectionRunnable.java:42) 14-May-2024 09:41:45 at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) 14-May-2024 09:41:45 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 14-May-2024 09:41:45 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 14-May-2024 09:41:45 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 14-May-2024 09:41:45 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48) 14-May-2024 09:41:45 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26) 14-May-2024 09:41:45 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17) 14-May-2024 09:41:45 at com.atlassian.bamboo.security.ImpersonationHelper.lambda$makeRunnableWithSystemAuthority$0(ImpersonationHelper.java:38) 14-May-2024 09:41:45 at java.base/java.lang.Thread.run(Thread.java:829) 14-May-2024 09:41:45 14-May-2024 09:41:45 14-May-2024 09:41:45 Do you need help? Please visit http://docs.atlassian.com/bamboo/docs-0905/Bamboo+Specs+troubleshooting

Checked the plan specifications file

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 — version: 2 plan: project-key: ALM key: BAA name: Bamboo_Ansible_Automation docker: image: ubuntu volumes: "/data/bamboo/${bamboo.capability.AGENT_ID}/temp": "${bamboo.tmp.directory}" "/data/bamboo/${bamboo.capability.AGENT_ID}/xml-data/build-dir/${bamboo.buildKey}": "${bamboo.working.directory}" stages: Default stage: Default job Default job: tasks: script: echo 'Default job' clean

Cause

Bamboo automatically maps some of the agent's directories to the relevant directories in the Docker container. In the above example ${bamboo.tmp.directory} is already mapped by Bamboo as default. 

Solution

When building a plan in specs, you may disable the feature to mount the agent default directories by using the following argument.

1 use-default-volumes: false

Example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 — version: 2 plan: project-key: ALM key: BAA name: Bamboo_Ansible_Automation docker: image: ubuntu volumes: "/data/bamboo/${bamboo.capability.AGENT_ID}/temp": "${bamboo.tmp.directory}" "/data/bamboo/${bamboo.capability.AGENT_ID}/xml-data/build-dir/${bamboo.buildKey}": "${bamboo.working.directory}" use-default-volumes: false   stages: Default stage: Default job Default job: tasks: script: echo 'Default job' clean

Alternatively, you can define the plan using the Docker setup without supplying the default data volumes.

Example:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 — version: 2 plan: project-key: ALM key: BAA name: Bamboo_Ansible_Automation docker: image: ubuntu stages: Default stage: Default job Default job: tasks: script: echo 'Default job' clean

Updated on March 12, 2025

Still need help?

The Atlassian Community is here for you.