Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-20762

Bamboo Specs fails if the linked repository assigned to the plan is deleted and created back with the same name

XMLWordPrintable

      Issue Summary

      Bamboo Specs, both executing from the IDE and using RSS will fail if the linked repository used by the plan is deleted from Bamboo and created back with the same name.

      Steps to Reproduce

      1. Create a plan via specs using a linked repository
      2. Delete the linked repository
      3. Recreate the liked repository with the same name
      4. Run the specs again or commit a change to the specs-enabled repository

      Expected Results

      The plan will be updated with the new repository ID

      Actual Results

      The plan will not be published and the below exception is thrown in the atlassian-bamboo.log file:

      2019-12-27 15:14:49,841 INFO [http-nio-8085-exec-20] [AccessLogFilter] root GET http://bamboo:8085/rest/api/latest/repository/22937601/scan/status?_=1577459087618 1565798kb
      2019-12-27 15:14:54,739 INFO [http-nio-8085-exec-25] [AccessLogFilter] root GET http://bamboo:8085/rest/api/latest/repository/80838661/scan/status?_=1577459087619 1546183kb
      2019-12-27 15:14:56,284 INFO [14-repository-stored-specs:pool-21-thread-1] [RepositoryStoredSpecsServiceImpl] Bamboo Specs execution took 4.977 s
      2019-12-27 15:14:56,580 INFO [15-BAM::SpecsDetection:pool-22-thread-1] [HungBuildPlanConfigurationPlugin] setting default values for edit page. custom.com.atlassian.bamboo.plugin.hungbuildkiller.hung.enabled
      2019-12-27 15:14:56,621 INFO [15-BAM::SpecsDetection:pool-22-thread-1] [HungBuildPlanConfigurationPlugin] setting default values for edit page. custom.com.atlassian.bamboo.plugin.hungbuildkiller.hung.enabled
      2019-12-27 15:14:56,654 WARN [15-BAM::SpecsDetection:pool-22-thread-1] [RepositoryStoredSpecsServiceImpl]
      java.lang.IllegalArgumentException: com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: planRepository / branchtest: Repository parent can not be changed.
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.lambda$validateAndCreateRepositoryObjects$8(PlanConfigImportServiceImpl.java:809)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:196)
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.validateAndCreateRepositoryObjects(PlanConfigImportServiceImpl.java:786)
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.lambda$modifyTopLevelPlanFunction$2(PlanConfigImportServiceImpl.java:513)
      	at com.atlassian.bamboo.core.ScopedExclusionServiceImpl.tryWithLock(ScopedExclusionServiceImpl.java:74)
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.modifyExistingTopLevelPlan(PlanConfigImportServiceImpl.java:405)
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.lambda$importPlan$0(PlanConfigImportServiceImpl.java:370)
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
      	at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate.execute(BambooTransactionHibernateTemplate.java:28)
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.importPlan(PlanConfigImportServiceImpl.java:351)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importPlanProperties(RepositoryStoredSpecsServiceImpl.java:1052)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importBambooYamlForPlan(RepositoryStoredSpecsServiceImpl.java:1023)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.lambda$importBambooYamlsOfAllTypes$6(RepositoryStoredSpecsServiceImpl.java:797)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importBambooYamlsWithImporter(RepositoryStoredSpecsServiceImpl.java:835)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importBambooYamlsOfAllTypes(RepositoryStoredSpecsServiceImpl.java:804)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.processSpecs(RepositoryStoredSpecsServiceImpl.java:567)
      	at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.runBambooSpecs(RepositoryStoredSpecsServiceImpl.java:308)
      	at com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl.runRssDetection(RssDetectionServiceImpl.java:284)
      	at com.atlassian.bamboo.configuration.external.detection.RssDetectionRunnable.run(RssDetectionRunnable.java:42)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
      	at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
      	at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: com.atlassian.bamboo.specs.api.exceptions.PropertiesValidationException: planRepository / branchtest: Repository parent can not be changed.
      	at com.atlassian.bamboo.vcs.configuration.service.VcsRepositoryConfigurationServiceImpl.validatePlanRepository(VcsRepositoryConfigurationServiceImpl.java:1255)
      	at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.lambda$validateAndCreateRepositoryObjects$8(PlanConfigImportServiceImpl.java:798)
      	... 27 more
      

      Workaround

      1. If using repository-stored Specs (RSS)
      • Delete the plan from Bamboo UI before committing the new changes to the repository
      2. If running specs from the IDE/Maven.
      • Delete the repository at plan's repository settings before executing the specs code again.

              mgardias Marcin Gardias
              gribeiro Gabriel Ribeiro
              Votes:
              25 Vote for this issue
              Watchers:
              25 Start watching this issue

                Created:
                Updated:
                Resolved: