TFS Build Server Error: The build service host XXX is currently owned by XXX. A service host may only be active on one machine at a time.
A customer reported me the following problem with their TFS Build Server:
We had several occurrences of an error on the build development server that prevents the build controller from starting.
In the TFS Event log on the server, this error message appears:
Exception Message: The build service host XXX is currently owned by XXX. A service host may only be active on one machine at a time. (type BuildServiceHostOwnershipException)
A service restart will not correct this error.
One workaround we found is to reinitialize the build server status in the Team Foundation Server collection database.
Execute the following steps to do this:
- Determine what is the ServiceHostId of your build server (to get a key for the update):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ServiceHostId, DisplayName FROM tbl_BuildServiceHost |
- Update the record to reinitialize status:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE tbl_BuildServiceHost | |
SET [Status] = 2, | |
AcquiredOn = NULL, | |
ConnectedOn = NULL, | |
OwnerSessionId = NULL | |
WHERE ServiceHostId = {ServiceHostId} |
Remark: Be careful! This is a workaround, NOT an officially supported solution.