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

"No agents meet this job's requirements." after deleting dedicated agent

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Low Low
    • None
    • 5.8.1
    • Agents

      Repro Steps
      1. Create a build job for a build plan.
      2. Add a local agent.
      3. Dedicate the agent to perform the build job.
      4. Delete the agent.

      Expected outcome
      The build job will revert back to using any agent to run the task provided it's requirements are met.

      Actual outcome
      The build job says "No agents meet this job's requirements."

      Work around
      I can either:

      • Clone the job and delete the old one.
      • Shutdown Bamboo, backup the Bamboo database and use the below SQL to remove orphaned assignments:
        delete from agent_assignment where executor_id not in (select queue_id from queue) and executor_type='AGENT';

            [BAM-15965] "No agents meet this job's requirements." after deleting dedicated agent

            When agent is removed its assignments also removed from DB. Provided SQL script to remove orphaned records as adding an upgrade task for data cleanup looks not practical

            Alexey Chystoprudov added a comment - When agent is removed its assignments also removed from DB. Provided SQL script to remove orphaned records as adding an upgrade task for data cleanup looks not practical

            get inexistent agents dedicated to Project, Plan, Job, Deployment, Environment
            select * 
              from AGENT_ASSIGNMENT AA 
             where AA.EXECUTOR_TYPE = 'AGENT' 
               and AA.EXECUTOR_ID NOT IN (select QUEUE_ID from QUEUE);
            

            Basically, the SQL query above checks if there are any agent dedicated to sth (Project, Plan, Job, Deployment, Environment in AGENT_ASSIGNMENT table) against unknown agents in Bamboo (QUEUE table).

            If you find an agent that no longer exists:

            assignment_id executor_id executor_type executable_id executable_type
            55423616 23456789 AGENT 56122345 ENVIRONMENT
            • the Agent 23456789 is assigned to Environment 56122345
            • the Agent no longer exists 
            Warning

            Before running any INSERT, UPDATE, DELETE we strongly recommend:

            • stop Bamboo
            • backup database (i.e database dump)
            • backup filesystem (i.e. <bamboo-home> directory)
            • run the query
              delete from AGENT_ASSIGNMENT where EXECUTOR_ID = 23456789;
              
            • start Bamboo

            Rafael Sperafico (Inactive) added a comment - - edited get inexistent agents dedicated to Project, Plan, Job, Deployment, Environment select * from AGENT_ASSIGNMENT AA where AA.EXECUTOR_TYPE = 'AGENT' and AA.EXECUTOR_ID NOT IN ( select QUEUE_ID from QUEUE); Basically, the SQL query above checks if there are any agent dedicated to sth ( Project, Plan, Job, Deployment, Environment in  AGENT_ASSIGNMENT table ) against unknown agents in Bamboo ( QUEUE table ). If you find an agent that no longer exists: assignment_id executor_id executor_type executable_id executable_type 55423616 23456789 AGENT 56122345 ENVIRONMENT the Agent 23456789 is assigned to Environment 56122345 the Agent no longer exists  Warning Before running any INSERT, UPDATE, DELETE we strongly recommend: stop Bamboo backup database (i.e database dump) backup filesystem (i.e. <bamboo-home> directory) run the query delete from AGENT_ASSIGNMENT where EXECUTOR_ID = 23456789; start Bamboo

            I've just experienced the same thing for a number of builds on Bamboo 5.7.2 build 5716

            The workaround suggested seems to work but it's not good enough. Any updates on this issue?

            Christian Costa added a comment - I've just experienced the same thing for a number of builds on Bamboo 5.7.2 build 5716 The workaround suggested seems to work but it's not good enough. Any updates on this issue?

              achystoprudov Alexey Chystoprudov
              ac86c5436134 Derek Chow
              Affected customers:
              2 This affects my team
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: