Could not update chain with key PROJ-* as it's being modified in another thread.

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

Whenever the Bamboo Specs repository has a new commit, the Specs code fails to run and throws the below error.

1 2 Could not update chain with key XXX-* as it's being modified in another thread. java.lang.IllegalStateException: Could not update chain with key FAB-* as it's being modified in another thread.

Bamboo Specs code executes successfully, but the actual modification fails to happen in the plan. When we see the Specs log, we see the below exception.

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 29-Oct-2019 12:21:40 [INFO] ------------------------------------------------------------------------ 29-Oct-2019 12:21:40 [INFO] BUILD SUCCESS 29-Oct-2019 12:21:40 [INFO] ------------------------------------------------------------------------ 29-Oct-2019 12:21:40 [INFO] Total time: 8.190 s 29-Oct-2019 12:21:40 [INFO] Finished at: 2020-10-09T12:21:40+08:00 29-Oct-2019 12:21:41 [INFO] Final Memory: 24M/845M 29-Oct-2019 12:21:41 [INFO] ------------------------------------------------------------------------ 29-Oct-2019 12:21:56 Could not update chain with key YYYYYYY as it's being modified in another thread. 29-Oct-2019 12:21:56 java.lang.IllegalStateException: Could not update chain with key YYYYYYY as it's being modified in another thread. 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.modifyExistingTopLevelPlan(PlanConfigImportServiceImpl.java:413) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.lambda$importPlan$0(PlanConfigImportServiceImpl.java:370) 29-Oct-2019 12:21:56 at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.persistence.BambooTransactionHibernateTemplate.execute(BambooTransactionHibernateTemplate.java:28) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.PlanConfigImportServiceImpl.importPlan(PlanConfigImportServiceImpl.java:351) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importPlanProperties(RepositoryStoredSpecsServiceImpl.java:1041) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importBambooYamlForPlan(RepositoryStoredSpecsServiceImpl.java:1012) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.lambda$importBambooYamlsOfAllTypes$6(RepositoryStoredSpecsServiceImpl.java:786) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importBambooYamlsWithImporter(RepositoryStoredSpecsServiceImpl.java:824) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.importBambooYamlsOfAllTypes(RepositoryStoredSpecsServiceImpl.java:793) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.processSpecs(RepositoryStoredSpecsServiceImpl.java:556) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.runBambooSpecs(RepositoryStoredSpecsServiceImpl.java:304) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.RssDetectionServiceImpl.runRssDetection(RssDetectionServiceImpl.java:284) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.configuration.external.detection.RssDetectionRunnable.run(RssDetectionRunnable.java:42) 29-Oct-2019 12:21:56 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 29-Oct-2019 12:21:56 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 29-Oct-2019 12:21:56 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 29-Oct-2019 12:21:56 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17) 29-Oct-2019 12:21:56 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41) 29-Oct-2019 12:21:56 at java.lang.Thread.run(Thread.java:748)

Solution

The stack trace Could not update chain with key PROJKEY-PLANKEY as it's being modified in another thread means that the specs code is modifying a Plan that is already being modified. This usually happens when the same linked repository is defined twice elsewhere and that runs Specs code at the same time. Check in the Specs code if the repository has been defined in the linked repository twice possibly with different names.

If you see a duplicate, delete one of them and rerun the Specs code by clicking on the Scan button under the Specs status tab.

Updated on March 18, 2025

Still need help?

The Atlassian Community is here for you.