RSS

TFS: The case of the phantom Build Agent

Saturday, 31 July 2010

We have used Team Foundation Server (TFS) for a number of years now across many of the divisions of the organisation, including the development teams in Melbourne, Sydney, Brisbane and Shanghai for many years. We use it for our work item tracking, source control, managing our build processes and storing project documentation. We are also in the process of finalising using TFS for running workflow in all other parts of the business, and I hope to write further details about that in the coming weeks.

So as I was investigating an issue with our TFS Warehouse (another post) being stale, I noticed we were receiving a whole bunch TFS Build warnings in the event log (over 150 every hour!) on our main TFS install (TFS08). The warning message was:

TF53010: The following error has occurred in a Team Foundation component or extension

Exception Message: The file '/Build/v2.0/AgentService.asmx' does not exist. (type HttpException)

So while I was waiting for the TFS Warehouse to rebuild (read: a LONG time), I dug a little deeper.

First, I jumped onto the TFS08 server, and opened into IIS Manager to see if the actual file existed. It didn't. So I jumped onto a build agent box (BUILDER) and saw that it didn't have the path /Build/v2.0/AgentServices.asmx either. Strange.

So Aaron asked on Stack Overflow whether anyone had any details, and Martin Woodward answered asked a few more questions. One thing that got my attention is that the URL is made available through WCF by the Team Foundation Build service, so is not actually a physical file. Looking at the services in TFS08, I saw that no Build services were installed (all building is done on dedicated build boxes like BUILDER) so there was obviously a misconfiguration somewhere.

We have over 500 projects on our TFS08 server, and it was going to be time consuming to open each Team Project in Team Explorer and check the Build Agent by using the Build / Manage Build Agent dialog.

So I RDP'd to the TFS08 DB server and opened the TfsBuild database to look for a rogue agent, and found that someone had somehow configured up a Build Agent and pointed it back to the TFS08 server that had no Build services installed (I believe this was configured on an old TFS05 server that was decommissioned and the TFS08 server picked up its old name). The MachineName of the entry in tbl_BuildAgent table pointed to the TFS08 machine, not BUILDER.

So I grabbed the GroupId (15) and ran the query below on the tbl_BuildGroup to find some details:

SELECT     GroupId, TeamProject, GroupPath, GroupName, Description
FROM         tbl_BuildGroup
WHERE     (GroupId = 15)

This showed me the TeamProject 'URI' for the TeamProject (vstfs:///Classification/TeamProject/9c180aa7-e3e8-45b4-8e45-cb4668bab508) which I could then use the UUID part to find the project name using this query on the TfsIntegration table:

SELECT     project_id, project_name, state, last_update
FROM         tbl_projects
WHERE     (project_id = '9c180aa7-e3e8-45b4-8e45-cb4668bab508')

This gave me the Project Name. It was then a simple case of deleting the build agent from the project configuration using Team Explorer, and the errors stopped instantly :)


This entry was written by Karl Kopp, posted on Saturday, 31 July 2010 Bookmark the permalink. Follow any comments here with the RSS feed for this post. You can post a comment.

Post a comment

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact me so we can take care of it!

Visit my friends!

A few highly recommended friends...

About

Some semi-interesting ramblings from a technology geek (me, Karl Kopp) about some future adventures...