Bamboo Java Specs doesn't create deployment environments after deleting and recreating the deployment projects
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
Bamboo cannot publish changes to Deployment Projects through Bamboo specs (using the same working version of Specs code used previously) after deleting the existing Deployment Projects and re-creating them.
Suppose, existing Deployment Projects were deleted and recreated with the exact same details again. When trying to publish environments and permissions in the re-created Deployment Projects by scanning the Bamboo Specs repository linked to this deployment project, the Specs do not modify the Deployment Projects with environment and permissions details.
Environment
All supported versions of Bamboo Specs.
Diagnosis
Enable debugging for the below classpath:
1 2
com.atlassian.bamboo.configuration.external Type:DEBUG
Scan the Specs repository which is linked to the Deployment Project.
Once the issue is observed, check the
<Bamboo-home>/logs/atlassian-bamboo.log
file. You should find something similar to the below:1 2 3 4 5 6 7
2022-08-30 13:01:14,511 DEBUG [15-BAM::SpecsDetection:pool-23-thread-3] [RepositoryStoredSpecsExecutionServiceImpl] Running command /opt/atlassian/bamboo/atlassian-bamboo-7.0.6/tools/apache-maven-3.5.0/bin/mvn --batch-mode --errors --file /data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/repository-203849805-master/checkout/bamboo-specs/specs868016682666927877.xml -Ppublish-specs -Dspecs.yamlDir=/data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/repository-203849805-master/internal-yamls -Dspecs.useRest=false -Dspecs.useSecurityManager=true -Dspecs.rs.specsSourceId=307789908 -Dspecs.bamboo.instanceName=Bamboo -Dmaven.test.skip=true -Dmaven.compiler.fork=false -Dbamboo.specs.version=7.0.6 -Dbamboo.specs.log.hideDate=true -Drss.default.branch=true -Drss.current.branch=bWFzdGVy ... 2022-08-30 13:01:28,098 DEBUG [15-BAM::SpecsDetection:pool-23-thread-3] [SpecsProcessingOptimizer] Found /data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/repository-203849805-master/imported-internal-yamls/70021/environment-permission/00252-7c4b1c5e-environment-permission-for-deployment-Accelerator---Watchdog-environment-A_C2A---variant--main.yaml that matches content of /data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/repository-203849805-master/internal-yamls/environment-permission/00252-7c4b1c5e-environment-permission-for-deployment-Accelerator---Watchdog-environment-A_C2A---variant--main.yaml, will not import it ... 2022-08-30 13:03:14,361 DEBUG [15-BAM::SpecsDetection:pool-23-thread-3] [EnvironmentPermissionsImporter] No changes in environments permissions properties. Skipping 2022-08-30 13:03:14,361 DEBUG [15-BAM::SpecsDetection:pool-23-thread-3] [AllTypesSpecsImporter] Processing /data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/repository-203849805-master/internal-yamls/environment-permission/00051-4a6e8fc3-environment-permission-for-deployment-Accelerator---Config-Manager-environment-B_C2A-INT---variant--main.yaml 2022-08-30 13:03:14,361 DEBUG [15-BAM::SpecsDetection:pool-23-thread-3] [EnvironmentPermissionsImporter] No changes in environments permissions properties. Skipping
As seen in the above logs, it started scanning the Specs repository but is not importing all the details from the Specs code as there's old repository data already stored at
/data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/
.
Cause
Specs are not able to publish the changes to the Deployment Projects as there's existing old repository data stored at <Bamboo-build-dir>/
serverSide/REPOSITORY_STORED_SPECS.
Solution
Rename the folder mentioned by the logs to some other name (like folder_backup).
For example, the above logs mention the repository-203849805-masterfolder inside
/data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/
.
Rename it torepository-203849805-master_bkp.
Scan the Specs repository again.
This will fix the issue and the specs should successfully publish environment and permission details to your Deployment Projects.
Was this helpful?