Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-6957

Job/Chain Name duplication throws exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 2.7 beta2, 2.7
    • None
    • None
    • None

    Description

      My Project Name: AAAA
      My Chain Name: AAAA

      In one instance I tried to update an existing job to have the name AAAA. I got a validation error. I should theoretically be able to name my plan like this shouldn't I?

      During an attempt to reproduce the above behaviour, I tried to create a new Job with the name AAAA. This submitted successfully. However now I get a whole bunch of other exceptions:

      2010-09-30 10:17:41,755 ERROR [1638360365@qtp-1196121930-6] [FiveOhOh] 500 Exception was thrown.
      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.plan.PlanHibernateDao.getPlanByName(PlanHibernateDao.java:83)
      	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)
      

      The getPlanByName method only looks at the project name and plan name in the build table. And hence will return both the chain and the job.

      So we need to either
      a) prevent people from creating jobs with the same name as a plan (though this behaves the opposite to how we handle the keys)
      b) fix the getPlanByName method, and any other use cases which die because of the duplication.

      Attachments

        Activity

          People

            jdumay James Dumay
            bmccoy bmccoy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: