Installig SQL 2008R2 SP3 failed – Crytographic Error

Installing SQL Server 2008R2 SP3 should be a relatively easy and trouble free experience. In recent months I have updated over 50 instances with no issues.

Most of the time it’s a brainless repeatable process. Script logins, Backup databases, run  updates, test etc..
Then comes along something that causes me to think.

I was recently upgrading a batch of instances. I had my plan together and was running through the motions.

3 of the servers went through without a hiccup but e 4th failed almost immediately. Thinking it was something as simple as the server needed a refresh I performed a restart but came upon the same issue the second time.

Opening up the logs I was confronted with the following:

 Overall summary:
  Final result:                  The patch installer has failed to update the following instance: MSSQLSERVER. To determine the reason for failure, review the log files.
  Exit code (Decimal):           -2068053019
  Exit facility code:            1212
  Exit error code:               997
  Exit message:                  The patch installer has failed to update the following instance: MSSQLSERVER. To determine the reason for failure, review the log files.

Not a great deal of use

Looking further down the error log

 Log with failure:              C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20150328_100315\MSSQLSERVER\SqlSupport_Cpu64_1.log

OK. So now we have a detailed log file.

My rule of thumb with installer errors is to always look for the text ” Return value 3. “. The lines above this normally indicate the cause of the issue or at least where to look.

In my case I was confronted with

MSI (s) (E8:84) [10:06:04:385]: Source type from package 'sqlsupport.msi': 1
MSI (s) (E8:84) [10:06:04:385]: SECREPAIR: Hash Database: C:\Windows\Installer\SourceHash{74964326-CB2C-413B-B574-C4A90B8033E3}
MSI (s) (E8:84) [10:06:04:385]: SECREPAIR: SourceHash database file already exists. Deleting it.
MSI (s) (E8:84) [10:06:04:385]: Note: 1: 2262 2: SourceHash 3: -2147287038 
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: New Hash Database creation complete.
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:401]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:416]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:0
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: A general error running CryptAcquireContext
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Crypt Provider not initialized. Error:997
MSI (s) (E8:84) [10:06:04:432]: SECUREREPAIR: Failed to CreateContentHash of the file: Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\x64\Microsoft.SqlServer.Configuration.AgentExtension.dll: for computing its hash. Error: 997
MSI (s) (E8:84) [10:06:04:432]: SECREPAIR: Failed to create hash for the install source files
MSI (s) (E8:84) [10:06:04:432]: SECUREREPAIR: SecureRepair Failed. Error code: 3e5F47C23A8
Action start 10:06:04: ProcessComponents.
MSI (s) (E8:84) [10:06:07:458]: 
Error 997. Overlapped I/O operation is in progress.

MSI (s) (E8:84) [10:06:07:458]: Machine policy value 'DisableRollback' is 0
MSI (s) (E8:84) [10:06:07:458]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
Action ended 10:06:07: ProcessComponents. Return value 3.
MSI (s) (E8:84) [10:06:07:458]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) (E8:84) [10:06:07:458]: No System Restore sequence number for this installation.
MSI (s) (E8:84) [10:06:07:458]: Unlocking Server
Action ended 10:06:07: INSTALL. Return value 3.

Overlapping I/O Process, CryptAquireContext errors . none of these look good.

So I dismissed the overlapping I/O as the services were stopped at the time of the error.

OK. So clearly something was wrong with the Cryptographic provider, but what? I’m logged in as a local admin. I’m an SA. Cryptographic services are running. I even retested after stopping and restarting the Cryptographic services.

I manually deleted the Hash Database but nothing was working.

So what can cause the Crypt Services to fail? Well having been around the wintel world for 20+ years I have some rudimentary knowledge (Or scars) of this and know of a few areas to look.

Cryptographic keys are not just used for the installation. They are also integral to your user profile. I had not noticed any issues when logging in but I thought I’d check anyhow.

I logged off and on again. True to form a little message pops up in the corner.

User Profile Error

I had not noticed this the first time I logged in but that’s no guarantee it had not been there. After all I was swapping between machines to patch.

Luckily this turned out to be a relatively easy fix. As the company I work for has multiple domains I logged on using a different account I have and deleted my profile from the disk. Upon logging in again it recreated my profile properly and no message was displayed

This time upon installing the patch I was confronted with a message I’m used to.

SQL 2008R2 Service pack 3 Success message

So lessons Learned and a new scar. I spent about an hour trying to over think what in SQL Server could be causing the issue when I should have looked more carefully at the error.

This entry was posted in DBA. Bookmark the permalink.

1 Response to Installig SQL 2008R2 SP3 failed – Crytographic Error

  1. pavan says:

    I also face similar issue and checked your site , here it is clearly stated the issue and resolution thanks once again

Leave a Reply

Your email address will not be published. Required fields are marked *