Changing a Bamboo plan stage name produces an internal server error
Asked by Hugh McManus:

When I clone a plan and then try to change the name of a stage I get the following error:

Version: 2.7.1

Build: 2101

Build Date: 10 Nov 2010

system.error.request.information:

Stack Trace:

org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 25

at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590)

at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353)

at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375)

at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:337)

at com.atlassian.bamboo.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:88)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

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 $Proxy2.getPlanByName(Unknown Source)

at com.atlassian.bamboo.plan.PlanManagerImpl.getPlanByName(PlanManagerImpl.java:148)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

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 com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

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 $Proxy5.getPlanByName(Unknown Source)

at com.atlassian.bamboo.ww2.actions.build.admin.config.ConfigureBuildDetails.validate(ConfigureBuildDetails.java:61)

at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:154)

at com.atlassian.bamboo.ww2.interceptors.BambooWorkflowInterceptor.doIntercept(BambooWorkflowInterceptor.java:33)

at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:116)

at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.doIntercept(BambooValidationInterceptor.java:33)

at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.JSONValidationInterceptor.intercept(JSONValidationInterceptor.java:78)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:174)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptor.intercept(WebworkSecurityInterceptor.java:55)

at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptorProxy.intercept(WebworkSecurityInterceptorProxy.java:30)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.PaginationAwareInterceptor.intercept(PaginationAwareInterceptor.java:81)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.StatisticsAwareInterceptor.intercept(StatisticsAwareInterceptor.java:42)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.ResultsListAwareInterceptor.intercept(ResultsListAwareInterceptor.java:45)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.BuildResultsSummaryAwareInteceptor.intercept(BuildResultsSummaryAwareInteceptor.java:66)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.ResultsSummaryAwareInteceptor.intercept(ResultsSummaryAwareInteceptor.java:67)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.ChainAwareInterceptor.intercept(ChainAwareInterceptor.java:110)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.PlanAwareInterceptor.intercept(PlanAwareInterceptor.java:71)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.BuildConfigurationInterceptor.intercept(BuildConfigurationInterceptor.java:58)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.atlassian.bamboo.ww2.interceptors.BuildConfigurationEditInterceptor.intercept(BuildConfigurationEditInterceptor.java:58)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)

at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)

at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)

at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:274)

at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)

at com.atlassian.bamboo.ww2.BambooFilterDispatcher.doFilter(BambooFilterDispatcher.java:30)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)

at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.bamboo.filter.AccessLogFilter.doFilter(AccessLogFilter.java:66)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)

at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)

at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)

at com.atlassian.bamboo.filter.SeraphLoginFilter.doFilter(SeraphLoginFilter.java:66)

at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)

at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)

at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)

at com.atlassian.bamboo.filter.BambooAcegiProxyFilter.doFilter(BambooAcegiProxyFilter.java:25)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.bamboo.filter.LicenseFilter.doFilter(LicenseFilter.java:73)

at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:219)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:140)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)

at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)

at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69)

at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)

at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:170)

at com.atlassian.bamboo.persistence.BambooSessionInViewFilter.doFilterInternal(BambooSessionInViewFilter.java:31)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.planetj.servlet.filter.compression.CompressingFilter.handleDoFilter(CompressingFilter.java:203)

at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:193)

at com.atlassian.bamboo.filter.CompressingFilter.doFilter(CompressingFilter.java:69)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.bamboo.filter.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:31)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55)

at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:378)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:324)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535)

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:880)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

From the database it looks as if there are multiple stage id's in the build table. I'm only guessing here that this will cause an issue though without having looked at the bamboo code.

Testing this on 3.2 it also looks that a migration of the server from 2.7.1 to 3.2 will also produce these duplicate stage id's.

Can you please suggest a work around for this?


Answers:
author: James Dumay
body: I recommend getting in contact with [Atlassian Support](support.atlassian.com) as they can help you safely get around this issue.