-
Bug
-
Resolution: Fixed
-
Low
-
5.12.1, 6.4.0, 6.5.1
-
8
-
Severity 3 - Minor
-
1
-
Summary
Moving certain plan will have the error "cannot save merged build definitions"
Steps to Reproduce
- Create two Projects: ProjectA and ProjectB
- Create PlanA in ProjectA and PlanB in ProjectB
- Set PlanA to have produce a ArtifactA
- Set PlanB to have "Artifact download" task to download ArtifactA
- Create a branch plan in PlanB
- Move PlanA from ProjectA to ProjectB
Expected Results
Move successfully
Actual Results
Move fail with the error message "Transaction rolled back because it has been marked as rollback-only" in the UI.
The below exception is thrown in the atlassian-bamboo.log file:
2016-06-08 16:35:18,441 INFO [http-nio-8085-exec-9] [TransactionalPlanMover] Finished updating artifacts 2016-06-08 16:35:51,616 ERROR [http-nio-8085-exec-9] [AsynchronousAbleEventDispatcher] There was an exception thrown trying to dispatch event [com.atlassian.bamboo.chains.events.ChainMovingEvent[source=com.atlassian.bamboo.plan.move.TransactionalPlanMover@1830b4d9] plan=SHD-TOOL] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.bamboo.plugins.artifact.ArtifactDownloaderTaskEventListener.onChainMoving(com.atlassian.bamboo.chains.events.ChainMovingEvent), listener=com.atlassian.bamboo.plugins.artifact.ArtifactDownloaderTaskEventListener@129d624c}] java.lang.RuntimeException: cannot save merged build definitions at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:46) at com.google.common.util.concurrent.MoreExecutors$DirectExecutorService.execute(MoreExecutors.java:299) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:105) at com.atlassian.bamboo.event.spi.BambooEventDispatcher.dispatch(BambooEventDispatcher.java:38) at com.atlassian.event.internal.LockFreeEventPublisher$Publisher.dispatch(LockFreeEventPublisher.java:260) at com.atlassian.event.internal.LockFreeEventPublisher.publish(LockFreeEventPublisher.java:102) at com.atlassian.bamboo.plan.move.TransactionalPlanMover$1.run(TransactionalPlanMover.java:281) at com.atlassian.bamboo.plugin.BambooPluginUtils$Runnable.call(BambooPluginUtils.java:192) at com.atlassian.bamboo.plugin.BambooPluginUtils$Runnable.call(BambooPluginUtils.java:182) at com.atlassian.bamboo.plugin.BambooPluginUtils.callUnsafeCode(BambooPluginUtils.java:132) at com.atlassian.bamboo.plan.move.TransactionalPlanMover.publishChainMovingEvent(TransactionalPlanMover.java:276) at com.atlassian.bamboo.plan.move.TransactionalPlanMover.moveSinglePlan(TransactionalPlanMover.java:202) at com.atlassian.bamboo.plan.move.TransactionalPlanMover.moveMaster(TransactionalPlanMover.java:139) ... Caused by: java.lang.IllegalArgumentException: cannot save merged build definitions at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) at com.atlassian.bamboo.plan.PlanHibernateDao.save(PlanHibernateDao.java:456) at com.atlassian.bamboo.plan.PlanHibernateDao.save(PlanHibernateDao.java:51) at sun.reflect.GeneratedMethodAccessor1139.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ... 2016-06-08 16:35:51,916 ERROR [http-nio-8085-exec-9] [MoveBuilds] Unable to move plans com.atlassian.bamboo.plan.MovePlansException: org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only at com.atlassian.bamboo.plan.move.MovePlanBatchCoordinator.movePlans(MovePlanBatchCoordinator.java:58) at com.atlassian.bamboo.plan.move.MovePlanServiceImpl.movePlansToProject(MovePlanServiceImpl.java:37) at com.atlassian.bamboo.ww2.actions.build.admin.MoveBuilds.execute(MoveBuilds.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497)
Workaround
- Click on the Move button again
OR - Remove the "Artifact download" task first before moving the plan again
Notes
- The first workaround depends on the number of tasks and branch plans
- If there are two "Artifact download" tasks to download ArtifactA and two branch plans in PlanB, the number of time to click on the Move button is (2 x 2 + 1) = 5
- If there are other plans with "Artifact download" tasks that will download ArtifactA and have branch plans as well, the number will increase too, eg:
PlanB have 2 "Artifact download" tasks and 2 branch plans = 2 x 2 = 4
PlanC have 3 "Artifact download" tasks and 4 branch plans = 3 x 4 = 12
Total number to click Move button = 4 + 12 + 1
- Incorrect setting in "Artifact download" task
- If PlanB have two stages and both stages have "Artifact download" task to download ArtifactA, only the second stage in PlanB is updated to refer to the correct project. The first stage is still referring to the ProjectA
- Running the build will have an error even though the "Artifact download" task is disabled
- is cloned as
-
BDEV-14986 Loading...
- mentioned in
-
Page Failed to load
[BAM-17655] Unable to move a plan that provides an artifact to another project with a plan that consumes it
Workflow | Original: Bamboo Workflow 2016 v1 - Restricted [ 1443793 ] | New: JAC Bug Workflow v3 [ 3385866 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Fix Version/s | New: 6.8.0 [ 81602 ] | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Assignee | New: Krystian Brazulewicz [ kbrazulewicz ] |
Remote Link |
New:
This issue links to "+core+ New and Tasty › C Checks › |
Remote Link |
New:
This issue links to "+core+ New and Tasty › A Core Builds › |
Support reference count | Original: 7 | New: 8 |
Remote Link | Original: This issue links to "PS-34372 (Atlassian Support System)" [ 402167 ] |
Remote Link | New: This issue links to "PS-34372 (Atlassian Support System)" [ 402167 ] |
Affects Version/s | New: 6.5.1 [ 79795 ] |
Labels | Original: bamboo-bugfix-kanban da-build-plans da-projects pse-request support-request | New: bamboo-bugfix-kanban da-build-plans da-projects pse-request support-request support-request-triaged |