Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Remote agent can't find task

John Bowker April 22, 2012

I'm using the BuildAgentRequirementFilter and I've run into a problem where my remote agents are not finding a BuildTask in the same plugin.

This is the message I get in Bamboo, I've removed the task name and task key in the string to post here.

Could not execute task '<Task Name>' no Plugin with key '<Build Task Key>' is installed.

Is this a bug with Bamboo or with the way the Agent Filter is implemented?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 23, 2012

How are you implementing the BuildAgentRequirementFilter? You should also note that the BuildAgentRequirementFilter is a Plugins v1 module so it cant be reloaded in development using atlas-cli (likely why the Task is missing). To make it work, you will need to start and stop atlas-debug every time you make a change.

John Bowker April 24, 2012

I tried using atlas-debug but I get the same issue.

This is my code for the BuildAgentRequirmentFilter, maybe I'm not implementing it correctly:

@Override
	public Collection&lt;com.atlassian.bamboo.v2.build.agent.BuildAgent&gt; filter(
			BuildContext buildContext,
			Collection&lt;com.atlassian.bamboo.v2.build.agent.BuildAgent&gt; agents,
			RequirementSet requirements) {
		
		Collection&lt;com.atlassian.bamboo.v2.build.agent.BuildAgent&gt; filtered = new ArrayList&lt;com.atlassian.bamboo.v2.build.agent.BuildAgent&gt;();
		
		out.println("Plan Name: " + buildContext.getPlanName());
	    final String projectName = buildContext.getProjectName();
	    final String jobName = buildContext.getShortName();
	    
	    try
	    {
			for(java.util.Iterator&lt;com.atlassian.bamboo.v2.build.agent.BuildAgent&gt; i = agents.iterator(); i.hasNext();)
			{
				com.atlassian.bamboo.v2.build.agent.BuildAgent agent = i.next();
				
				String agentName = agent.getName();
				
				out.println("Got agent: " + agentName + " ; Got job: " + jobName);
				
				if(agentName.contains(jobName))
				{
					out.println("Building " + jobName + " on this agent: " + agentName);
					filtered.add(agent);
				}
			}
			
			if(filtered.size() == 0)
			{
				out.println("No Agents Found");
			}
			
	    }
	    catch(Exception e)
	    {
	    	out.println("Some bad happened:\n" + e.toString());
	    }
		return filtered;
	}

John Bowker April 26, 2012

Just to add I also get this issue if I install the plugin to release version of Bamboo 4.0.

James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 26, 2012

What happens if you change

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">

to

<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="1">

Do you still get the same problem?

John Bowker April 26, 2012

Yep that solves the problem. I also found out that by splitting the task and build agent modules into 2 different plugins also did the trick.

Thanks for the help.

TAGS
AUG Leaders

Atlassian Community Events