Part – 1 : SQL Server 2005 Patch Fails to install with an error "Unable to install Windows Installer MSP file"

We have seen several issues where installation of Service Pack/Hotfix/GDR/CU fails to install on one or more components of SQL Server 2005. In this blog , I have tried to include few troubleshooting tips and tricks for these kinds of installation failures.

Whenever a hotfix installation fails, we start troubleshooting with the log file usually located at %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\Summary.txt

I am demonstrating an example to troubleshoot an issue where KB954606 (Security Update MS08-052) failed to install .

First , go to %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\ and see Summary.txt :

----------------------------------------------------------------------------------

Product Installation Status

Product : SQL Server Database Services 2005 (MSSQLSERVER)

Product Version (Previous): 3073

Product Version (Final) :

Status : Failure

Log File : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KB954606_sqlrun_sql.msp.log

Error Number : 1635

Error Description : Unable to install Windows Installer MSP file

----------------------------------------------------------------------------------

Above error is for SQL Server Database Services 2005 , so in this example I will display troubleshooting steps for Database Engine only.

To troubleshoot this issue, I like to analyze verbose log which is usually located at %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KBnnnnnn_sqlrun_sql.msp.log .

[Where KBnnnnnn is a placeholder for the hotfix number which is failing to install. In our example, it is SQL9_Hotfix_KB954606_sqlrun_sql.msp.log .]

Partial Contents of SQL9_Hotfix_KB954606_sqlrun_sql.msp.log :

=== Verbose logging started: 1/18/2009 05:21:19 Build type: SHIP UNICODE 3.01.4000.4042 Calling process: c:\cf7b299b237d95aef330b0000d8d947f\hotfix.exe ===

MSI (c) (AC:D0) [17:45:28:483]: Resetting cached policy values

MSI (c) (AC:D0) [17:45:28:483]: Machine policy value 'Debug' is 0

MSI (c) (AC:D0) [17:45:28:483]: ******* RunEngine:

           ******* Product: {2373A92B-1C1C-4E71-B494-5CA97F96AA19}

           ******* Action:

           ******* CommandLine: **********

MSI (c) (AC:D0) [17:45:28:483]: Client-side and UI is none or basic: Running entire install on the server.

MSI (c) (AC:D0) [17:45:28:483]: Grabbed execution mutex.

MSI (c) (AC:D0) [17:45:28:515]: Cloaking enabled.

MSI (c) (AC:D0) [17:45:28:515]: Attempting to enable all disabled priveleges before calling Install on Server

MSI (c) (AC:D0) [17:45:28:530]: Incrementing counter to disable shutdown. Counter after increment: 0

MSI (s) (D0:F8) [17:45:28:546]: Grabbed execution mutex.

MSI (s) (D0:F4) [17:45:28:546]: Resetting cached policy values

MSI (s) (D0:F4) [17:45:28:546]: Machine policy value 'Debug' is 0

MSI (s) (D0:F4) [17:45:28:546]: ******* RunEngine:

           ******* Product: {2373A92B-1C1C-4E71-B494-5CA97F96AA19}

           ******* Action:

           ******* CommandLine: **********

MSI (s) (D0:F4) [17:45:28:546]: Machine policy value 'DisableUserInstalls' is 0

MSI (s) (D0:F4) [17:45:28:546]: Adding MSIINSTANCEGUID to command line.

MSI (s) (D0:F4) [17:45:28:546]: Warning: Local cached package 'C:\WINDOWS\Installer\638de4.msi' is missing.

MSI (s) (D0:F4) [17:45:28:546]: User policy value 'SearchOrder' is 'nmu'

MSI (s) (D0:F4) [17:45:28:546]: User policy value 'DisableMedia' is 0

MSI (s) (D0:F4) [17:45:28:546]: Machine policy value 'AllowLockdownMedia' is 0

MSI (s) (D0:F4) [17:45:28:546]: SOURCEMGMT: Media enabled only if package is safe.

