How To Troubleshoot TFS Build Server Errors

Sometimes are some helpless situations where you think you have tried every possible suggestion on the search engines to bring the build server back but it just won’t work. Before hunting around for a solution it is important to understand what the problem is, if the error messages in the build logs don’t seem to help you can always enable tracing on the build server to get more information on what could possibly be the main cause of failure.

how to enable tracing on, TFS Client , TFS 2010/11 Server ,Build Server

image

Enable TFS Tracing on the Client Machine
  • On the client machine, shut down Visual Studio, navigate to C:\Program Files\Microsoft Visual Studio 10.0\Common 7\IDE

image

  • Search for devenv.exe.config, make a backup copy of the config file and right click the file and from the context menu select edit. If its not already there create this file.

image

  • Edit devenv.exe.config by adding the below code snippet before the last </configuration> tag
<system.diagnostics>
  <switches>
    <add name="TeamFoundationSoapProxy" value="4" />
    <add name="VersionControl" value="4" />
  </switches>
  <trace autoflush="true" indentsize="3">
    <listeners>
      <add name="myListener"
      type="Microsoft.TeamFoundation.TeamFoundationTextWriterTraceListener,Microsoft.TeamFoundation.Common, 
          Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          initializeData="c:\tf.log" />
      <add name="perfListener" type="Microsoft.TeamFoundation.Client.PerfTraceListener,
           Microsoft.TeamFoundation.Client, 
           Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </listeners>
  </trace>
</system.diagnostics>
  • The highlighted path above is where the Log file will be created. If the folder is not already there then create the folder.
  • Start Visual Studio and after a bit of activity you should be able to see the new log file being created on the folder specified in the config file.
Enable Tracing on Team Foundation Server 2010/2011
  • On the Team Foundation Server navigate to C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\Web Services, right click web.config and from the context menu select edit.

image

  • Search for the <appSettings> node in the config file and set the value of the key ‘traceWriter’ to true.

image

  • In the <System.diagnostics> tag set the value of switches from 0 to 4 to set the trace level to maximum to write diagnostics level trace information.

image

  • Restart the TFS Application pool to force this change to take effect. The application pool restart will impact any one using the TFS server at present. Note – It is recommended that you do not make any changes to the TFS production application server, this can have serious consequences and can even jeopardize the installation of your server.

image

image

Enable Tracing on Build Controller/Agents
  • Log on to the Build Controller/Agent and Navigate to the directory C:\Program Files\Microsoft Team Foundation Server 2010\Tools

image

  • Look for the configuration file ‘TFSBuildServiceHost.exe.config’ if it is not already there create a new text file and rename it to ‘TFSBuildServiceHost.exe.config’

image

  • To Enable tracing uncomment the <system.diagnostics> and paste the snippet below if it is not already there.
<configuration>
  <system.diagnostics>
    <switches>
      <add name="BuildServiceTraceLevel" value="4"/>
    </switches>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="myListener" type="Microsoft.TeamFoundation.TeamFoundationTextWriterTraceListener,
             Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
             initializeData="c:\logs\TFSBuildServiceHost.exe.log" />
        <remove name="Default" />
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>
  • The highlighted path above is where the Log file will be created. If the folder is not already there then create the folder, also, make sure that the account running the build service has access to write to this folder.

image

  • Restart the build Controller/Agent service from the administration console (or net stop tfsbuildservicehost & net start tfsbuildservicehost) in order for the new setting to be picked up.

image

Other Info’s

Below are some Key resource you might like to review. I would highly recommend the documentation, walkthroughs and videos available on MSDN.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s