Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to clone plan - This plan name already exists

Steve Holzer March 8, 2023

A plan was cloned, then deleted.
The logs show the plan was deleted.
An attempt to clone the plan again returns the following two messages.

This plan name already exists.

This key is used by a plan scheduled for deletion. Please try again in a couple of minutes.

I can find no reference to the full key. 
No plans in the build table are showing as marked for deletion. 

How can we clear this state from Bamboo so that the plan can be created. 

The clone can be created using different plan name and key but this is not a workable solution for the team creating this plan.

This is a single node instance of Bamboo using PostgreSQL for backend. 

1 answer

0 votes
Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 8, 2023

Hello @Steve Holzer

That should work. I have tried reproducing your steps but could successfully clone the Plan giving it the same key as the deleted one and by using the cloned one as the source.

Please make sure to wait for Bamboo to purge the plan completely. It should take around 5 minutes or less. You should see messages such as the following in the logs:

2023-03-09 10:37:44,840 INFO [https-jsse-nio-45825-exec-23 url: /ajax/deleteChain.action; user: ealvarenga] [DeletionServiceImpl] Stopping any running builds for STEV-S1
2023-03-09 10:37:44,842 INFO [https-jsse-nio-45825-exec-23 url: /ajax/deleteChain.action; user: ealvarenga] [DeletionServiceImpl] Scheduling plan [STEV-S1] for deletion
2023-03-09 10:37:44,845 INFO [https-jsse-nio-45825-exec-23 url: /ajax/deleteChain.action; user: ealvarenga] [DeletionServiceImpl] Stopping any running builds for STEV-S1-JOB1

...
2023-03-09 10:39:31,779 INFO [DelayedDeletionThread] [DeletionServiceHelper] Deleting 1 job(s) marked for deletion

2023-03-09 10:39:31,780 INFO [DelayedDeletionThread] [DeletionServiceHelper] Deleting STEV-S1-JOB1
2023-03-09 10:39:31,932 INFO [DelayedDeletionThread] [ImmutablePlanCacheServiceImpl] Skipping invalidation, plan is being deleted: STEV-S1
2023-03-09 10:39:31,932 INFO [scheduler_Worker-3] [DeletionServiceHelper] Completed background deletion in 162.1 ms
2023-03-09 10:39:31,939 INFO [DelayedDeletionThread] [DeletionServiceHelper] Deleting 1 stage(s) marked for deletion
2023-03-09 10:39:31,939 INFO [DelayedDeletionThread] [PlanManagerImpl] Removing 1 stage(s) for plan STEV-S1
2023-03-09 10:39:31,950 INFO [DelayedDeletionThread] [ImmutablePlanCacheServiceImpl] Skipping invalidation, plan is being deleted: STEV-S1
2023-03-09 10:39:31,950 INFO [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-25] [DeletionServiceHelper] Completed background deletion in 17.64 ms
2023-03-09 10:39:31,959 INFO [DelayedDeletionThread] [DeletionServiceHelper] Deleting 1 TopLevelPlan(s) and/or ChainBranch(es) marked for deletion
2023-03-09 10:39:31,959 INFO [DelayedDeletionThread] [DeletionServiceHelper] Deleting STEV-S1

Then try cloning it again.

If that doesn't work, please reach out to Atlassian Support at https://support.atlassian.com/contact as we'll need to investigate the issue further.

Kind regards,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Steve Holzer March 10, 2023

Hello Eduardo,
Thanks for your response.
The issue seems to involve a Deletion Service bug and the team will need to work with Atlassian support to see if the issue can be fixed. There is risk here with this approach.

What has happened is that all plans mentioned in the application log have been successfully removed. No reference to them can be found in the database.

So on this instance all plans that get deleted are deleted, but due to the state of the deletion service, because of the bug, it never completes and so you can't use the plan name or key after that. 

Application restart does not help. 

Regards,

Steve

Eduardo Alvarenga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 10, 2023

Hello @Steve Holzer

Indeed it would be important to raise a case with Atlassian Support to have that investigated further. As mentioned, we were not able to reproduce it on the latest Bamboo release 9.2.1 and also on 8.2.5 by following the guidelines you have provided.

We are legitimately interested to find out more about it. When opening the case with Atlassian, kindly mention this community question to speed up things.

Alternatively, if you have the means to literally reproduce it you can open a BAM bug directly at https://jira.atlassian.com.

Cheers,

Eduardo Alvarenga
Atlassian Support APAC

--please don't forget to Accept the answer if the reply is helpful-- 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events