MSI (s) (D0:F4) [17:45:28:546]: SOURCEMGMT: Looking for sourcelist for product {2373A92B-1C1C-4E71-B494-5CA97F96AA19}

:

:

:

:

:

MSI (s) (D0:F4) [17:45:47:452]: Opening existing patch 'C:\WINDOWS\Installer\9be677.msp'.

MSI (s) (D0:F4) [17:45:47:452]: Note: 1: 2203 2: C:\WINDOWS\Installer\9be677.msp 3: -2147287038

MSI (s) (D0:F4) [17:45:47:452]: Couldn't find local patch 'C:\WINDOWS\Installer\9be677.msp'. Looking for it at its source.

MSI (s) (D0:F4) [17:45:47:452]: Resolving Patch source.

MSI (s) (D0:F4) [17:45:47:452]: User policy value 'SearchOrder' is 'nmu'

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Media enabled only if package is safe.

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Looking for sourcelist for product {4A35EF4A-D868-4B15-A84D-3E8925AA9558}

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Adding {4A35EF4A-D868-4B15-A84D-3E8925AA9558}; to potential sourcelist list (pcode;disk;relpath).

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Now checking product {4A35EF4A-D868-4B15-A84D-3E8925AA9558}

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Media is enabled for product.

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Attempting to use LastUsedSource from source list.

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Trying source d:\05ba72b40ba6b4d61d14cd3c3283\HotFixSQL\Files\.

MSI (s) (D0:F4) [17:45:47:452]: Note: 1: 2203 2: d:\05ba72b40ba6b4d61d14cd3c3283\HotFixSQL\Files\sqlrun_sql.msp 3: -2147287037

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.

MSI (s) (D0:F4) [17:45:47:452]: Note: 1: 1706 2: -2147483647 3: sqlrun_sql.msp

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Processing net source list.

MSI (s) (D0:F4) [17:45:47:452]: Note: 1: 1706 2: -2147483647 3: sqlrun_sql.msp

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Processing media source list.

MSI (s) (D0:F4) [17:45:47:452]: Note: 1: 2303 2: 87 3: E:\

MSI (s) (D0:F4) [17:45:47:452]: Note: 1: 2303 2: 87 3: E:\

MSI (s) (D0:F4) [17:45:47:452]: SOURCEMGMT: Resolved source to: 'sqlrun_sql.msp'

MSI (s) (D0:F4) [17:46:19:702]: Note: 1: 1314 2: sqlrun_sql.msp

MSI (s) (D0:F4) [17:46:19:702]: Unable to create a temp copy of patch 'sqlrun_sql.msp'.

MSI (s) (D0:F4) [17:46:19:702]: Note: 1: 1708

MSI (s) (D0:F4) [17:46:19:702]: Note: 1: 2729

MSI (s) (D0:F4) [17:46:19:702]: Note: 1: 2729

MSI (s) (D0:F4) [17:46:19:702]: Product: Microsoft SQL Server 2005 -- Installation failed.

MSI (s) (D0:F4) [17:46:19:718]: MainEngineThread is returning 1635

This patch package could not be opened. Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package.

C:\SQLSETUP\Servers\Setup\SqlRun_SQL.msi

MSI (c) (AC:D0) [17:46:19:827]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1

MSI (c) (AC:D0) [17:46:19:827]: MainEngineThread is returning 1635

=== Verbose logging stopped: 1/20/2009 17:46:19 ===

1.       The very first error I see in the above log is Local cached package 'C:\WINDOWS\Installer\638de4.msi' is missing. This file 638de4.msi is the cached msi file for sqlrun_sql.msi i.e. the main installation (RTM) of an instance of SQL Server Database Engine. During installation of RTM product, ..\Servers\Setup\SqlRun_SQL.msi is cached to %windir%\Installer folder for future use such as un-installation etc. Cached file has a different name which is a randomized alphanumeric name generated by the installer , this is because if you have multiple instances then multiple ‘Sqlrun_sql.msi’ has to be cached and hence a name conflict may occur. Anyways, if you know the GUID (ProductCode) of the instance , you can find the name of this cached file , go to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\<GUID>\InstallProperties

