Deleting an ephemeral agent template leaves orphaned dedications in the Bamboo database

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 12.0.0, 9.6.14, 10.2.5, 11.0.2
    • Affects Version/s: 9.6.10, 10.2.3, 11.0.1
    • Component/s: Agents
    • None
    • 2
    • Severity 3 - Minor

      Issue Summary

      When deleting an ephemeral agent template, any dedications to plans/projects/jobs that the template had are not removed from the database, causing the plan/job/project to only build if dedicated to another available agent.

      Steps to Reproduce

      1. Create an ephemeral agent template
      2. Dedicate it to a plan
      3. Delete the template (not the assignment)

      Expected Results

      The agent dedication relationship between the plan and the ephemeral template should be automatically removed and the plan should now be able to run on any available agents (or any other existing agents/templates it's dedicated to)

      Actual Results

      The dedication is not removed from the database upon ephemeral template deletion, leaving orphaned entries. This causes the plan to only be runnable if it is dedicated to another existing, active agent/template again.

      Workaround

      1. Shutdown Bamboo.
      2. Connect to the Bamboo database and run the following query to identify the agent assignments/dedications that are linked to deleted ephemeral agent templates:
        SELECT aa.ASSIGNMENT_ID
        FROM
          AGENT_ASSIGNMENT aa
          LEFT JOIN EPHEMERAL_AGENT_TEMPLATE eat ON aa.EXECUTOR_ID = eat.EPHEMERAL_AGENT_TEMPLATE_ID
        WHERE
          eat.EPHEMERAL_AGENT_TEMPLATE_ID IS NULL
          AND aa.EXECUTOR_TYPE = 'EPHEMERAL';
        
      3. As a result, you'll get a list of IDs. E.g.,
        assignment_id
        1343494
        1409025
        1509080
      4. Copy all those IDs and paste them into the following query within the parentheses. Please note that each ID must be wrapped in single quotation marks, and there must be a comma between each ID. For example: WHERE aa.ASSIGNMENT_ID IN ('1343494', '1409025', '1509080')
        • Query to update and run:
          DELETE FROM AGENT_ASSIGNMENT
          WHERE ASSIGNMENT_ID IN (<IDs HERE>)
          
      5. Once the query has completed, you can run the first query again (the SELECT one) to ensure there are no orphaned assignments anymore.
      6. Once everything is OK, you can start Bamboo up again and validate that the plan should now be able to run on the available agents.

            Assignee:
            Mateusz Szmal
            Reporter:
            Eduardo Collaziol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: