Today Team Foundation Server was offline in a mysterious way. The fix was pretty non-intuitive, so I’m writing it up.

First, we had done an upgrade of SQL Server over the weekend, and things (eventually) worked. Some users reported problems with some TFS queries, though, so we applied some updates that were supposed to fix it. Unfortunately, bigger problems ensued.

The errors generated when someone tried to access source control were

TF53002: Unable to obtain registration data for application VersionControl.
TF53002: Unable to obtain registration data for application VersionControl.
TF30040: The database is not correctly configured.

and then a warning and two info messages

TF53005: Unable to retrieve the Team Foundation Server installed UI culture.
TF10181: The Team Foundation source control server started at ...
TF10182: The Team Foundation source control server stopped at ...

… all right at once. This happened right after some updates had been installed.

I scrolled down in the error messages and noticed that the first three all had the message “TF30063: You are not authorized to access http://TFS:8080” so I assumed there was some basic auth[nz] thing that wasn’t working.

Google to the rescue! I looked for pairs of the error codes, and came across a post on MSDN’s forums about TFS being unusable after installing Windows 2003 SP1. Following the chain of “This other post solved my problem” links, I found KB 926642. It didn’t look related at all. Problems accessing windows shares via cnames?

Thinking about it a little more, it started to sound plausible. Our TFS server name is not the same as the machine name, we use a CNAME. The KB article had some other symptoms: “Event ID 537 is logged in the Security event log” – check; “you experience authentication issues when you try to access a server locally by using … its CNAME alias” – check (tried going to \\realmachine\c$ – works, \\tfs\c$ – tells me I’m not authorized).

I set the DisableLoopbackCheck flag (didn’t need DisableStrictNameCheckin) and restarted IIS (didn’t need to restart the entire machine), and things appear to work.