TFS Problems communicating between Build Controller and Build Agent on same machine - visual-studio-2013

We're working on setting up a TFS server for our work, and I'm in charge of getting the build working. I have had no experience with TFS before, but setting the build controller and agents up using the wizards was easy enough. We have the TFS server on one machine, and a build controller and build agent on another machine registered to the TFS server.
When I start a build from my developer machine, the build reports as having started and the status of the controller changes to something like "running build vstfs://Build/Build/16". However, the status of the Agent never changes from "Ready" and the build hangs indefinitely. If I stop the build from my developer machine, it reports that the "build was forcefully stopped by the server because the build machine did not respond to a stop request", and the build controller still has the status of "running build". I need to restart the build controller in order to reset the status.
I've checked that port 9191 is unblocked, and I can telnet into the port from my developer machine. The server also seems to be able to communicate with the build machine, as the controller is receiving build requests, but I have no idea what to do from here. Any TFS experts have any idea what might be happening?
Thanks,
Zach

Found the problem.
Under the build service properties, We had the value "Listen for build agent communication on:" set to [BUILDAGENT.companydomain.com:9191/Build/v5.0/Services. We needed the value to be just [BUILDAGENT:9191/Build/v5.0/Services]

Related

TeamCity JMeter plugin not showing remote monitoring

I've followed this guide to have my TeamCity build running some JMeter tests, but I'm not seeing the "RemotePerfMon" tab for the server statistics. I have the "Performance Statistics" tab, and I can see that the statistics are definitely being collected, as there is a monitoring.csv file being created and populated in the build agent's work directory.
Any ideas on how I can get the tab to display?
I'm using TeamCity v9.1.6 with JMeter plugin version 83, everything running on Windows 8.
Additional Info:
I've found that there is an open issue on Github for this problem, so I'm obviously not the only one facing this issue.
Make sure TeamCity is NOT running as Administrator
After quite a while playing around with it, I discovered that the problem was that both the TeamCity Server and the TeamCity build agent were running on the same machine, but the Build agent was running as Administrator. Stopping both the services and restarting them as a regular user fixed the issue.
I believe the root of the issue was that the monitoring.csv file was created by the Build Agent as Administrator, then wen the non-admin server agent attempted to parse it, it failed. This error doesn't seem to get logged anywhere, and TeamCity responds to the error by simply not displaying the tab.

AppOffline rule issue w/ Continuous Integration/Build

I've connected Visual Studio Team Services to an Azure Website to enable automatic deployments. New Relic is running as a system process and therefore NewRelic.Agent.Core.dll is locked which prevents successful builds from being deployed.
I've tried adding a wpp.targets file to the solution in order to utilize MSDeploy to copy an app_offline document to the site before deployment, then delete it when deployment is done like seen here. However, it doesn't seem as if it is executing. I don't see anything in the build logs and my deployments continue to fail.
How do I take the app offline when using the VS Team Services/Azure CI process?
I came across this old post and there are now build tasks to start and stop an app service. See the Azure App Service Manage under the deployment tasks in the build task catalog.
Slightly different to what you are asking but what you could do is to login to your Azure website and set COR_ENABLE_PROFILING to 0 before your build runs. You then deploy as normal. Once done you set COR_ENABLE_PROFILING back to 1.
The act of changing the setting will cause an IIS reset and setting it to zero will disable the file from being locked again before the publish finishes.
Source: https://discuss.newrelic.com/t/visual-studio-online-azure-website-continuous-integration-fails/3825

TeamCity forcing "checking for changes" only on agent

I have the following set-up:
TeamCity server running on one machine
TeamCity agent on a separate machine, connected via VPN to source control (TFS).
The VPN is a bit tricky to set up to run as a service so can't/don't want to set it up on the server as well. Rather, I was hoping to have everything go through that agent.
The build server fails while collecting sources, it appears it's trying to figure out what changes were performed in TFS (but it can't find the TFS host since it's not on that VPN). The build is set to check out the sources only on the agent.
I'm afraid the answer is obvious, but couldn't find any documentation confirming this...Is it possible to have such a setup? Or does the build server need access to the TFS repo to check for changes and trigger builds?
The TeamCity server will still require access to the VCS root to evaluate the current revision and changeset details.
It's important to note the additional side-effects of agent side checkout as well. See VCS Checkout Mode in the TeamCity docs for more information (note the 2nd line).

MS Web Deployment script errors and TeamCity

So we make use of TeamCity as a CI server (v 7.1.1). And we use MS' own web deployment tool as a means of publishing to our servers (standard ASP.NET fare). However, I've noticed that the batch files that are generated by web deploy seem to play badly with TeamCity.
This is what appears in the build log:
http://dpaste.com/826346/
The script clearly says an error has happened. However, TC seems unable to detect this, as no red lights come on. Is there a (good) way to fix and detect this, so we don't get incorrect build runner status reports? TC is currently setup so that the deployment script is executed by a Command Line runner.
To fix it, change the IIS site AppPool to .net version 4.0 - Your error message says that the app expects 4.0 but web deployment tool is finding 2.0
To detect it, I think you can configure the Build Failure Condition, to fail a build when "an error message is logged by build runner".

In Team foundation server what is build agent and controller?

I am unable to grasp the concept of build server in Team foundation. Can anybody explain ? Also what is the build agent and controller in the foundation server ?
In TFS, the build system consists of two main constructs: the Build controller and the Build agents.
The Controller's job is to queue build requests and send them to the "most available" build agent.
The Agent's job is to perform the actual build.
This setup allows you to easy grow into a "Build Farm", which the controller is dispatching to any number of agents, allowing your build platform to scale without being redesigned.
The phrase "build server" or "build machine" simply indicates a server on which the build controller, the build agent(S), or both run. In a smaller shop, you'd probably only have one build machine and it's likely that box would also be doing some other actions.
The MSDN info is pretty good on this, as are any # of blogs.
MSDN: Build Machines
http://msdn.microsoft.com/en-us/library/ms181712.aspx
MSDN Build Controllers
http://msdn.microsoft.com/en-us/library/ee330987.aspx
MSDN Build Agents
http://msdn.microsoft.com/en-us/library/bb399135.aspx

Resources