How to query build controller and agent details in a collection database

by Xavier Dilip Kumar 2. January 2014 08:51

Solution:

SELECT a.ControllerId "Controller ID", a.DisplayName "Controller Name" , a.Status "Controller Status(1 - Active)",

b.AgentId "Agent ID", b.DisplayName "Agent Name", b.Status  "Agent Status(1 - Active)" FROM tbl_BuildController a , tbl_BuildAgent b where a.ControllerId = b.ControllerId

Tags:

TFS | TFS 2010 | TFS 2012 | TFS 2013

w3wp.exe process is missing after TFS app tier reboot

by Xavier Dilip Kumar 23. December 2013 11:12

Explanation:

w3wp.exe an Internet Information Services (IIS) worker process is a windows process which runs Web applications, and is responsible for handling requests sent to a Web Server for a specific application pool. W3wp.exe process will not be started automatically after App tier reboot or IIS restart or application pool restart. w3wp.exe will be launched once the first request is made to the TFS Application.

Solution:

1. Try accessing TFS application once http://tfs:8080/tfs. See whether the w3wp.exe is available in "Windows Task Manager" --> "Processes Tab"

2. You can configure Worker process started automatically by adding startMode attribute to TFS application pool to AlwaysRunning in your applicationHost.config

<applicationPools>

   <add name="Default App Pool" startMode="AlwaysRunning" />

</applicationPools>

Solution 2 will work for IIS 7.5 or newer

Tags:

TFS | TFS 2010 | TFS 2012 | TFS 2013

How to switch a workspace from source to target workspace mappings without affecting the folders and files in the target workspace.

by Xavier Dilip Kumar 19. December 2013 08:02

Explanation:

A regular get operation will deleted each item in the target workspace folder and re-downloaded the folders and files from the server to target workspace folder.

Solution:

Use remap switch with tf get command

"tf get /remap"

Note: /remap switch does increase the load on server to process your request

Tags:

TFS 2010 | Visual Studio 2010 | Visual Studio 2012 | Visual Studio 2013

Cannot add new build templates or create team projects on TFS because of error ‘The File Exists’

by Xavier Dilip Kumar 16. December 2013 08:14

Exception:

Explanation:

The error may occur when the following cache folder size increases.

C:\Users\<tfsservice account / Build account>\AppData\Local\Temp

Solution:

Clearing the content of the following cache folder location resolved issue with build and team project creation. 

C:\Users\<tfsservice account / Build account>\AppData\Local\Temp

Tags:

TFS | TFS 2010 | TFS 2012 | TFS 2013

TFS Versions

by Xavier Dilip Kumar 16. December 2013 07:51
TFS Versions    
2005 RTM 8.0.50727.147
  SP1 8.0.50727.762
     
2008 RTM 9.0.21022.8
  SP1 9.0.30729.1
     
2010 RTM 10.0.30319.1
  SP1 10.0.40219.1
  CU2 10.0.40219.371
     
2012 RTM 11.0.50727.1
  Update 1 11.0.51106.1
  Update 2 11.0.60315.1
  Update 3 11.0.60610.1
  Update 4  
     
2013 RTM 12.0.21005.1

Tags:

TFS | TFS 2010 | TFS 2012 | TFS 2013

Exception Message: Could not load file or assembly 'System.Management.Automation, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (type FileNotFoundException)

by Xavier Dilip Kumar 10. December 2013 09:12

Explanation:

Build fails with missing file: System.Management.Automation.dll, The InvokePowerShellCommand activity in Community TFS Build Extensions has a dependency on System.Management.Automation.DLL

Solution:

Install Windows Management Framework 3.0 on the build server.

Tags:

TFS 2010 | TFS 2012 | TFS 2013

How to queue the original failed job using its job ID instead of going to TFS admin console

by Xavier Dilip Kumar 5. December 2013 09:37

Solution:

Powershell script to invoke failed Jobs

[Reflection.Assembly]::Load("Microsoft.TeamFoundation.Client, Version=10.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") $configServer = new-object Microsoft.TeamFoundation.Client.TfsConfigurationServer
(new-object System.Uri("http://<Server>:8080/tfs")) $tfsJobService = $configServer.GetService([Microsoft.TeamFoundation.Framework.Client.
ITeamFoundationJobService]) $jobs= $tfsJobService.QueryJobs() $jobID = new-object System.Guid("the job ID from deletion of project that failed") foreach ($job in $jobs) { if (($job.JobId -eq $jobID)) { $FailedJob = $job $tfsJobService.QueueJobNow($FailedJob,$true) } }

Failed Job Ids can be identified using the below query
use [Tfs_Configuration]  --check this is the name of the configuration database
Select *  FROM [tbl_JobDefinition] where Data like '%failed%' 
--Grab the JobId from above and use in JobHistory
select * from [tbl_JobHistory] where JobId='XXX from above query result”
--check the Result and ResultMessage columns
 

Tags:

TFS 2010 | TFS 2012

Restore TFS SQL Server Enterprise edition databases to SQL Server standard edition.

by Xavier Dilip Kumar 4. December 2013 12:07

Exception:

Database 'Tfs_DefaultCollection' cannot be started because some of the database functionality is not available in the current edition of SQL Server.

 

TFS Collection Databases :-

 

Database 'Tfs_DefaultCollection' cannot be started in this edition of SQL Server because part or all of object <tables> is enabled with data compression or vardecimal storage format. Data compression and vardecimal storage format are only supported on SQL Server Enterprise Edition.

 

Explanation:

 

TFS will enable and use the following Enterprise Edition features.

 

Online index operations

Page compression

Table and index partitioning

Larger read - ahead buffering & Cube perspectives 

 

Data compression and vardecimal storage format will cause problems when moving to different versions of SQL editions. Data compression and vardecimal storage format are enabled on the Tfs_Configuration and Tfs_<Collection> databases by default. Data compression and vardecimal storage format are only supported on SQL Server Enterprise Edition. Hence the databases backed up from Enterprise Editions cannot be restored on other Editions.

 

Solution 1: 

The solution is to remove the objects which have compression on the TFS databases.

 

  • Detach the Collection from TFS through TFS Administration console.
  • Executed the following query on Tfs_<Collection> databases deployed on Enterprise Edition to identify the tables with Data compression and vardecimal storage format enabled.

 

SELECT SCHEMA_NAME(sys.objects.schema_id) AS [SchemaName] ,OBJECT_NAME(sys.objects.object_id) AS [ObjectName] ,[rows] ,[data_compression_desc] ,[index_id] as [IndexID_on_Table] 

FROM sys.partitions INNER JOIN sys.objects ON sys.partitions.object_id = sys.objects.object_id WHERE data_compression > 0 

AND SCHEMA_NAME(sys.objects.schema_id) <> 'SYS' ORDER BY SchemaName, ObjectName;

 