In the right pane , look for the value of “LocalPackage” .

2.       Now that we knew 'C:\WINDOWS\Installer\638de4.msi' is missing , we need to put it back to C:\Windows\Installer. To do so , locate your main installation setup of SQL Server (viz. CD media or setup folder copied on local disk) , copy Servers\Setup\SqlRun_SQL.msi and paste it into C:\Windows\Installer , rename it to the cached filename , in our case we have to rename it to 638de4.msi. Double check that C:\WINDOWS\Installer\638de4.msi is available now.

3.       Let’s look for the next error in the log file and that is Couldn't find local patch 'C:\WINDOWS\Installer\9be677.msp'. Looking for it at its source .The filename 9be677.msp employs it is a MSP file means a patch , not a main product. I want to make it clear here that If we apply any patch , installer looks for the cached files of previously applied patche(s) as well as the cached msi file. So this cached msp file is also missing and we need to put it back. But the challenge is how to find which patch is this ? It is explained in following steps.

4.       In the following lines in log file, we see : Looking for sourcelist for product {4A35EF4A-D868-4B15-A84D-3E8925AA9558} means the PatchCode for missing msp file 9be677.msp is {4A35EF4A-D868-4B15-A84D-3E8925AA9558}. Also, from ******* Product: {2373A92B-1C1C-4E71-B494-5CA97F96AA19} , we know the ProductCode i.e. GUID is {2373A92B-1C1C-4E71-B494-5CA97F96AA19} .

So we have below info till this point :

GUID = {2373A92B-1C1C-4E71-B494-5CA97F96AA19}

PatchCode = {4A35EF4A-D868-4B15-A84D-3E8925AA9558}

The GUID and PatchCode are stored in registry in encrypted format. Search* (See Search Hints below) them ,open regedit , go to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\<GUID>\Patches\<PatchCode>

In the right pane , see the value of “DisplayName” . In our case , it was like below :

DisplayName = Service Pack 2 for SQL Server Database Services 2005 ENU (KB921896)

So DisplayName explains that {4A35EF4A-D868-4B15-A84D-3E8925AA9558} is Patch Code for KB921896 i.e. SP2 .

5.       Recall Step 3 , we found the missing msp file i.e. 9be677.msp is for KB921896 . In order to put his cached msp file back , download KB921896 , extract it at a command prompt using switch /extract , go to extracted directory of KB921896 and copy ..\ hotfixsql\files\sqlrun_sql.msp , paste it in C:\Windows\Installer and rename it to 9be677.msp . Double check that 'C:\WINDOWS\Installer\9be677.msp' exists now.

6.       Now that we have made available both the missing files (msi and msp) , apply the patch (in our case KB954606) again which failed to install .It should succeed now. However , in case if it fails again, that may be due to the fact that it might be looking for some other patch which might have been applied previously and is missing now. If so, failure installation will again generate verbose log , open the verbose log (like SQL9_Hotfix_KB954606_sqlrun_sql.msp.log) , look at 15-20 lines above the bottom of the log file , you may find Couldn't find local patch , put the appropriate cached msp file back to C:\Windpws\Installer , rename it appropriately and re-try the setup.

[It’s expected that log file after performing above steps won’t complain for ‘*.msi file is missing’ anymore .]

7. For other failing components like AS, RS, NS, Tools, IS etc please follow the troubleshooting method as explained in step1 to step6 looking at the appropriate verbose log file. Please note that GUID, msp filename and msp file path in the extracted folder would be different for different components. Choose carefully.

 

Hope this helps !

                                                                                                                                               

*Search Hints :

1. As ‘Note’ of KB article 938321 explains , to locate the specific Product Code registry subkey, search for the ProductName registry entry that has the value of "Microsoft SQL Server 2005 (InstanceName)"

under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\ registry subkey.

