Uploaded image for project: 'Bamboo'
  1. Bamboo
  2. BAM-14259

Duplicate AMI names causes "IncorrectResultSizeDataAccessException: query did not return a unique result: 2" stack trace upon editing image configuration

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: 5.4, 5.4-OD-5
    • Fix Version/s: 5.8
    • Component/s: Elastic Bamboo
    • Labels:
    • Last commented by user?:
      true
    • Comments:
      3

      Description

      There are two elastic images called "EBS x86_64 (linux)", with AMIs ami-270b444e and ami-4488f72d. When you go to change anything in one of those two (say, changing the instance size), upon clicking save you're greeted with this stack trace:

      org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2
      	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.agent.elastic.server.ElasticImageConfigurationHibernateDao.getElasticImageConfigurationByName(ElasticImageConfigurationHibernateDao.java:187)
      	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 $Proxy98.getElasticImageConfigurationByName(Unknown Source)
      	at com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationAccessorImpl.getElasticImageConfigurationByName(ElasticImageConfigurationAccessorImpl.java:52)
      	at com.atlassian.bamboo.agent.elastic.server.ElasticImageConfigurationManagerImpl.getElasticImageConfigurationByName(ElasticImageConfigurationManagerImpl.java:69)
      	at com.atlassian.bamboo.ww2.actions.admin.elastic.ConfigureElasticImageConfiguration.validate(ConfigureElasticImageConfiguration.java:380)
      	at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:251)
      	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
      	at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.validate(BambooValidationInterceptor.java:48)
      	at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.access$000(BambooValidationInterceptor.java:12)
      	at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor$1.call(BambooValidationInterceptor.java:28)
      	at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor$1.call(BambooValidationInterceptor.java:24)
      	at com.atlassian.bamboo.util.BambooProfilingUtils.withUtilTimerStack(BambooProfilingUtils.java:49)
      	at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.doIntercept(BambooValidationInterceptor.java:23)
      	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      [...]
      

      Ideally Bamboo shouldn't be relying on the name alone to identify the images.

      Workaround

      1. Edit one of the two affected AMI's (Ubuntu: EBS x86_64 (linux) or Amazon Linux EBS x86_64 (linux) )
      2. Change only the name of the AMI (EBS x86_64 (linux) to EBS_x86_64 (linux) for example)
      3. Save the Image configuration

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Last commented:
                  2 years, 46 weeks, 5 days ago