SELECT OBJECTPROPERTY(OBJECT_ID('<table name(s) from above command output>'),'TableHasVarDecimalStorageFormat'

 

Following are the Tfs_<Collection> database tables enabled with Data compression and vardecimal storage format.

 

CodeSense.tbl_AggregateMap

CodeSense.tbl_AggregatorInputQueue

dbo.LinkTreesLatest

dbo.tbl_AuthorizationObject

dbo.tbl_Branch

dbo.tbl_BranchMapping

dbo.tbl_LocalVersion

dbo.tbl_nodes

dbo.tbl_PendingChange

dbo.tbl_PendingChangeRecursive

dbo.tbl_PendingMerge

dbo.tbl_PendingRollback

dbo.tbl_PropertyValue

dbo.tbl_RegistryItems

dbo.tbl_SecurityAccessControlEntry

dbo.tbl_Version

dbo.tbl_WorkingFolder

dbo.tbl_WorkingFolderHistory

dbo.tbl_WorkspaceMapping

 

 

  • Execute the following SQL command to disable the compression on the Tfs_<Collection> database table listed above one by one

 

ALTER INDEX ALL ON '<table name(s) from above command output>' REBUILD WITH (DATA_COMPRESSION = None);

 

ALTER INDEX ALL ON CodeSense.tbl_AggregateMap REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON CodeSense.tbl_AggregatorInputQueue REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.LinkTreesLatest REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_AuthorizationObject REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_Branch REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_BranchMapping REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_LocalVersion REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_nodes REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingChange REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingChangeRecursive REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingMerge REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PendingRollback REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_PropertyValue REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_RegistryItems REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_SecurityAccessControlEntry REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_Version REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_WorkingFolder REBUILD WITH (DATA_COMPRESSION = None);

ALTER INDEX ALL ON dbo.tbl_WorkingFolderHistory REBUILD WITH (DATA_COMPRESSION = None);

 

ALTER INDEX ALL ON dbo.tbl_WorkspaceMapping REBUILD WITH (DATA_COMPRESSION = None);

 

  • Backup the Tfs_<Collection> database on SQL Server Enterprise Edition and restored it to SQL Server other Editions (both Express and Standard Editions)
  • Attach the Tfs_<Collection> to the TFS instance deployed on SQL Server other Editions (Express and Standard Editions)

Solution 2:

  • Detach the Collection from TFS through TFS Administration console.
  • Executed the following stored procedure on Tfs_<Collection> databases deployed on Enterprise Edition to disable the compression on the relevant tables.

EXEC [dbo].[prc_EnablePrefixCompression] @online = 1, @disable = 1

  • Backup the Tfs_<Collection> database on SQL Server Enterprise Edition and restored it to SQL Server other Editions (both Express and Standard Editions)
  • Attach the Tfs_<Collection> to the TFS instance deployed on SQL Server other Editions (Express and Standard Editions)

Tags: ,

SQL Server | TFS 2010 | TFS 2012

"The required anti-forgery form field "__RequestVerificationToken" is not present. Ensure that cookies are enabled in your browser."

by Xavier Dilip Kumar 4. December 2013 06:43

Exception:

"The required anti-forgery form field "__RequestVerificationToken" is not present. Ensure that cookies are enabled in your browser."

Explanation:

I got the error all of a sudden while adding users to TFS team projects. I did make sure that cookies are enabled on my IE (Ver. 10) but no luck. Finally I found the Download Accelerator Plus (DAP) install caused the issue. Issue could be because of IE 10 and Download Accelerator Plus (DAP) compatibility issues.

Workaround:

1. Uninstall Download Accelerator Plus (DAP).

2. Use alternate browsers like Chrome or Firefox.

Tags:

TFS 2010 | TFS 2012

Missing suite folder in MTM

by Xavier Dilip Kumar 3. December 2013 07:12

Explanation:

One of the QA Lead reported me that the test suite was lost after the migration from TFS 2010 to TFS 2012. Actually the test suite folder was renamed by the QA Lead and reported as deleted :(

How did I resolved it?

  • Queried the TFS 2012 collection database to get the deleted suite id, But I was not able to identify any test suite delete for the reported project in the collection.

           Select * from tbl_auditlog where ObjectType = 11

  • To get the basic information of test suite like ProjectName, TestPlanId, ParentSuiteId, Title, SuiteType, Query, RequirementId, I queried the TFS 2012 collection database as below

           Select p.ProjectName, s.* from tbl_suite s join  tbl_Project p on s.ProjectId = p.ProjectId

  • I was able to identify the suite information which was reported as deleted. With the suite id, I was able to identify who renamed the test suite and when

           Select LastUpdated,LastUpdatedBy FROM tbl_Suite where [SuiteId] = 'XXXX' 

           Select * from tbl_Identity where Id = ' LastUpdatedBy ' 

Tags:

MTM | TFS 2010 | TFS 2012

About the author

My name is Xavier Dilip Kumar Jayaraj and I am a Software Configuration Management Engineer with a background in application development, Build & packaging using Install Shield.

Profile in LinkedIn

  

Quotes I Like

"Failure will never overtake me if my determination to succeed is strong enough."  - Dr. APJ. Abdul Kalam

"Always be yourself, express yourself, have faith in yourself, do not go out and look for a successful personality and duplicate it." - Bruce Lee

"Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important." - Bill Gates

"Innovation distinguishes between a leader and a follower." - Steve Jobs

Disclaimer

The information provided here is based on my expreriences, troubleshooting and online/offline findings. It can be used as is on your own risk without any warranties and I impose no rights.

Month List