Bamboo Java Specs doesn't create deployment environments after deleting and recreating the deployment projects

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

  1. Enable debugging for the below classpath:

    com.atlassian.bamboo.configuration.external
    Type:DEBUG
  2. Scan the Specs repository which is linked to the Deployment Project.
  3. Once the issue is observed, check the <Bamboo-home>/logs/atlassian-bamboo.log file. You should find something similar to the below: 

    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
  4. 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

  1. Rename the folder mentioned by the logs to some other name (like folder_backup).
    For example, the above logs mention the repository-203849805-master folder inside /data/application-data/bamboo/xml-data/build-dir/serverSide/REPOSITORY_STORED_SPECS/.
    Rename it to repository-203849805-master_bkp.

  2. Scan the Specs repository again.

This will fix the issue and the specs should successfully publish environment and permission details to your Deployment Projects.

Last modified on Dec 15, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.