[Update 3/16/11]  There is a KB article with TFS 2010 SP1 installation troubleshooting should you hit problems: http://support.microsoft.com/kb/2516423.

Problem

A customer ran into this issue, and I want to post it to help anyone else who hits it.  The symptom is that you install Service Pack 1 for Team Foundation Server 2010, and it fails.

At first, we looked at the KB log file, which is an HTML file named something like KB2182621_20110314_153652021.htm (after the KB number, it’s the date and time – one log will be generated per failed attempt).  That file doesn’t contain the error unfortunately, but towards the end you will find a reference to a file with a name like {some path}\KB2182621_20110314_153652021-Microsoft Team Foundation Server 2010 - ENU-MSP0.txt, as highlighted in the log snippet below.  In that log file you will find the real error (search for the word error until you find something that looks like the stack pasted at the end of this post).

Wait for Item (VS10-KB2182621.msp) to be available
VS10-KB2182621.msp is now available to install
Creating new Performer for Patches item

     Entering Function: BaseMspInstallerT >::PerformAction...

     Action: Performing Install on MSP: c:\7b04dc4d154aa5031a470fad\VS10-KB2182621.msp targetting Product: Microsoft Team Foundation Server 2010 - ENU...

        Successfully called MsiEnableLog with log file set to C:\Users\xxx\AppData\Local\Temp\KB2182621_20110314_153652021-Microsoft Team Foundation Server 2010 - ENU-MSP0.txt
        Log File C:\Users\xxx\AppData\Local\Temp\KB2182621_20110314_153652021-Microsoft Team Foundation Server 2010 - ENU-MSP0.txt does not yet exist but may do at Watson upload time
        about to call MsiInstallProduct with PATCH="c:\7b04dc4d154aa5031a470fad\VS10-KB2182621.msp" on product {BD8885BD-CFE2-3E43-99BC-33EC4E109EF5}(C:\WINDOWS\Installer\90c8f.msi) to install patches.
        Patch (c:\7b04dc4d154aa5031a470fad\VS10-KB2182621.msp) Install failed on product (Microsoft Team Foundation Server 2010 - ENU). Msi Log: 
        MSI returned 0x643

Entering Function: MspInstallerT >::Rollback...

exiting function/method

Here we found the following lines.  Bryan and Mahmoud found that the 0x80005000 error occurs when trying to access IIS through ADSI and IIS6 compat mode is not installed.  This was indeed the problem!

CAQuietExec: Exception Message: Unknown error (0x80005000) (type COMException)

CAQuietExec: Exception Stack Trace: at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)

Solution

Make sure IIS 6 Management Compatibility is turned on (Start –> Control Panel –> Programs –> Turn Windows Features On or Off)

image

Make sure the IIS Admin Service is running (Start –> Run… services.msc)

image

 

Here is the full error from the log to help anyone search for parts of it through a search engine.

CAQuietExec:   Invoking operation Stop on application pool: Microsoft Team Foundation Server Application Pool
CAQuietExec:   Exception while invoking operation Stop on application pool Microsoft Team Foundation Server Application Pool
CAQuietExec:  
CAQuietExec:  Exception Message: Unknown error (0x80005000) (type COMException)
CAQuietExec: 
CAQuietExec:  Exception Stack Trace:    at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Bind()
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.get_NativeObject()
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object args)
CAQuietExec:     at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.InvokeOperationOnApplicationPool(String appPoolName, String operation)
CAQuietExec: 
CAQuietExec:  Failed executing the command quiesce: Microsoft.TeamFoundation.Admin.ConfigurationException: An error occurred while invoking operation Stop on application pool Microsoft Team Foundation Server Application Pool. Please see the log file for additional details. ---> System.Runtime.InteropServices.COMException: Unknown error (0x80005000)
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Bind()
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.get_NativeObject()
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object args)
CAQuietExec:     at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.InvokeOperationOnApplicationPool(String appPoolName, String operation)
CAQuietExec:     --- End of inner exception stack trace ---
CAQuietExec:     at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.InvokeOperationOnApplicationPool(String appPoolName, String operation)
CAQuietExec:     at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.StopApplicationPool(ApplicationPoolType type, Boolean waitForWorkerProcessTermination)
CAQuietExec:     at Microsoft.TeamFoundation.ServiceControl.TfsServiceControl.QuiesceApplicationTier()
CAQuietExec:     at Microsoft.TeamFoundation.ServiceControl.TfsServiceControl.Quiesce(IEnumerable`1 featureList)
CAQuietExec:     at Microsoft.TeamFoundation.ServiceControl.TfsServiceControl.Main(String args)
CAQuietExec:  > Inner Exception:
CAQuietExec:  System.Runtime.InteropServices.COMException (0x80005000): Unknown error (0x80005000)
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Bind()
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.get_NativeObject()
CAQuietExec:     at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object args)
CAQuietExec:     at Microsoft.TeamFoundation.Admin.ApplicationPoolHelper.InvokeOperationOnApplicationPool(String appPoolName, String operation)