Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.5.1
Description
Steps to reproduce:
1- Have a deployment plan configured with 2 triggers. For example, configure 2 triggers, one for each branch:
Configure trigger in the shortcut highlighted below:
Detail of the configuration above - Triggers:
If the deployment is triggered using two different plan branches, for example:
2- If your Build Plan Branches are configured to be built automatically (for example, every time "Stash repository triggers the build when changes are committed"), and you commit to the different branches in your Stash repo alternately, that will trigger the notification issue. Manually deploying 2 different branches alternately will also result on the error below and no notification will be sent.
If a 'Deployment Finished Notification multipart email' is attempted the following error is thrown:
2014-10-14 08:54:01,859 ERROR [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-13] [MultipartEmailTransport] Failed to send out Deployment Finished Notification multipart email java.lang.IllegalStateException: Compared versions should be created off the same branch at com.google.common.base.Preconditions.checkState(Preconditions.java:145) at com.atlassian.bamboo.deployments.versions.persistence.DeploymentVersionDaoImpl.findVersionsBetween(DeploymentVersionDaoImpl.java:400) at sun.reflect.GeneratedMethodAccessor1932.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy55.findVersionsBetween(Unknown Source) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.findVersionsBetween(DeploymentVersionServiceImpl.java:689) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionVcsChangesetServiceImpl.compareVersionsByChangesets(DeploymentVersionVcsChangesetServiceImpl.java:101) at com.atlassian.bamboo.deployments.notification.DeploymentFinishedNotification.getContext(DeploymentFinishedNotification.java:123) at com.atlassian.bamboo.deployments.notification.DeploymentFinishedNotification.getEmailSubject(DeploymentFinishedNotification.java:73) at com.atlassian.bamboo.notification.transports.AbstractEmailTransport.beginEmail(AbstractEmailTransport.java:54) at com.atlassian.bamboo.notification.transports.MultipartEmailTransport.sendNotification(MultipartEmailTransport.java:55) at com.atlassian.bamboo.notification.NotificationDispatcherImpl.dispatchNotifications(NotificationDispatcherImpl.java:60) at com.atlassian.bamboo.deployments.notification.DeploymentNotificationEventListener.onDeploymentFinished(DeploymentNotificationEventListener.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) at com.atlassian.bamboo.event.spi.EventInvokerRunnable.run(EventInvokerRunnable.java:29) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 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 java.lang.Thread.run(Thread.java:745) 2014-10-14 08:54:01,893 ERROR [AtlassianEvent::0-BAM::EVENTS:pool-1-thread-13] [EventInvokerRunnable] Uncaught exception running event: com.atlassian.bamboo.deployments.execution.events.DeploymentFinishedEvent@3fdd635 and invoker SingleParameterMethodListenerInvoker{method=public void com.atlassian.bamboo.deployments.notification.DeploymentNotificationEventListener.onDeploymentFinished(com.atlassian.bamboo.deployments.execution.events.DeploymentFinishedEvent), listener=com.atlassian.bamboo.deployments.notification.DeploymentNotificationEventListener@6c5233f3} java.lang.RuntimeException: Compared versions should be created off the same branch at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) at com.atlassian.bamboo.event.spi.EventInvokerRunnable.run(EventInvokerRunnable.java:29) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 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 java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalStateException: Compared versions should be created off the same branch at com.google.common.base.Preconditions.checkState(Preconditions.java:145) at com.atlassian.bamboo.deployments.versions.persistence.DeploymentVersionDaoImpl.findVersionsBetween(DeploymentVersionDaoImpl.java:400) at sun.reflect.GeneratedMethodAccessor1932.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy55.findVersionsBetween(Unknown Source) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.findVersionsBetween(DeploymentVersionServiceImpl.java:689) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionVcsChangesetServiceImpl.compareVersionsByChangesets(DeploymentVersionVcsChangesetServiceImpl.java:101) at com.atlassian.bamboo.deployments.notification.DeploymentFinishedNotification.getContext(DeploymentFinishedNotification.java:123) at com.atlassian.bamboo.deployments.notification.DeploymentFinishedNotification.getHtmlImContent(DeploymentFinishedNotification.java:85) at com.atlassian.bamboo.hipchat.HipchatNotificationTransport.sendNotification(HipchatNotificationTransport.java:87) at com.atlassian.bamboo.notification.NotificationDispatcherImpl.dispatchNotifications(NotificationDispatcherImpl.java:60) at com.atlassian.bamboo.deployments.notification.DeploymentNotificationEventListener.onDeploymentFinished(DeploymentNotificationEventListener.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) ... 8 more
If the revisions are from different branches Bamboo should just not include the comparison and fire off the rest of the email instead of failing the entire email.
This reportedly affects Hipchat notifications firing off as well.
Workaround
Configure each Plan Branch to be deployed into two different environments.