Project: bamboo
Issue BAM-5425: Adding correct AWS account credentials gives a stack trace if the account does not have an EC2 subscription
It should instead give a regular error message informing the user of the problem. The stack trace is: {noformat} A communication error occurred while trying to validate the AWS account credentials. com.atlassian.aws.AWSException: Failed to determine validity of AWS credentials. com.atlassian.aws.AWSAccountImpl.validate(AWSAccountImpl.java:79) com.atlassian.bamboo.agent.elastic.server.ElasticInstanceManagerImpl.validateAwsCredentials(ElasticInstanceManagerImpl.java:167) com.atlassian.bamboo.ww2.actions.admin.elastic.ConfigureElasticCloudAction.testAWSCredentials(ConfigureElasticCloudAction.java:215) com.atlassian.bamboo.ww2.actions.admin.elastic.ConfigureElasticCloudAction.validate(ConfigureElasticCloudAction.java:129) com.atlassian.bamboo.ww2.actions.admin.elastic.ConfigureElasticCloudAction.doSave(ConfigureElasticCloudAction.java:167) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:592) com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:358) com.opensymphony.xwork.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:218) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:192) com.atlassian.bamboo.ww2.interceptors.BambooWorkflowInterceptor.doIntercept(BambooWorkflowInterceptor.java:30) com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.doIntercept(BambooValidationInterceptor.java:30) com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.JSONValidationInterceptor.intercept(JSONValidationInterceptor.java:83) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:174) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptor.intercept(WebworkSecurityInterceptor.java:63) com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptorProxy.intercept(WebworkSecurityInterceptorProxy.java:30) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.PaginationAwareInterceptor.intercept(PaginationAwareInterceptor.java:68) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.StatisticsAwareInterceptor.intercept(StatisticsAwareInterceptor.java:41) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.ResultsListAwareInterceptor.intercept(ResultsListAwareInterceptor.java:48) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.TestCaseAwareInterceptor.intercept(TestCaseAwareInterceptor.java:44) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.BuildResultsSummaryAwareInteceptor.intercept(BuildResultsSummaryAwareInteceptor.java:66) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.atlassian.bamboo.ww2.interceptors.BuildAwareInterceptor.intercept(BuildAwareInterceptor.java:47) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186) com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116) com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:274) com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.bamboo.filter.AccessLogFilter.doFilter(AccessLogFilter.java:61) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) com.atlassian.bamboo.filter.SeraphLoginFilter.doFilter(SeraphLoginFilter.java:61) org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) com.atlassian.bamboo.filter.BambooAcegiProxyFilter.doFilter(BambooAcegiProxyFilter.java:25) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.bamboo.filter.LicenseFilter.doFilter(LicenseFilter.java:73) com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:204) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:138) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:100) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:170) com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.bamboo.filter.CompressingFilter.doFilter(CompressingFilter.java:69) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.bamboo.filter.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:26) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:444) org.apache.coyote.ajp.AjpAprProtocol$AjpConnectionHandler.process(AjpAprProtocol.java:472) org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286) java.lang.Thread.run(Thread.java:595) Caused by: com.xerox.amazonws.ec2.EC2Exception: Client error : You are not subscribed to this service. Please go to http://aws.amazon.com to subscribe. com.xerox.amazonws.ec2.Jec2.makeRequestInt(Jec2.java:1680) com.xerox.amazonws.ec2.Jec2.describeAvailabilityZones(Jec2.java:1284) com.atlassian.aws.AWSAccountImpl.validate(AWSAccountImpl.java:69) ... 151 more {noformat} This bug was actually found on Studio 2.1 which is running Bamboo 2.5-m5 (long story).
Story points: 2