title: TFS Build Agent stopped
body: <p>I have a problem with a running build machine, where the agent suddenly does not want to start. It's been a part of a remote controller and for trouble shooting this issue, if started a local controller. The symptoms are, at the agent(s) initializes correct (says 'Ready'), but has the stopped icon and in the status area says 'BuildController has not been started in 1 minutes. The AD account running the build service works on another build machine (seperate controller + build agents). I've tried the following</p>
  
  <ul>
  <li>Reinstall the build service</li>
  <li>running with machine name, fully qualified domain name and IP address for endpoint address</li>
  <li>un- and re-registered build service</li>
  <li>rebooted</li>
  <li>cleaned up build agent registrations with <a href="http://blogs.msdn.com/b/lab_management/archive/2010/02/09/additional-upgrade-script-for-fixing-build-agent-registration.aspx" rel="nofollow">script</a></li>
  </ul>
  
  <p>If I change the service account running the build service to my own AD account, it works. However, running under our dedicated build user failes on this particular machine, but not the other. Any suggestions what to do? Here's the error from the event log:</p>
  
  <pre><code>Service 'Default Agent - tfs2010build1' had an exception: 
  Exception Message: There was no endpoint listening at http://tfs2010build1:9191/Build/v3.0/Services/Controller/31 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. (type EndpointNotFoundException)
  
  Exception Stack Trace: 
  Server stack trace: 
     at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
     at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
  
  Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)
     at Microsoft.TeamFoundation.Build.Machine.IBuildControllerService.TestConnectionFromController(String agentUri)
     at Microsoft.TeamFoundation.Build.Machine.ServiceProxies.ServiceProxy`1.&lt;&gt;c__DisplayClass3.&lt;Do&gt;b__2(T channel)
     at Microsoft.TeamFoundation.Build.Machine.ServiceProxies.ServiceProxy`1.Do[TResult](Func`2 action)
     at Microsoft.TeamFoundation.Build.Machine.BuildAgentService.&lt;&gt;c__DisplayClass12.&lt;TestConnection&gt;b__11(Object )
  
  Inner Exception Details:
  
  Exception Message: Unable to connect to the remote server (type WebException)
  Exception Stack Trace:    at System.Net.HttpWebRequest.GetRequestStream(TransportContext&amp; context)
     at System.Net.HttpWebRequest.GetRequestStream()
     at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
  
  Inner Exception Details:
  
  Exception Message: No connection could be made because the target machine actively refused it 127.0.0.1:38742 (type SocketException)
  
  Exception Stack Trace:    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
     at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp; socket, IPAddress&amp; address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception&amp; exception)
  </code></pre>