"Error HRESULT E_FAIL has been returned from a call to a COM component" using TFS201 Team Web Access

Following comes from Senior Support Engineer Nitish Nagpal.

 

Problem:
One of my customers was facing an issue with the TFS2010 Team Web Access in a collection that  was ported over from another TFS 2010 install. They were not experiencing this issue with newly created projects on their server. While trying to edit a query in Team Web Access (TWA), they got the following error message: “Error HRESULT E_FAIL has been returned from a call to a COM component.”

This issue arises when:
1. They try to create a new work item – user story, bug, task etc.
2. They try to edit an existing query.
3. They try to open a work item from a query result set.
4. They search for a work item by the WI ID.

Troubleshooting:
Customer tried clearing team system web access cache, and they also tried to re-stamp the cache by invoking the StampWorkItemCache  by using the following URL but it didn’t work <myserver>/:8080/tfs/<collection_name>/WorkItemTracking/v3.0/ClientService.asmx

 

Resolution:
Finally, we launched SQL Server Management Studio and connected to the collection database containing data for the affecting team project. In a new query window we did a exec StampDb. After we ran stamp db stored procedure, it did reset the stamp, so that next time “client” connected to the server, it re-download the metadata.

Cause:
In some cases, metadata is locked by the client thread and deleting metadata usually doesn’t work (such as the metadata locked by web access thread). Running stampdb force them to drop old metadata cache