-
Bug
-
Resolution: Fixed
-
Medium
-
5.6.0
For plans with automatic branch management, if a branch is deleted in the VCS repo, the corresponding branch plan will be automatically disabled. It will then be deleted by Bamboo after a number of days (as per the "plan branch cleanup" setting) during the daily 3am branch expiry clean-up.
With 5.6 we've noticed that some plans are not having their branch plans expired up as they previously were. So far we've found this only affects plans that have a Stash repository (Git repos appear to be unaffected) where the branch has already been deleted from the VCS repo.
In these cases, the server logs from the 3am clean-up job include errors like this one below:
2014-08-05 03:00:00,045 INFO [QuartzScheduler_Worker-7] [BranchExpiryJob] Checking branches of Plan My Project - FOO 2014-08-05 03:00:00,045 INFO [QuartzScheduler_Worker-7] [BranchExpiryJob] Threshold date is Sun Jul 06 00:00:00 UTC 2014 2014-08-05 03:00:00,568 ERROR [QuartzScheduler_Worker-7] [BranchExpiryJob] Error in chain branch expiry com.atlassian.bamboo.plugins.stash.repository.StashRepositoryException: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'ssh://git@stash.example.com:7997/myproject/myrepo.git' on branch 'FOO-123_development_environment_setup'. Branch has probably been removed. at com.atlassian.bamboo.plugins.stash.StashRepository.getLastCommit(StashRepository.java:693) at com.atlassian.bamboo.plan.branch.BranchExpiryJob.execute(BranchExpiryJob.java:94) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) Caused by: com.atlassian.bamboo.repository.InvalidRepositoryException: Cannot determine head revision of 'ssh://git@stash.example.com:7997/myproject/myrepo.git' on branch 'FOO-123_development_environment_setup'. Branch has probably been removed. at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.obtainLatestRevision(NativeGitOperationHelper.java:543) at com.atlassian.bamboo.plugins.git.GitRepository.getLastCommit(GitRepository.java:590) at com.atlassian.bamboo.plugins.stash.StashRepository.getLastCommit(StashRepository.java:689) ... 7 more
and the branch plan will remain in Bamboo indefinitely (albeit disabled). We have branch plans from 2 months ago, despite 'Plan branch cleanup' being set to 'Remove after 7 days'.
Workaround
A temporary workaround to avoid having cluttered with so many branches will be to run this command on your database and restart Bamboo when you have downtime.
update build set marked_for_deletion=1 where suspended_from_building=1 and build_type="chain_branch";
- is duplicated by
-
BAM-14870 Bamboo doesn't expire branches that have been deleted in Stash
- Closed
- relates to
-
BAM-13129 Automatically delete the branch (not just disable) once it is removed from the git repository
- Closed
-
BDEV-7881 Loading...
-
BDEV-7878 Loading...
-
BDEV-7879 Loading...
-
BDEV-7880 Loading...
- causes
-
BUILDENG-6071 Loading...