TFS Config import command fails to upgrade TFS 2008 databases:
Recently, I have worked on a case in which the TFS Config import command fails with below error:
Error description
-------------------
[Error @15:50:30.677] [2012-03-12 21:13:13Z][Error] The event subscriber with SID 'domain\tfsservice' is not in Team Foundation. Either add this identity, or delete its subscriptions, then re-run upgrade.
[Error @15:50:30.677] [2012-03-12 21:13:13Z][Error] Object reference not set to an instance of an object.
The account ‘domain\tfsservice’ is the service account for TFS in both TFS 2008 and TFS 2010. During troubleshooting we deleted the default subscriptions from tbl_subscription table in TfsIntegration database and recreated again. Below are the steps to delete & recreate the subscriptions :
To do this schedule a down time as it requires IIS reset.
1. Log into the console of the TFS application tier machine as the current TFS service account and then open a Command Prompt. NOTE: If TFS is configured to use NETWORK SERVICE as the service account, log in as the account used to install TFS (the "setup" account) to do this.
2. Change to the \Program Files\Microsoft Visual Studio 2008 Team Foundation Server\TF Setup directory.
3. Remove the subscription for the four default TFS events by typing and executing the following commands. Before doing so you should verify the IDs of the subscriptions you want to remove. Use SQL Server Management Studio to browse the tbl_subscription table in the TfsIntegration database and verify the numbers in the ID column for the default subscriptions (as outlined in the "Cause" section above).
bissubscribe /unsubscribe /id 1 /server <TFS_AT>
bissubscribe /unsubscribe /id 2 /server <TFS_AT>
bissubscribe /unsubscribe /id 3 /server <TFS_AT>
bissubscribe /unsubscribe /id 4 /server <TFS_AT>
4. Re-subscribe the default TFS subscription by running the commands below:
bissubscribe /eventType "BuildCompletionEvent" /address "https://<TFS_AT>:8080/WorkItemTracking/v1.0/Integration.asmx" /server <TFS_AT>
bissubscribe /eventType "DataChangedEvent" /address "https://<TFS_AT>:8080/WorkItemTracking/V1.0/SyncEventsListener.asmx" /server <TFS_AT>
bissubscribe /eventType "ProjectCreatedEvent" /address "https://<TFS_AT>:8080/Warehouse/v1.0/warehousecontroller.asmx" /server <TFS_AT>
bissubscribe /eventType "DataChangedEvent" /address "https://<TFS_AT>:8080/VersionControl/V1.0/Integration.asmx" /server <TFS_AT>
5. Recycle IIS by executing the following in the Command Prompt:
net stop iisadmin /y
net start "World Wide Web Publishing Service"
net start "HTTP SSL" (Optional)
Once after doing the above steps, restored backups and reran the TFSConfig /import command. This fixed the issue.
Content developed by: Chandra Sekhar Viswanadha
Content reviewed by: Lakhminder Singh