2. Alternatively, see this link , very useful in locating GUID in registry .

Additionally, you may see these errors as well in Summary.txt under Hotfix folder :

----------------------------------------------------------------------------------

Error Number : 1642

Error Description : Unable to install Windows Installer MSP file

----------------------------------------------------------------------------------

Error Number : 1612

Error Description : Unable to install Windows Installer MSP file

----------------------------------------------------------------------------------

Error Number : 1646

Error Description : Unable to install Windows Installer MSP file

----------------------------------------------------------------------------------

Please see KB304888 for a list of error codes and error messages for Windows Installer processes.

Some More Information :

Service Pack/Hotfix/GDR/CU contains MSP files as compared to RTM product which has MSI files.

What is MSP ?

--------------------

A MSP (Microsoft Software Patch) is basically a set of transforms (modifications) against a baseline MSI (Microsoft Software Installer) file. When a MSP is installed, instead of updating the contents of the cached MSI (modifying it according to the transforms included in the MSP), Windows Installer simply caches the MSP. Then each time the MSI is run, the cached MSP is applied on the fly again. The reason it works this way is to simplify the authoring and building of MSPs, so that each MSP can be built only against RTM and not have to know about all the possible MSPs that have been released since then. For example, when SP2 is applied the SP1 patch is obsolete and Windows Installer just applies SP2 directly against the cached contents of the RTM product.

 

Prashant Kumar
SE, Microsoft SQL Server

Comments

  • Anonymous
    January 30, 2009
    PingBack from http://blog.a-foton.ru/index.php/2009/01/30/part-%e2%80%93-1-sql-server-2005-patch-fails-to-install-with-an-error-unable-to-install-windows-installer-msp-file/

  • Anonymous
    January 30, 2009
    A very fine blog posting on msp/installer errors.  I think it is the most concise I have read.  Great job!

  • Anonymous
    February 26, 2009
    Environment : è Windows Server 2003 SP2 x64 è SQL Server 2005 Standard Edition SP2 x86 Build 9.00.3215

  • Anonymous
    March 02, 2009
    Thanks a lot for this post! You just forgot to mention that we need do all these steps for DTS, NS, RS, OLAP and so on. It works really great!

  • Anonymous
    March 02, 2009
    The comment has been removed

  • Anonymous
    April 01, 2009
    The comment has been removed

  • Anonymous
    April 03, 2009
    Having the problem that I don't find the GUID and the PatchCode from my log files in my registry   Help :-(

  • Anonymous
    April 29, 2009
    this post is Awesome!!! Thank you for the great explanation of what is occurring here and how to resolve the issue. You just saved me a call to MS. Thanks again.

  • Anonymous
    April 30, 2009
    This is a great article.  My only question is, why are the files missing?  Does this mean that maybe the installer directory contents got deleted?  Further explanation would be appreciated.

  • Anonymous
    May 15, 2009
    I noticed SQL updates (KB960089 but also SQL SP3) were failing to apply on the WSS Developer VM. After

  • Anonymous
    June 12, 2009
    Consider a scenario where an upgrade from SQL 2005 to SQL 2008 fails with the following messages while

  • Anonymous
    July 09, 2009
    Awesome work on this article. In my case the guid and patchcode were missing from the registry. I had made a note of my SQL version (for DR purposes) prior to running the SP3 install and took a shot in the dark that the previous version (which correlated to SP1) would be the MSP it was looking for. It appears to have straightened out the issue.

  • Anonymous
    July 20, 2009
    Just Brilliant! I couldn't install SP3 properly. The .msi and .msp files were missing from the installer directory... Probably due to a prior C: drive unenlightened cleanup.

  • Anonymous
    October 10, 2009
    Thank you for the concise explanation! I'm supporting a server that has MS SQL 2005 installation and my Database team came to me with this problem (they just attached the log files). This post really helps me to understand the logs and eventually solved the problem.

  • Anonymous
    October 18, 2009
    The information contained in this outline has been a tremendous help.  Although the process is not fast, being able to rebuild is perfect.  Thank you for all the good, factual information and direction.

  • Anonymous
    November 02, 2009
    The comment has been removed

  • Anonymous
    November 18, 2009
    This doc works. To find ProductCode in registry: Taking above example. GUID          = {2373A92B-1C1C-4E71-B494-5CA97F96AA19} PatchCode     = {4A35EF4A-D868-4B15-A84D-3E8925AA9558} Follow http://kb.flexerasoftware.com/selfservice/viewContent.do?externalID=Q105971, as said in the above doc New GUID = B29A3732C1C117E44B49C59AF769AA91 New PatchCode = A4FE53A4868D51B48AD4E39852AA5985 Now goto, HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInstallerUserDataS-1-5-18ProductsB29A3732C1C117E44B49C59AF769AA91PatchesA4FE53A4868D51B48AD4E39852AA5985 You should find Display Name on the right pane.

  • Anonymous
    February 16, 2010
    The comment has been removed

  • Anonymous
    February 27, 2010
    There really should be an automated mechanism for dealing with this.  Admins who find all of these patch directories lying around on their machine are likely to eventually clean them out not knowing that a directory called 05ba72b40ba6b4d61d14cd3c3283 is going to be necessary a year in the future.  This doesn't seem to be a problem with any of the other Microsoft apps...there really should be a better way.  For those of us who have ignorantly cleaned up these folders, we have to spend a lot of time just to apply SP3 when time is already at a premium.  Please change the installers to contain files that they need so it can automatically find what it needs rather than relying on your customer to figure out what it needs.

  • Anonymous
    April 09, 2010
    can u help having problems dont have SQLEVN70.RLL and SQL Server 2005 wont finish downloading stops at hotfix and gives error Time: 04/09/2010 13:44:28.328 KB Number: KB970892 Machine: DENELLE OS Version: Microsoft Windows XP Professional Service Pack 3 (Build 2600) Package Language: 1033 (ENU) Package Platform: x86 Package SP Level: 3 Package Version: 4053 Command-line parameters specified:     /quiet     /allinstances Cluster Installation: No


