Can't Query Qork Items. Error TF26000

I'm in Visual Studio and either trying to do a checkin or just trying to run queries against work items I get the error

TF26000: Could not connect to the Team Foundation Server. Check that you have a network connection and that your Team Foundation server is available.

The server is available and I can connect, other things that require the server are working (for example I can check code in). Any help would be gratefully received!



Answer this question

Can't Query Qork Items. Error TF26000

  • Michael Barton

    Nope, none of that seems to help. I had already checked the SQL, Sharepoint and TFS permissions several times, but I've re-checked tham and rebooted the server. I deleted the cache directory after rebooting, restarted VS2005 and I get the same problem,


  • mikheil

    As far as I can see nothing gets posted to the event log when I run the query. I'm looking in the application log, I assume that's the place, there's nothing in the other logs either. There are errors and warnings in the App log from both Tfs and Tfs Warehouse, but I don't know which of these, in any, would be useful to you, and they don't appear when I run the query on the client. (In this case I'm running the 'All work items' query)

    Re-running the SQL (from SQL trace) for the query that succeeds and the query that fails I get this error

    "Invalid object name 'dbo.xxRLQ_WorkItem_kevinj'"

    where kevinj is the user name.

    For the successful query (for TFSSetup) the SQL looks like this

    exec sp_executesql N'set nocount on
    declare @PersonName as nvarchar(255)
    declare @rebuildOK as int
    exec @rebuildOK=dbo.RebuildCallersViews @P1,null,@PersonName output,@P2,1,0,0
    if @rebuildOK<>0 return
    declare @bulkUpdateIdList as nvarchar(4000); set @bulkUpdateIdList='''';declare @missingOrUpdatedIdList as
    nvarchar(4000);set @missingOrUpdatedIdList='''';
    select [System.Id] from dbo.[xxRLQ_WorkItem_TFSSetup] () I where ((((I.[System.AreaId] in (select * from
    dbo.SubTreeFromID(73)))) and ((I.[System.State]<>@P3 or I.[System.State] is NULL )))) order by
    [Microsoft.VSTS.Common.Rank],[System.WorkItemType],[System.Id]
    declare @NowUtc as datetime; set @NowUtc=getutcdate()
    select @NowUtc
    select DbStamp from Dbo.GetDbStamp
    declare @RowVer0 as binary(8) set @RowVer0=@P4
    declare @RowVer1 as binary(8) set @RowVer1=@P5
    declare @RowVer2 as binary(8) set @RowVer2=@P6
    declare @RowVer3 as binary(8) set @RowVer3=@P7
    declare @RowVer4 as binary(8) set @RowVer4=@P8
    declare @RowVer5 as binary(8) set @RowVer5=@P9
    declare @RowVer6 as binary(8) set @RowVer6=@P10
    declare @RowVer7 as binary(8) set @RowVer7=@P11
    declare @RowVer8 as binary(8) set @RowVer8=@P12
    declare @RowVer9 as binary(8) set @RowVer9=@P13
    exec dbo.GetAdminData
    0,@RowVer0,@RowVer1,@RowVer2,@RowVer3,@RowVer4,@RowVer5,@RowVer6,@RowVer7,@RowVer8,@RowVer9
    set nocount off',N'@P1 nvarchar(13),@P2 nvarchar(8),@P3 nvarchar(6),@P4 binary(8),@P5 binary(8),@P6
    binary(8),@P7 binary(8),@P8 binary(8),@P9 binary(8),@P10 binary(8),@P11 binary(8),@P12 binary(8),@P13
    binary(8)',@P1=N'VSTS\TFSSetup',@P2=N'WorkItem',@P3=N'Closed',@P4=0x0000000000009D6E,@P5=0x0000000000001C54,@P6=0x000000000000A3CC,@P7=0x000000000000A3C9,@P8=0x000000000000A4D5,@P9=0x000000000000A4FD,@P10=0x0000000000009C55,@P11=0x000000000000A3CE,@P12=0x000000000000A41E,@P13=0x0000000000009FC1

    The unsuccessful query is the same (I believe) but with 'kevinj' used in the query instead of 'TFSSetup'

    Hope this helps,

    Kevin


  • JohnFx

    I am not sure - actually, without proper permissions you shouldn't have been able to connect to the project.

    Could you please close VS, remove the Documents and Settings\<user>\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache directory and try it again The directory contains cached metadata, and I suspect it might be wrong.

    One more thing: please verify that you're a member of project's readers or contributors group or have admin permissions to that project.


  • lfranklin

    This happens when connection to the work item tracking database fails. Can you expand your project's "Work items" node in the team explorer


  • Luis Coimbra

    We also fixed this error by removing the user and then adding them again to the Team Project. It's almost like their user id in TFS was corrupt.

  • kezhu

    Should of course be 'Can't Query Work Items...'


  • AJSA

    By looking at the trace, I am guessing that there is a problem syncing user 'kevinj'  to Work Item Tracking database and hence views are not created for the user resulting in the problem.

    I am not sure how to force the sync but you could try removing the user from the Project/Server group and readding it to a different project/server group.

    You may also try to add a different user to the project/server group and using that user account run some query or create work item to see if this problem is reproduced.

    Thanks,
    Mohammad

  • Shambhu

    Yep, I can expand the node and see the work item queries, but if I try and run any of them I get the same error.

    Could it be an authentication problem If I log onto the same machine with a the TFSSetup account then Work Items work fine,


  • Yazeedhs

    I am looking at the code right now, and it seems like this error occurs only when the database has some problems. Could you check the event log on the AT machine It might contain useful information.

    Thanks,
    Alex


  • Bigmo

    Great - this is what I've been looking for! I'll forward this thread to a database developer to comment on that; please stand by.

    Thanks,
    Alex

  • Can't Query Qork Items. Error TF26000