We seem to have an issue with out Team Foundation Server 2010 installation that gives an error when certain users are queried. If we include them in the 'AssignedTo' filter the query instantly errors with:

TF237161: Server operation timed out or server not responding. Try again.

For other users this works fine, and the TFS' assigned to these problematic users are returned in the results of working queries. I've checked and it doesn't appear to be a permission problem. We had migrated from Team Foundation Server 2008 to TFS 2010 last year, but the people this is affecting think it was happening before this anyway.

Does anyone have any ideas of where to begin troubleshooting this? I have full access to the server and database, and have started trying to replicate the query in SQL to see if it's an error in the database, but haven't got very far so far.

If anyone has any suggestions they'd be greatly appreciated! Thanks

3 Answers 3


I eventually managed to find the source of the problem! It turns out theat for reasons unknown, the affected users appeared more than once in the Constants table (based on their name that is stored in the DisplayPart column) which resides in our TfsDefaultCollection TFS database. This query highlighted all the records with duplicate DisplayName's:

SELECT * FROM Tfs_DefaultCollection.dbo.Constants
WHERE DisplayPart IN
    SELECT DisplayPart FROM dbo.Constants 
    GROUP BY DisplayPart
    HAVING COUNT(ConstID) > 1
ORDER BY DisplayPart ASC

One query TFS uses when querying TFS items retrieves a users ConstID from this table, and only works when their name is unique:

declare @P3_1 int
select @P3_1 = ConstID from dbo.[Constants] where DisplayPart = @P3
if (@@rowcount > 1)
        raiserror(600174, 16, 1) with seterror, nowait
set @P3_1 = isnull(@P3_1,-2147483648);

So because they appeared more than once, the query failed with an error. Thus to resolve it, we renamed the duplicate constants with the latest ConstID to something different (we appended a ? to the end), and hey presto! It worked again.

If I ever findout why this happened, I'll post an update. In the meantime I hope this is helpful to anyone experiencing the same annoying problem


Try these instructions to get detailed tracing information about what is going on in your TFS server.

  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – slhck
    Jul 26, 2012 at 8:43

Note that you should never directly manipulate your data like this - it'll put your system in a state which is very difficult for the TFS product group to support. Duplicate display names are actually expected in certain cases - typically when two users in different domains have been synced into TFS with a shared display name (e.g. DOMAIN1\user and DOMAIN2\user both have display name 'user').

The Work Item Tracking query that you noted above is optimized for the case where there are not duplicate display names in the system. Typically what should happen is that the error which is raised by the SQL snippet you included will generate a strongly typed exception on the server. This exception is caught and then a less-optimal SQL batch is generated to handle the duplicate display name case. This is not a great pattern, clearly, and we plan to clean it up in a future release. For now, however, that is how things work here.

With all that setup, the root cause of your problem is very likely to be that your SQL instance does not have its error messages installed properly. When this is the case, the error which is raised will not be properly converted to the strongly typed exception expected by the server code, and the second less optimal SQL batch will never get generated, leading to the failure you were seeing... If you fix up your error message install on your SQL instance, the issue should be cleared up, and your queries should again return the appropriate results for users with ambiguous display names.

  • Ok thanks for the explanation! I'll look into this. So you're saying that simply installing the error messages will fix the issue? Or will it just expose the error message for the underlying cause?
    – Iain Ward
    Aug 9, 2013 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.