metro-problem-icon
 

TFS 2012 – Issue: Stuck builds in Team Foundation Build with no build number

Subscribe Subscribe

 

When you queue a build you never get a build number and the build never completes. image
Figure: Stuck build

You can see the two previous attempts with no build number.

Applies to

  • Visual Studio 2012 Team Foundation Server

Findings

If you are having this problem then the first thing to check is the logs…

image
Figure: Diagnostics has blank logs

But no… there are no logs to view…

SNAGHTML172e6051
Figure: Nasty red stop sign

Next thing is to check the controller and see what is going on. In this case the Build Service is in the “Started” state and the Controller is in the “Ready” state, but there is a little red square that I guess signifies “Stopped” on the graphic.

This is a little confusing as it looks like all is well except for the red.

Please can we make the red square and green play button a tick and a cross so that it is consistent with the rest of the product, or at lease a cross for error, tick for ok and the red stop for… well.. stopped…
-Suggestion to the TFS Product Team

As this may have been a problem with this server I moved the controller to the same server as the agents to see what effect this would have. I had been having a bunch of issues with this server and this was part of my “last ditch efforts” though patterns. I did look in the event log, but I did not notice something important.

image
Figure: Agents and Controllers on a separate server is worse

At this point I asked for some help and was asked if I had clicked that little “details” button. I had not, face palm, and I did not… low and behold this was a web service problem…now.. I has seen some errors earlier,  but I did not think that they related so time to check the event log with a little more scrutiny.

image
Figure: http 500 errors smack of IIS or Web Services

The error logs showed an interesting exception… some kind of WebHost error…

Figure: WebHost failed to process a request 

The error message talks of “This collection already contains an address with scheme http”, dam but it is pulling a Highlander on me (There can be only one). So lets take a look at the IIS settings…

image
Figure: There  are multiple host headers on TFS in IIS

Sure enough there are three entries for http in the bindings. I had seen them before in there but though nothing of it… why would you not be able to add a bunch of host headers to an IIS site!

Workaround

The web.config for the message queuing web service is in the “Microsoft Team Foundation Server 11.0Application TierMessage Queue” and I followed the instructions to add multipleSiteBindingsEnabled  to the serviceHostingEnvironment element.

Figure: Multiple site bindings enabled

Now when I restart the Team Foundation Build service I get all green “play” graphics. (hope)

Checking the event log shows no new errors and the services still show green. (expectation)

Kicking of a build results in… a build number and a failed build. (elation)

image
Figure: Build failed… whoop… success…

While this may be a failed build it is a success for this exercise of getting the build server working…

Thanks to Patrick Carnahan for his help on this one.

TFS 2012 – Issue: Stuck builds in Team Foundation Build with no build number was last modified: August 29th, 2012 by Martin Hinshelwood

-Every company deserves working software that successfully and consistently meets their customers needs on a regular cadence. We can help you get working software with continuous feedback so that your lean-agile teams can deliver continuous value with Visual Studio ALM, Team Foundation Server & Scrum. We have experts on hand to help improve your process and deliver more value at higher quality.

  • Kamil Kaczmarczyk

    I’ve had the same problem and this solution didn’t work for me. After many hours of trials and errors it turned out this was because instead of multiplesitebindingsenabled the attribute needed to be named multipleSiteBindingsEnabled. Hope this saves someone’s time.

    • http://blog.hinshelwood.com/ Martin Hinshelwood

      Thanks Kamil… I had a weird tag in there and it rendered all lower-case! Fixed now…

  • Jerzy Kołosowski

    I’ve had the same problem, but this solution didn’t work for me. Error has changed to “500: Internal Server Error”.

    • http://blog.hinshelwood.com/ Martin Hinshelwood

      I would suggest that you check the casing on the rest of the XML… I had exactly the same issue and it was first a casing issue and next a syntax issue…

      • http://www.facebook.com/jaymz87 James Sperring

        It’s exactly that – after seeing that you had fixed the casing for the multipleSiteBindingsEnabled attribute in the last comment, I copied and pasted the tag in the article. The <servicehostingenvironment… you have should be <serviceHostingEnvironment…

  • http://twitter.com/wilmerbz Wilmer

    Hi. I’m having the same error, but I have only one binging on the IIS site, for the 8080.
    Can you help me please? Where can I find the exception details? Because seems to be a different one, but with the same behavior.
    Thank you!

  • Mark van den Berg

    Hi, Please correct the casing for servicehostingenvironment in serviceHostingEnvironment.

    • http://blog.hinshelwood.com/ Martin Hinshelwood

      :) You do realise the casing it but a search away?

  • http://www.facebook.com/min.choi.9404 Min Choi

    This worked great! Thanks for the tip Martin!

  • SaM

    life saver!

  • oxhanoverxo

    After navigating to that web config, we’ve discovered that Its already set to enabled = true. Casing is correct. Still getting this same issue. This happened after we changed the user that the controller runs under so that we could give our deployment scripts access to network drives.

    • http://nakedalm.com/blog Martin Hinshelwood

      The default was changed in Update 3 I think. If you are still getting the issue then I would recommend raising it in the support forums… Do you get any errors in the event logs?

      • oxhanoverxo

        We get the generic http 500 error: System.ServiceModel.ServiceActivationException

        We have plenty of free memory on the build server too. Even weirder is after we set the user back to the default, it still wont work. I’ve seen that it can be a case of not having enough resources on the server, but nothings changed there.

        Tried uninstalling build services and going through the wizard again, didn’t help. I’m really at a loss as to what it could be.