DCSIMG
How to fix Tfs_Analysis when it is corrupt. - Oshry Horn

Oshry Horn

How to fix Tfs_Analysis when it is corrupt.

Problem:

I was approached by my friend Nimrod Stern to help him with a problem he had regarding TFS reports.

When trying to open a TFS report the following error was received:

image

  • An error has occurred during report processing. (rsProcessingAborted)
    • Query execution failed for dataset 'dsIteration'. (rsErrorExecutingCommand)
      • Errors in the metadata manager. An error occurred when loading the Team System cube, from the file, '\\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\Team System.25.cub.xml'. Errors in the metadata manager. An error occurred when loading the Test Suite dimension, from the file, '\\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\Test Suite.12.dim.xml'. File system error: The following file is corrupted: Physical file: \\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\Test Suite.0.dim\12.Hierarchy.Team Project.lstore. Logical file .

 

From the content of the error it seemed to me that the analysis DB was corrupt.

First thing I tried to do was to rebuild the reports databases from the TFS administration console (by going to the “Reports” tab and clicking “Start Rebuild”) and got this error:

image

“Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator.”

Later I tried rebuilding the reports databases from the web service (http://localhost:8080/tfs/TeamFoundation/Administration/v3.0/WarehouseControlService.asmx). Unfortunately also this did not solve the problem.

Finely I resorted to try and rebuilding the Tfs_Analysis DB directly from the SQL management studio as such:

image

but it also did not work and produced this error:

image

“File system error: The following file is corrupted: Physical file: \\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\Test Suite.0.dim\12.Hierarchy.Team Project.lstore. Logical file .
Errors in the metadata manager. An error occurred when loading the Test Suite dimension, from the file, '\\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\Test Suite.12.dim.xml'.
Errors in the metadata manager. An error occurred when loading the Team System cube, from the file, '\\?\C:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data\Tfs_Analysis.0.db\Team System.25.cub.xml'.
(Microsoft.AnalysisServices) “

 

(Looks familiar?? :) )

 

Solution:

Even though this problem cannot be solved with the “TFS Administration Consol” or the “SQL Management Studio” the solution is fairly simple:

1) Tern off the “SQL Server Analysis Services” windows service, either by right-clicking the analysis server in the “SQL Management Studio”:

image

or directly from Windows’ “Services” window:

image

2) Browse to this folder: “%ProgramFiles%\Microsoft SQL Server\MSAS10.MSSQLSERVER\OLAP\Data” and delete the folder Tfs_Analysis.X.db and the XML file Tfs_Analysis.XX.db.xml.

3) Restart the “SQL Server Analysis Services” windows service.

4) Open the “TFS Administration Consol” and go to the “Reports” tab, then press “Edit” and type in the correct username and password in the “Analysis” tab.

image

5) Rebuild the Report DB’s through the web service: http://localhost:8080/tfs/TeamFoundation/Administration/v3.0/WarehouseControlService.asmx, or through the “TFS Administration Consol” - go to the “Reports” tab, then press “Start Rebuild”.

 

Wait for your DB’s to finish building, and enjoy your reports!

Comments

Franco Oliveira said:

Muito bom, obrigado pelo post.

# April 6, 2011 2:59 AM

Ohms said:

Thanks for the post... worked like a charm.

# February 2, 2012 10:56 PM

Getting grips on TFS jobs | SDNET - all about .NET and computing said:

Pingback from  Getting grips on TFS jobs  | SDNET - all about .NET and computing

# May 10, 2012 4:50 PM

vletroye said:

The deleted folder was containing a key to encrypt data (?). After introducing the username/password, I get the error "Errors in the encryption library: Failed to encrypt sensitive data. Possibly the encryption key is inaccessible because of improper service account change".

I am however 100% sure of the account to be used (I did wrote a document while installing TFS to keep track of every settings used.)

# August 31, 2012 3:31 PM

vletroye said:

At step 2, I had to also delete "CryptKey.bin" otherwise it does not work (as I posted here previously...)

# September 3, 2012 12:01 PM

Damian Brady's Blog » TFS 2012 with Update 1 – Done said:

Pingback from  Damian Brady's Blog » TFS 2012 with Update 1 – Done

# November 26, 2012 8:56 PM

Damian Brady said:

Many thanks for this solution. We found it very useful when our upgrade to TFS 2012 Update 1 hit a snag!

blog.damianbrady.com.au/.../tfs-2012-with-update-1-done

# November 27, 2012 4:16 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: