Can’t synchronize TFS warehouse after upgrading SQL Server to 2008

A few days ago, I upgraded the database of my TFS from SQL Server 2005 to 2008. Then the warehouse of TFS can’t be synchronized. Finally, I got time to troubleshoot this issue today.

Symptoms

I tried to invoke the web service http://TfsServer:8080/Warehouse/v1.0/warehousecontroller.asmx?op=Run to synchronize the warehouse, then an 6 error message were logged in the Windows Event Log immediately in TFS server. One of them looks like this:

Detailed Message: Cube processing runtime error: \r\nMicrosoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.
   at Microsoft.AnalysisServices.Server.Connect(String connectionString, String sessionId)
   at Microsoft.AnalysisServices.Server.Connect(String connectionString)
   at Microsoft.TeamFoundation.Warehouse.OlapCreator.GetServerEdition()
   --- End of inner exception stack trace ---
   at Microsoft.TeamFoundation.Warehouse.OlapCreator.GetServerEdition()
   at Microsoft.TeamFoundation.Warehouse.OlapCreator.CommonInit()
   at Microsoft.TeamFoundation.Warehouse.OlapCreator..ctor(String serverName, String databaseName, String relationalConnectionString)
   at Microsoft.TeamFoundation.Warehouse.AdapterScheduler.RunCubeProcess()

The other 5 error messages were similar to this one. I list their error message without call stacks here so that people can reach to this post so no matter which error message is used as the keyword to search, .

  1. Detailed Message: Failed to load adapter Microsoft.VisualStudio.TestTools.WarehouseAdapter.Adapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.
  2. Detailed Message: Failed to load adapter Microsoft.TeamFoundation.WorkItemTracking.Adapter.Adapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.
  3. Detailed Message: Failed to load adapter Microsoft.TeamFoundation.VersionControl.Adapter.VCAdapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.
  4. Detailed Message: Failed to load adapter Microsoft.TeamFoundation.Build.Adapter.TeamBuildAdapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.
  5. Detailed Message: Failed to load adapter Microsoft.TeamFoundation.Warehouse.CommonStructureAdapter. Exception Info: \n Microsoft.TeamFoundation.Server.AnalysisServiceConnectionException: Error encountered when creating connection to Analysis Services. Contact your Team Foundation Server administrator. ---> Microsoft.AnalysisServices.ConnectionException: Cannot connect to Analysis Services version '10.0.1600.22'.

Assessments

The error message indicates that TFS can’t connect to the Analysis Service after upgraded. I then lunched the SQL Server Management Studio 2008 and successfully connected to the Analysis Service. So the Analysis Service should work fine. Since the issue began occurring after upgraded SQL Server. TFS might still use OM from SQL Server 2005 to connect to SQL Server 2008.

To verify my guess, I restarted the IIS by running iisreset command and checked assembly binding information with fslogvw. In the tool, I found an item for binding assembly Microsoft.AnalysisServices for w3wp.exe, which is the IIS worker process of TFS web site. Here are the log:

LOG: Redirect found in application configuration file: 9.0.242.0 redirected to 9.0.242.0.
LOG: Post-policy reference: Microsoft.AnalysisServices, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
LOG: Found assembly by looking in the GAC.

LOG: Binding succeeds. Returns assembly from C:\Windows\assembly\GAC_MSIL\Microsoft.AnalysisServices\9.0.242.0__89845dcd8080cc91\Microsoft.AnalysisServices.dll.
LOG: Assembly is loaded in default load context.

Obviously, the OM from old SQL Server 2005 was used.

Solution

In the installation folder of TFS, I navigated to Web Services\Warehouse, There’s a web.config there. After TFS 2008 SP1 is applied, it adds an assembly binding redirection for Microsoft.AnalysisServices. At the time when I installed TFS 2008 SP1, the SQL Server was not upgraded yet. So the Microsoft.AnalysisServices was directed to the version 9.0.242.0, which is from SQL Server 2005.

On my another machine that SQL Server 2008 was already installed when applying the TFS 2008 SP1. This assembly was directed to 10.0.0.0. So the assembly redirection is supposed to be manually updated after upgrading the SQL Server.

In the web.config, I redirected this assembly to 10.0.0.0 and restarted IIS. The problem was resolved.

      <dependentAssembly>
<assemblyIdentity name="Microsoft.AnalysisServices"
publicKeyToken="89845dcd8080cc91"
culture="neutral" />
<bindingRedirect oldVersion="9.0.242.0" newVersion="10.0.0.0"/>
</dependentAssembly>


 



[EDIT] The SetupWarehouse command also utilizes the assembly Microsoft.AnalysisServices when rebuilding the TFS cube. So after upgrading to SQL Server 2008, you will also want to configure the SetupWarehouse.exe.config in the same manner.

14 comments:

guangming April 25, 2010 at 7:10 PM

Discount Handbags On Sale-Beautycasa Online : Official online destination for all things Louis Vuitton Handbags and purses including Luxury Handbags trends, designer reviews, handbag deals, and more.Hot sale Cheap cell phonesand cell phone china on our site! Fashion look and powerful functions for these mobile phones even discount cell phones! Wholesale HiPhone, 3G cell phones, PDA/Smart Phone now.China Cell PhonesDon't miss these cellphone!toy wholesale

Anonymous September 10, 2010 at 11:10 PM

The Louis Vuitton ARTSY MM with a lot of book is along with the famous figure; just we can know the charm of Louis Vuitton Damier Ebene Canvas Sac Plat. The brand always try its best to makes people life better, no matter cheap lv which role you play in the society ,the Louis Vuitton Cabas Rivington will give you the best nengha100911. dirp

antywong September 10, 2010 at 11:10 PM

The Louis Vuitton ARTSY MM with a lot of book is along with the famous figure; just we can know the charm of Louis Vuitton Damier Ebene Canvas Sac Plat. The brand always try its best to makes people life better, no matter cheap lv which role you play in the society ,the Louis Vuitton Cabas Rivington will give you the best nengha100911.

lala October 19, 2010 at 7:51 PM

Thanks for your post and welcome to check: here
.

andre12323 March 30, 2011 at 2:22 AM

christian louboutin shoeschristian louboutin shoes
christian louboutin bootschristian louboutin boots
christian louboutin sandalschristian louboutin sandals
christian louboutin slingbackchristian louboutin slingback
christian louboutin sneakerschristian louboutin sneakers
christian louboutin wedgeschristian louboutin wedges
christian louboutin weddingchristian louboutin wedding
timberland bootstimberland boots
asics shoesasics shoes
asics running shoesasics running shoes
dsquared jeans mendsquared jeans men
dsquared shoes 2011dsquared shoes 2011
karen millen dresseskaren millen dresses
marque t shirtmarque t shirt

sping.chen July 31, 2011 at 7:58 AM

Ah good exciting content! Will always come to our attention. To bring you good news-works perfect! New nike soccer shoes best shoes 2011!!

nike mercurial soccer cleats September 6, 2011 at 4:19 AM

Ah good exciting content! Will always come to our attention. To bring you good news-works perfect! So how is the Nike Football Cleats cleatschanged? the original Nike Speed boot!New products Nike Mercurial Vapor Superfly for us.the new Vapor football boots have undergone the same new paint work as the nike mercurial vapor superfly III and now feature the Nike Football Boots updated asymmetric.

Poker May 1, 2012 at 6:57 AM

This is really a fascinating website and all your articles, lots of useful stuff.
--------------------------
Our website: Texas Holdem Poker

Poker May 1, 2012 at 7:08 AM

Only an open-minded person could write this kind of content. I agree with your points and I really enjoyed this article a lot. Great article!
--------------------------
Website: Poker Sign up Bankroll

Poker May 1, 2012 at 7:09 AM

Just saying hello while I read through the posts. Hopefully this is just what im looking for, looks like i have a lot to read.
--------------------------
Website: No Deposit Poker Online

Poker May 1, 2012 at 7:12 AM

I am very much pleased today. I enjoyed every little bit part of it and I will be waiting for the new updates.
--------------------------
My web: Poker bonus senza versamento & Poker senza deposito online

China tours June 19, 2013 at 7:57 PM

That is really cool. Thanks for finding it. Some really good ideas there, this is going to be a real time sink. I am a china tour lover,You can learn more: China tour operator | China tour packages | China city travel

Learn Chinese April 27, 2015 at 7:59 PM

Hanbridge is the best place of Mandarin learning in Shenzhen. The quality of our staff, our unique teaching methodology and our custom-designed courseware make our school more effective than our competitors.



More Chinese learning tags : Chinese Online Learning | Chinese Online Courses | study mandarin online