I have migrated my TFS 2012.2 server to new hardware and upgraded to TFS 2013.
The upgrade went fine and I can access and query TFS without issues.
But as soon as I want to create a new work item or want to modify an existing work item I get: "Ajax request has been timed out."
Old server: win 2008 R2, SQL Server 2008 R2.
New server: win 2012, SQL Server 2012 SP1, CU2. New server contains reporting and sharepoint as well.
After this failure I removed all features and did a standard install on the TFS server. This went fine and in this setup I can create work items.
Removed the standard install and redid the upgrade. Again the same problem appeared.
We have 4 different project collections and this issue appears on all collections.
Eventlog shows 'A request for service host xxx has been executing for 31 seconds, exceeding the warning threshold of 30.'
Even after I increase this timeout (to 400 seconds) I keep getting this issue.
I have done an SQL trace while trying to create a new work item.
Below two pieces of SQL trace. First is the code that is executed as last to log the error. Second is the actual SQL code that fails\aborts after more than 300 seconds and 300 seconds of CPU time and more that 103.000.000 reads.
Any ideas on what to change on my as good as out of the box SQL configuration??
declare @p3 dbo.typ_ParamTable
insert into @p3 values(0,'updatePackage',0,N'System.Collections.Generic.List`1[Microsoft.TeamFoundation.Server.WebAccess.WorkItemTracking.Common.WorkItemUpdate]')
insert into @p3 values(0,'ExceptionType',-1,N'CancelledByUserException')
insert into @p3 values(0,'ExceptionMessage',-2,N'CancelledByUser')
insert into @p3 values(0,'ActivityId',-3,N'd7b9e953-345a-001b-2dea-b9d75a34cf01')
exec prc_LogActivity @partitionId=1,@commands=@p2,@params=@p3
declare @p8 dbo.typ_StringTable
insert into @p8 values(N'useraccount')
declare @p9 dbo.typ_WitFieldValueTable
insert into @p9 values(-5,N'System.Id',-5,0)
insert into @p9 values(-5,N'System.Rev',0,0)
insert into @p9 values(-5,N'System.Title',N'400',0)
insert into @p9 values(-5,N'System.State',N'New',0)
insert into @p9 values(-5,N'System.ChangedBy',N'useraccount',0)
insert into @p9 values(-5,N'System.Reason',N'New',0)
insert into @p9 values(-5,N'System.WorkItemType',N'Team',0)
insert into @p9 values(-5,N'System.CreatedDate',NULL,1)
insert into @p9 values(-5,N'System.CreatedBy',N'useraccount',0)
insert into @p9 values(-5,N'System.AreaId',28433,0)
insert into @p9 values(-5,N'System.IterationId',31690,0)
insert into @p9 values(-5,N'System.ChangedDate',NULL,1)
declare @p10 dbo.typ_WitTextInsertTable
insert into @p10 values(-20005,1,0,N'400',1)
exec sp_executesql N'set nocount on
declare @fRollback as bit; set @fRollback=0;
declare @ForceRollbackError as int; set @ForceRollbackError=0;
declare @fVerbose as bit; set @fVerbose=0;
declare @NowUtc as datetime; set @NowUtc=getutcdate()
declare @fAdmin bit; set @fAdmin = 0;
declare @status int; set @status = 0;
declare @tempIdMap typ_WitTempIdMapTable;
declare @PersonId as int
declare @rebuildOK as int
declare @PersonName as nvarchar(256)
declare @userSID as nvarchar(256)
set @userSID=@P1
exec @rebuildOK=dbo.RebuildCallersViews @partitionId,@PersonId output,@P1
if @rebuildOK<>0 return
select @PersonName = DisplayPart from dbo.Constants where SID = @P1 and PartitionId=@partitionId OPTION (OPTIMIZE FOR (@partitionId UNKNOWN))
select Dbo.GetDbStamp(@partitionId,default,6) as DbStamp OPTION (OPTIMIZE FOR (@partitionId UNKNOWN))
set xact_abort on;set implicit_transactions off;set transaction isolation level serializable;begin transaction
declare @distinctPersonCount int
declare @distinctPersonNames dbo.typ_StringTable
insert into @distinctPersonNames
select distinct * from @personNames
set @distinctPersonCount = @@rowcount
declare @personIdMap typ_WitConstIdMapTable;
if (@distinctPersonCount > 0)
begin
insert into @personIdMap select * from [dbo].[GetConstantsForWorkItems](@partitionId,@distinctPersonNames)
option (optimize for(@partitionId unknown))
if (@@rowcount < @distinctPersonCount)
begin
declare @newPersonNames dbo.typ_StringTable;
insert into @newPersonNames (Data) select Data from @distinctPersonNames where Data not in (select DisplayPart from @personIdMap);
exec @status = [dbo].[AddServerConstants] @partitionId,@newPersonNames
if @status <> 0
begin
rollback transaction
return
end
delete from @personIdMap
insert into @personIdMap select * from [dbo].[GetConstantsForWorkItems](@partitionId,@distinctPersonNames)
option (optimize for(@partitionId unknown))
end
end
insert into @tempIdMap exec dbo.[CreateWorkItemsFromValues] @partitionId,@PersonId,@NowUtc,-1,@newIssueFieldValues,@personIdMap
exec dbo.[WorkItemAddTexts] @partitionId,@newTexts, @tempIdMap, @NowUtc
if (@@trancount = 0) return
select TempId, Id from @tempIdMap
exec dbo.[WorkItemAuthorizeChanges] @partitionId,@PersonId,@NowUtc,@fVerbose,@fRollback output,@bypassRules,@isServiceAccount
if (@fRollback = 1)
begin
exec dbo.GetForceRollbackErrorCode @partitionId,@PersonId,@NowUtc,@ForceRollbackError output
end
exec dbo.ForceRollback @fRollback, @ForceRollbackError
if @@trancount=0 return
exec dbo.[WorkItemApplyChanges] @partitionId,@PersonId,@NowUtc,null;
set transaction isolation level read committed;commit transaction
exec dbo.[WorkItemGetComputedColumns] @partitionId,@NowUtc,@P8
set nocount off
',N'@partitionId int,@P1 nvarchar(4000),@isServiceAccount bit,@bypassRules bit,@isBulkUpdate bit,@personNames [typ_StringTable] READONLY,@newIssueFieldValues [typ_WitFieldValueTable] READONLY,@newTexts [typ_WitTextInsertTable] READONLY,@P8 nvarchar(max) ',
@partitionId=1,@P1=N'sid',@isServiceAccount=1,@bypassRules=0,@isBulkUpdate=0,@personNames=@p8,@newIssueFieldValues=@p9,@newTexts=@p10,@P8=N'[a long list of field names]'