Prerequisites Check & Status SQLSupport: Passed


Products Detected                         Language  Level  Patch Level       Platform  Edition SQL Server Database Services 2005 (NR2007)  ENU       SP3    2005.090.4035.00  x86       EXPRESS


Products Disqualified & Reason Product                                   Reason


Processes Locking Files Process Name          Feature               Type          User Name                  PID


Product Installation Status Product                   : SQL Server Database Services 2005 (NR2007) Product Version (Previous): 4035 Product Version (Final)   : Status                    : Failure Log File                  : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGHotfixSQL9_Hotfix_KB970892_sqlrun_sql.msp.log SQL Express Features      : Error Number              : 29528 Error Description         : MSP Error: 29528  The setup has encountered an unexpected error while Installing performance counters. The error is: The specified path is invalid.


Summary     One or more products failed to install, see above for details     Exit Code Returned: 29528

  • Anonymous
    January 13, 2011
    this was perfectly explained on how to troubleshoot and resolve the sql server installation error message  "MainEngineThread is returning 1635" thanks!

  • Anonymous
    March 02, 2011
    Great article ! Another way is to use the following scripts, it will scan and repair the missing packages support.microsoft.com/default.aspx

  • Anonymous
    March 07, 2011
    The comment has been removed

  • Anonymous
    March 16, 2011
    Hi Tom, We also have below KBs to solve this problem. support.microsoft.com/.../2015100 How to Resolve missing MSI or MSP packages during SQL Server Service Packs, Hotfix or Cumulative Updates support.microsoft.com/.../969052 How to restore the missing Windows Installer cache files and resolve problems encountered during SQL Server update Regards, Balmukund

  • Anonymous
    March 17, 2011
    The comment has been removed

  • Anonymous
    June 21, 2011
    Check your recycle bin; all of my missing .msi files were in there. restored them, and the sp ran.